RI & TI
in SCON play an important role in serial
communications. Both bits are set by hardware but must
be cleared by software.
RI is set at the end of character reception and indicates
receive buffer full
This condition is tested in software or programmed to
cause an interrupt.
If software wishes to input a character from the device
connected to the serial port, it must wait until RI is set,
then clear RI and read the character from SBUF.
JNB RI, WAIT
; Check RI until set
; Clear the flag
MOV A, SBUF
; Read character