作者: 来源:互联网
ORG 00H
START:
MOV A,#00
MOV P0,A
CALL DIS
CALL DELAY
JMP START
DIS: MOV R2,#25
MOV 20H,#00
D4: MOV R4,#00H
MOV R1,#0F5H
D5: MOV R6,#08
MOV R0,20H
D2: CALL READ1
INC R4
DJNZ R6,D2
MOV R4,#00H
DJNZ R1,D5
MOV 20H,R0
DJNZ R2,D4
RET
READ1: MOV A,R4
MOV P2,A
MOV A,R0
MOV DPTR,#TABLE
MOVC A,@A+DPTR
MOV P0,A
INC R0
MOV R3,#100
DJNZ R3,$
MOV A,#00H
MOV P0,A
RET
DELAY: MOV R3,#200
D7: MOV R5,#248
DJNZ R5,$
DJNZ R3,D7
RET
TABLE:
DB 00H,00H,00H,00H,00H,00H,00H,81H
DB 00H,00H,00H,00H,00H,00H,81H,0FFH
DB 00H,00H,00H,00H,00H,81H,0FFH,81H
DB 00H,00H,00H,00H,81H,0FFH,81H,00H
DB 00H,00H,00H,81H,0FFH,81H,00H,00H
DB 00H,00H,81H,0FFH,81H,00H,00H,00H
DB 00H,81H,0FFH,81H,00H,00H,00H,38H
DB 81H,0FFH,81H,00H,00H,00H,38H,7CH
DB 0FFH,81H,00H,00H,00H,38H,7CH,7EH
DB 81H,00H,00H,00H,38H,7CH,7EH,3FH
DB 00H,00H,00H,38H,7CH,7EH,3FH,7EH
DB 00H,00H,38H,7CH,7EH,3FH,7EH,7CH
DB 00H,38H,7CH,7EH,3FH,7EH,7CH,38H
DB 38H,7CH,7EH,3FH,7EH,7CH,38H,00H
DB 7CH,7EH,3FH,7EH,7CH,38H,00H,00H
DB 7EH,3FH,7EH,7CH,38H,00H,00H,00H
DB 3FH,7EH,7CH,38H,00H,00H,00H,0FCH
DB 7EH,7CH,38H,00H,00H,00H,0FCH,02H
DB 7CH,38H,00H,00H,00H,0FCH,02H,01H
DB 38H,00H,00H,00H,0FCH,02H,01H,01H
DB 00H,00H,00H,0FCH,02H,01H,01H,02H
DB 00H,00H,0FCH,02H,01H,01H,02H,0FCH
DB 00H,0FCH,02H,01H,01H,02H,0FCH,00H
DB 0FCH,02H,01H,01H,02H,0FCH,00H,00H
DB 02H,01H,01H,02H,0FCH,00H,00H,00H
end