Department of Computer Scien
ce and Information Engineering
National Cheng Kung University, TAIWAN
HANEL
PROGRAMMING THE 8255Connecting 8031/51 to
(^8255) (cont’)
Example 15-2 (cont’)(c)
MOV A,#80H ;control word
;(ports output)
MOV DPTR,#4003H ;load control reg
;port address
MOVX @DPTR,A ;issue control wordMOV A,#55H ;A = 55H
AGAIN: MOV DPTR,#4000H ;PA address
MOVX @DPTR,A ;toggle PA bitsINC DPTR ;PB addressMOVX @DPTR,A ;toggle PB bitsINC DPTR ;PC addressMOVX @DPTR,A ;toggle PC bitsCPL A ;toggle bit in reg AACALL DELAY ;waitSJMP AGAIN ;continue