
20-36
x86 MICROPROCESSORS
Example 20.23b
ORG 0 ;reset vector 0
LJMP STRT ;bypass interrupt vectors
ORG 0023H ;ISR, when TI is set
CLR TI ;clear TI
MOV SBUF,#‘M’ ;move ‘M’ to SBUF
RETI ;return
ORG 0040H ;origin of main program
STRT: MOV TMOD,#20H ;timer 1, mode 2
MOV TH1,#0FDH ;baud = 9600
MOV IE,#90H ;enable the serial interrupt
MOV SCON,#50H ;serial communication setup
SETB TR1 ;start Timer 1
MOV SBUF,#‘M’ ;copy ‘M’ to SBUF for sending
HERE: SJMP HERE ;wait for TI and interrupt
END
20.6.7 | Serial Reception
Next let us discuss serial reception. The pin for it is RxD. Data is received, with the start
bit first, then the data byte ...