ORG 00H
MOV SCON,#00000000B
START: MOV DPTR,#TABLE
LOOP: CLR A
MOVC A,@A+DPTR
CJNE A,#03,A1
JMP START
A1: CPL A
MOV 30H,A
MOV SBUF,30H
LOOP1: JBC TI,LOOP2
JMP LOOP1
LOOP2: CALL DELAY
INC DPTR
JMP LOOP
DELAY: MOV R5,#30
D1: MOV R6,#20
D2: MOV R7,#248
DJNZ R7,$
DJNZ R6,D2
DJNZ R5,D1
RET
TABLE: DB 80H,40H,20H,10H ;
DB 08H,04H,02H,01H
DB 01H,02H,04,08H ;
DB 10H,20H,40H,80H ;
DB 80H,40H,20H,10H ;
DB 08H,04H,02H,01H ;
DB 01H,02H,04H,08H ;
DB 10H,20H,40H,80H ;
DB 0FH,0F0H,0FH,0F0H ;
DB 00H,0FFH,00H,0FFH ;
DB 03H
END