;项目名称:单位数码管显示0~9
;硬件环境:AT89C51
;硬件描述:P0口接八个数码管;P2.2 控制数码管
;功能描述:数码显示实验
;*******************************************************
ORG 0000H
AJMP START
ORG 0030H
START: MOV R0,#0
CLR P2.2
AAA: LCALL SHOW
INC R0
MOV A,R0
CJNE A,#10,AAA
SJMP START
SHOW: MOV A,R0
MOV DPTR,#LED
MOVC A,@A+DPTR
MOV P0,A
LCALL DELAY
RET
DELAY: MOV R7,#250
DL1: MOV R6,#100
DL2: MOV R5,#10
DJNZ R5,$
DJNZ R6,DL2
DJNZ R7,DL1
RET
LED: DB 0C0H,0F9H,0A4H,0B0H,99H,92H,82H,0F8H,80H,90H
DB 88H,83H,0C6H,0A1H,86H,8EH
END