ORG 0000H
LJMP MAIN
ORG 0030H
MAIN:
MOV A,30H
ADD A,40H
PUSH ACC
MOV DPTR,#LEDTAB
MOVC ANL A,#0FH
MOVC A,#A+DPTR
MOV P0,A
POP ACC
SWAP A
ANL A,#0FH
MOVC A,@A+DPTR
MOV P2,A
SJMP $
LEDTAB:
DB 0C0H ;"0" 00H
DB 0F9H ;"1" 01H
DB 0A4H ;"2" 02H
DB 0B0H ;"3" 03H
DB 99H ;"4" 04H
DB 92H ;"5" 05H
DB 82H ;"6" 06H
DB 0F8H ;"7" 07H
DB 80H ;"8" 08H
DB 90H ;"9" 09H
DB 88H ;"A" 0AH
DB 83H ;"B" 0BH
DB 0C6H ;"C" 0CH
DB 0A1H ;"D" 0DH
DB 86H ;"E" 0EH
DB 8EH ;"F" 0FH
DB 0FFH ;" " 10H
END