自制小程序
时间:10-02
整理:3721RD
点击:
精简数码管
ORG 0000H
START: CLR P2.0
MOV DPTR, #TAB
MOV R0, #00H
LOOP: MOV A, R0
MOVC A, @A+DPTR
MOV 20H, A
MOV P0, 20H
LCALL DELAY
INC R0
CJNE R0, #0AH,L1
MOV R0, #00H
L1: SJMP LOOP
TAB: DB 0C0H,0F9H,0A4H,0B0H,099H,092H,082H,0F8H,080H,090H
LJMP START
DELAY: MOV R5, #20
D1: MOV R6, #20
D2: MOV R7, #248
DJNZ R7,$
DJNZ R6, D2
DJNZ R5, D1
RET
END
ORG 0000H
START: CLR P2.0
MOV DPTR, #TAB
MOV R0, #00H
LOOP: MOV A, R0
MOVC A, @A+DPTR
MOV 20H, A
MOV P0, 20H
LCALL DELAY
INC R0
CJNE R0, #0AH,L1
MOV R0, #00H
L1: SJMP LOOP
TAB: DB 0C0H,0F9H,0A4H,0B0H,099H,092H,082H,0F8H,080H,090H
LJMP START
DELAY: MOV R5, #20
D1: MOV R6, #20
D2: MOV R7, #248
DJNZ R7,$
DJNZ R6, D2
DJNZ R5, D1
RET
END
沙发~我的,呵呵
不错 啊 学习下
汇编看不懂
挺有意思的小东西