
PERIPHERAL INTERFACING I 317
PC EQU 0C4H ;address of Port C
MOV AL, 98H ;control word in AL
OUT CR, AL ;send it to control register
MOV AL, 00 ;address corresponding to IN0
OUT PB, AL ;send it to Port B
MOV AL, 00 ;BSR control word to clear ALE (PC
0
)
OUT CR, AL ;send it to the control register
MOV AL, 01 ;BSR control word for setting ALE (PC
0
)
OUT CR, AL
MOV AL, 03 ;BSR control word to set SC(PC
1
)
OUT CR, AL
CALL DELAY ;call a delay
MOV AL, 00 ;BSR control word for clearing ALE(PC
0
)
OUT CR, AL
MOV AL, 02 ;BSR control word for clearing SC(PC
1
)
OUT CR, AL
AGN: IN AL, PC ;read in the contents of Port C
RLC ;rotate left to ...