Department of Computer Science and Information EngineeringNational Cheng Kung University, TAIWAN
HANELPROGRAMMING THE 8255Connecting 8031/51 to
(^8255) (cont’)
For the program in Example 15-3
¾it is recommended that you use the EQU directive for port address as shown nextAPORT EQU 1000HBPORT EQU 1001HCPORT EQU 1002HCNTPORT EQU 1003HMOV A,#90H
;(PA=IN, PB=OUT, PC=OUT)MOV DPTR,#CNTPORT ;loadcntr reg port addrMOVX @DPTR,A;issue control wordMOV DPTR,#APORT ;PA addressMOVX A,@DPTR ;get data from PAINC DPTR ;PB addressMOVX @DPTR,A;send the data to PBINC DPTR ;PC addressMOVX @DPTR,A ;send it also to PC