ORG 0000H
LJMP 0100H
ORG 0100H
MAIN:MOV DPTR,#0FE00H
MOV A,#03H
MOVX @DPTR,A
MOV R0,#00000001B
MOV DPTR,#TAB
MOV A,#0
MOV R2,A
MOVC A,@A+DPTR
MOV R1,A
TZ1:MOV DPTR,#0FE02H
MOV A,R0
MOVX @DPTR,A
MOV DPTR,#0FE01H
MOV A,R1
MOVX @DPTR,A
LCALL DELAY
SJMP TZ2
TZ2:MOV A,R0
RL A
MOV R0,A
INC R2
MOV A,R2
MOV DPTR,#TAB
MOVC A,@A+DPTR
MOV R1,A
CJNE R0,#01000000B,TZ1
MOV R0,#00000001B
MOV DPTR,#TAB
MOV A,#0
MOV R2,A
MOVC A,@A+DPTR
MOV R1,A
SJMP TZ1
DELAY:MOV R7,#02H
MOV R6,#0FFH
DJNZ R6,$
DJNZ R7,$-4
RET
TAB:DB 0F9H,0A4H,0C0H,0F9H
DB 0C0H,92H
END