
414 THE x86 MICROPROCESSORS
RECEIVER PROGRAM
DATR EQU 0C0H
CSR EQU 0C2H
RECD DB 6 DUP(0) ;location for received data
LEA SI, RECD ;point SI to character string
MOV CX, 06 ;CX = the number of characters
MOV AL, 4EH ;mode word
OUT CSR, AL ;send it to control register
MOV AL, 36H ;command word to enable receiver
OUT CSR, AL ;send it to control register
REPEA: IN AL, CSR ;read in status register
AND AL, 02 ;test if D
1
is 1.
i.e., is Rx ready?
JE REPEA ;if not ‘1’ keep testing
NXT: IN AL, DATR ;get received character into Al
MOV [SI], AL ;move it to memory
INC SI ;increment pointer
LOOP NXT ;continue until CX ...