"justify"> * stack used - 2 bytes *
* variables used - char: storage for received data (1 byte) *
* count: temporary storage (1 byte) *
* ROM used - 63 bytes * _char lda # 8; [2] receiving 8 data bits
sta count; [4] store value into RAM
clrx; [3] used to store noise data_start_bit brclr rxd, serial_port, *; [5] wait until rxd = 1
brset rxd, serial_port, *; [5] wait for start bit
lda # BAUD_SEL-3; [2] prepare for 1/2 bit delay
bsr delay_13a; [13a +12] execute delay routine
bsr get_bit; [39] sample start bit
lsra; [3] noise bit -> carry;
; acc = filtered start bit
bne get_start_bit; [3] if false start, start over
tsta; [3] for timing purposes only
tsta; [3] for timing purposes only
lda # 2 * (BAUD_SEL-2); [2] prepare for 1 bit delay
bsr delay_13a; [13a +12] execute delay routine_data_bits bsr get_bit; [39] sample data bit
rora; [3] noise bit -> carry
rorx; [3] carry -> noise data reg
rora; [3] filtered data bit -> carry
ror char; [5] carry -> char
lda # 2 * (BAUD_SEL-3); [2] prepare for 1 bit delay
bsr delay_13a; [13a +12] execute delay routine
tsta; [3] for timing purposes only
dec count; [5] bit received, dec count
bne get_data_bits; [3] loop if more bits to get_stop_bit bsr get_bit; [39] sample stop bit
lsra; [3] noise bit -> carry
; acc = filtered stop bit
sta count; [4] store stop bit in count
bcc yes_noise; [3] if noise, then branch
txa; [2] noise data -> acc
eor char; [3] XOR noise with char,
beq no_noise; [3] and if result = 0,
; then no noise in data ​​p>
; reception_noise lda # $ 08; [2] set noise bit (half carry)
add # $ 08; [2] by adding $ 8 to $ 8_noise lda count; [3] retrieve stop data bit,
coma; [3] complement it,
lsra; [3] and shift it into carry
; for frame error bit
rts; [6] exit (get_char)
****************************************** ***********************************
****************************************** ************************************
* get_bit - receive one bit of filtered data and noise in...