rs. * p align="justify"> **
* input cond. - Reset *
* output cond. - None (infinite loop) *
* stack used - 4 bytes *
* variables used - none *
* ROM used - 28 bytes *
****************************************** ***********************************
org ROM; start at the top of ROMrsp; reset the stack pointer
jsr init; initialize port pins_loop jsr get_char; receive one byte of data ​​p>
; from rxd pin
bcc no_frame_error; branch if no noise occured
bclr frame, status_port; turn on frame LED
bra continue; don't check for noise -
; it's undefined_frame_err bset frame, status_port; turn off frame LED
bhcs noise_error; branch if noise occured
bset noise, status_port; turn off noise LED
bra continue; skip next line of code_noise_err bclr noise, status_port; turn on noise LEDjsr put_char; transmit the received byte
bra main_loop; and prepare for next
; reception.
* init - initialize port pins for sci operation and for driving LEDs; *
* called by main *
**
* input cond. - None *
* output cond. - TXD = output initialize to 1, RXD = input, noise LED = *
* off, frame LED = off. * p align="justify"> * stack used - 0 bytes *
* variables used - none *
* ROM used - 15 bytes *
****************************************** ************************************ bset txd, serial_port; init txd = 1
bset txd, serial_port +4; txd = output
bclr rxd, serial_port +4; rxd = input
bset noise, status_port; noise LED = off
bset noise, status_port +4; noise = output
bset frame, status_port; frame LED = off
bset frame, status_port +4; frame = output
rts; exit (init)
****************************************** ************************************
* get_char - receive one byte of data from RXD pin; called by main *
**
* input cond. - RXD pin defined as an input pin * output cond. - Char contains received data; X, ACC undefined; *
* half carry = 1 (frame occured) or 0 (no frame error); *
* carry = 1 (noise and/or frame error occured) or 0 *
* (no noise). * p align=...