wangyexin 发表于 2011-11-30 14:51:38

发个数码管动态显示的汇编版

本帖最后由 wangyexin 于 2011-11-30 16:02 编辑


ORG 0000H
AJMP MAIN
TAB: DB 3FH,06H,5BH,4FH
DB 66H,6DH,7DH,07H
DB 7FH,6FH,77H,7CH
DB 39H,5EH,79H,71H
MAIN: MOV TCON,#10H
MOV TMOD,#01H
MOV TH0,#0E8H
MOV TL0,#00H
MOV A,#00H
MOV DPTR,#TAB
MOV R3,#00H

LOOP1:
MOV A,R3
MOVC A,@A+DPTR
MOV P0,A
CALL DELAY
INC R3
CJNE R3,#10H,LOOP1
MOV R3,00H
AJMP LOOP1
DELAY:
MOV R0,08H
LOOP2: MOV R4,#08H
LOOP3: JNB TF0,LOOP3
CLR TF0
MOV TH0,#0F8H
MOV TL0,#00H
DEC R4
MOV P2,R4
INC R4
DJNZ R4,LOOP3
DJNZ R0,LOOP2
RET
END
页: [1]
查看完整版本: 发个数码管动态显示的汇编版