采用共阴极LED数码管,51单片机P1口输出数据:ORG 0000H
JMP MAIN
ORG 0100H
MAIN:MOV DPTR,#TAB
MOV R1,#00H
DISP:MOV A,R1
MOVC A,@A+DPTR
MOV P1,A
LCALL DELAY
INC R1
CJNE R1,#0AH,DISP
SJMP $
TAB: DB 3FH,06H,5BH,4FH,66H,6DH,7DH,07H,7FH,6FHDELAY: MOV R4,#2
DELAY100MS:MOV R5,#200
DELAY5MS: MOV R6,#250
LOOP: DJNZ R6,LOOP
DJNZ R5,DELAY5MS
DJNZ R4,DELAY100MS
RET