ORG 0000H
SJMP MAIN
ORG 0030H
MAIN:MOV P1,#0FFH
AAA: MOV A,P1
CJNE A,#11110111B,BBB
MOV P0,#0F9h
BBB:
CJNE A,#11101111B,CCC
MOV P0,#0A4h
CCC:
CJNE A,#11011111B,DDD
MOV P0,#0B0h
DDD:
CJNE A,#10111111B,EEE
MOV P0,#99h
EEE:
CJNE A,#01111111B,AAA
MOV R7,#10
MOV R2,#0
LOOP:MOV A,R2
MOV DPTR,#NUM
MOVC A,@A+DPTR
MOV P0,A
INC R2
CALL DELAYS
DJNZ R7,LOOP
JMP MAIN
DELAYS: MOV R3,#100
D11: MOV R4,#10
D12: MOV R5,#249
Dl: NOP
NOP
DJNZ R5,Dl
DJNZ R4,D12
DJNZ R3,D11
RET
NUM: DB 0C0h,0F9h,0A4h,0B0h,99h,92h,82h,0F8h,80h,90h
END
|