ORG 0000H
LJMP MAIN
ORG 030H
MAIN:
MOV R2,#0FFH
MOV R5,#0AH
D0: INC R2
MOV R4,#64H
MOV R1,#0FFH
D1: MOV R3,#0FFH
INC R1
D2: MOV A,R1
DA A
MOV R1,A
ANL A,#0FH
ACALL CHA
MOV P2,#0EBH
ACALL DELAY
MOV A,R1
SWAP A
ANL A,#0FH
ACALL CHA
MOV P2,#0E7H
ACALL DELAY
MOV A,R2
ACALL CHA
MOV P2,#0E3H
ACALL DELAY
DJNZ R3,D2
DJNZ R4,D1
DJNZ R5,D0
LJMP MAIN
CHA: MOV DPTR,#TAB
MOVC A,@A+DPTR
MOV P0,A
RET
DELAY: MOV R6,#0FH
D4: MOV R7,#0FH
DJNZ R7,$
DJNZ R6,D4
RET
TAB: DB 3FH,06H,5BH,4FH,66H,6DH,7DH,07H,7FH,6FH
END
我的是000--999的,用38译码器控制数码管的3个共阴端,楼主自己修改一下吧!祝楼主好运了!
看看:
http://hi.baidu.com/do_sermon/item/5761e8896ef67fcfb071540c
倒计时啊,哈
可以联系我