数码管 某两段一直亮
cpu是at89c52,数码管共阳的,程序如下:ORG0000HMOV30H,#0MOV31H,#1MOV32H,#2MOV33H,#3MOV34H,#4MOV35H,#...
cpu是at89c52,数码管共阳的,
程序如下:
ORG 0000H
MOV 30H,#0
MOV 31H,#1
MOV 32H,#2
MOV 33H,#3
MOV 34H,#4
MOV 35H,#5
MOV 36H,#6
MOV 37H,#7
MOV DPTR,#TAB
START:
MOV R0,#30H
MOV R1,#0FEH
MOV R2,#8
LOOP: MOV A,@R0
MOVC A,@A+DPTR
MOV P2,#0FFH
MOV P0,A
MOV P2,R1
INC R0
MOV A,R1
RL A
MOV R1,A
DJNZ R2,LOOP
SJMP START
TAB: DB 0C0H,0F9H,0A4H,0B0H,99H,092H,082H
DB 0F8H,080H,090H,0FFH,088H,0BFH
END 展开
程序如下:
ORG 0000H
MOV 30H,#0
MOV 31H,#1
MOV 32H,#2
MOV 33H,#3
MOV 34H,#4
MOV 35H,#5
MOV 36H,#6
MOV 37H,#7
MOV DPTR,#TAB
START:
MOV R0,#30H
MOV R1,#0FEH
MOV R2,#8
LOOP: MOV A,@R0
MOVC A,@A+DPTR
MOV P2,#0FFH
MOV P0,A
MOV P2,R1
INC R0
MOV A,R1
RL A
MOV R1,A
DJNZ R2,LOOP
SJMP START
TAB: DB 0C0H,0F9H,0A4H,0B0H,99H,092H,082H
DB 0F8H,080H,090H,0FFH,088H,0BFH
END 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询