汇编程序 按钮 max7219
发布网友
发布时间:2022-08-25 01:00
我来回答
共2个回答
热心网友
时间:2天前
max7219不太好用,特别不稳定。不如用两个4094.也是串行通讯。
加减计数简单多了,二位数十进制连续加减调整位闪烁汇编程序,
以前写的,肯定有好多漏洞或错误。请自己分析,希望对你有所帮助。
ORG0000H
AJMPSTART
ORG000BH;定时器0的中断向量地址
AJMPTIME0;跳转到真正的定时器程序处
ORG30H
START:MOVTMOD,#00000001B;定时/计数器0工作于方式1
MOVTH0,#15H
MOVTL0,#0A0H;即数5536
SETBEA;开总中断允许
SETBET0;开定时/计数器0允许
SETBTR0
SETBP0.0
CLRP0.1
CLRP2.7
MOVR3,#C0H
MOVR4,#C0H
AJMPBH1
BH10:LCALLAJYS
JBP2.4,BH1
CPLP2.7
BH11:JNBP2.4,BH11
LCALLAJYS
JNBP2.4,BH11
AJMPBH1
JIAKS:MOVR1,#0
MOVR3,#C0H
MOVP1,R3
AJMPBH1
JIANKS:MOVR1,#9
MOVR3,#90H
MOVP1,R3
BH1:JNBP2.4,BH10
JNBP2.2,JIA
JNBP2.3,JIAN
JNBP2.5,BCSJ;BCSJ意思是保存数据
JNBP2.7,BH1
AJMPBH2
;============================
JIA:LCALLAJYS ;加
JBP2.2,BH1
INCR1
CJNER1,#10,D1
AJMPJIAKS
D1:MOVA,R1
MOVDPTR,#TABLE
MOVCA,@A+DPTR
CPLA
MOVR3,A
MOVP1,A
LCALLAJYS
AJMPBH1
;============================
JIAN:LCALLAJYS ;减
JBP2.3,BH1
DECR1
CJNER1,#FFH,D2
AJMPJIANKS
D2:MOVA,R1
MOVDPTR,#TABLE
MOVCA,@A+DPTR
CPLA
MOVR3,A
MOVP1,A
LCALLAJYS
AJMPBH1
;============================
JIAKS2:MOVR2,#0
MOVR4,#C0H
MOVP1,R4
AJMPBH2
JIANKS2:MOVR2,#9
MOVR4,#90H
MOVP1,R4
BH2:JNBP2.4,BH10
JNBP2.2,JIA2
JNBP2.3,JIAN2
JNBP2.5,BCSJ
JNBP2.7,BH1
AJMPBH2
;============================
JIA2:LCALLAJYS
JBP2.2,BH2
INCR2
CJNER2,#10,D3
AJMPJIAKS2
D3:MOVA,R2
MOVDPTR,#TABLE
MOVCA,@A+DPTR
CPLA
MOVR4,A
MOVP1,A
LCALLAJYS
L5:AJMPBH2
;============================
JIAN2:LCALLAJYS
JBP2.3,BH2
DECR2
CJNER2,#FFH,D4
AJMPJIANKS2
D4:MOVA,R2
MOVDPTR,#TABLE
MOVCA,@A+DPTR
CPLA
MOVR4,A
MOVP1,A
LCALLAJYS
AJMPBH2
;============================
TABLE:DB3FH,06H,5BH,4FH,66H,6DH,7DH,07H,7FH,6FH
AJYS:MOVR6,#255
L102:MOVR5,#255
L92:DJNZR5,L92
DJNZR6,L102
RET
TIME0:;定时器0的中断处理程序
PUSHACC
PUSHPSW;将PSW和ACC推入堆栈保护
CPLP0.0
CPLP0.1
JBP0.0,L8
JBP0.1,L9
L8:MOVP1,R3
JNBP2.7,DSQ1
AJMPDSQ2
L9:MOVP1,R4
JBP2.7,DSQ1
AJMPDSQ2
DSQ1:MOVTH0,#EEH
MOVTL0,#88H
AJMPSSS
DSQ2:MOVTH0,#77H
MOVTL0,#88H;重置定时常数
SSS:POPPSW
POPACC
RETI
BCSJ:MOV21H,R1
MOV22H,R2
AJMPBH1
END
热心网友
时间:2天前
网上查好久只看到测试程序什么后面自己写的问题肯定很多望高手赐教,感激不尽我用的是汇编,如果你是汇编,我还能帮你看看,可C语言就不行了,它们认识追问我要个按钮加减用MAX7219驱动数码管显示的汇编程序
热心网友
时间:2天前
max7219不太好用,特别不稳定。不如用两个4094.也是串行通讯。
加减计数简单多了,二位数十进制连续加减调整位闪烁汇编程序,
以前写的,肯定有好多漏洞或错误。请自己分析,希望对你有所帮助。
ORG0000H
AJMPSTART
ORG000BH;定时器0的中断向量地址
AJMPTIME0;跳转到真正的定时器程序处
ORG30H
START:MOVTMOD,#00000001B;定时/计数器0工作于方式1
MOVTH0,#15H
MOVTL0,#0A0H;即数5536
SETBEA;开总中断允许
SETBET0;开定时/计数器0允许
SETBTR0
SETBP0.0
CLRP0.1
CLRP2.7
MOVR3,#C0H
MOVR4,#C0H
AJMPBH1
BH10:LCALLAJYS
JBP2.4,BH1
CPLP2.7
BH11:JNBP2.4,BH11
LCALLAJYS
JNBP2.4,BH11
AJMPBH1
JIAKS:MOVR1,#0
MOVR3,#C0H
MOVP1,R3
AJMPBH1
JIANKS:MOVR1,#9
MOVR3,#90H
MOVP1,R3
BH1:JNBP2.4,BH10
JNBP2.2,JIA
JNBP2.3,JIAN
JNBP2.5,BCSJ;BCSJ意思是保存数据
JNBP2.7,BH1
AJMPBH2
;============================
JIA:LCALLAJYS ;加
JBP2.2,BH1
INCR1
CJNER1,#10,D1
AJMPJIAKS
D1:MOVA,R1
MOVDPTR,#TABLE
MOVCA,@A+DPTR
CPLA
MOVR3,A
MOVP1,A
LCALLAJYS
AJMPBH1
;============================
JIAN:LCALLAJYS ;减
JBP2.3,BH1
DECR1
CJNER1,#FFH,D2
AJMPJIANKS
D2:MOVA,R1
MOVDPTR,#TABLE
MOVCA,@A+DPTR
CPLA
MOVR3,A
MOVP1,A
LCALLAJYS
AJMPBH1
;============================
JIAKS2:MOVR2,#0
MOVR4,#C0H
MOVP1,R4
AJMPBH2
JIANKS2:MOVR2,#9
MOVR4,#90H
MOVP1,R4
BH2:JNBP2.4,BH10
JNBP2.2,JIA2
JNBP2.3,JIAN2
JNBP2.5,BCSJ
JNBP2.7,BH1
AJMPBH2
;============================
JIA2:LCALLAJYS
JBP2.2,BH2
INCR2
CJNER2,#10,D3
AJMPJIAKS2
D3:MOVA,R2
MOVDPTR,#TABLE
MOVCA,@A+DPTR
CPLA
MOVR4,A
MOVP1,A
LCALLAJYS
L5:AJMPBH2
;============================
JIAN2:LCALLAJYS
JBP2.3,BH2
DECR2
CJNER2,#FFH,D4
AJMPJIANKS2
D4:MOVA,R2
MOVDPTR,#TABLE
MOVCA,@A+DPTR
CPLA
MOVR4,A
MOVP1,A
LCALLAJYS
AJMPBH2
;============================
TABLE:DB3FH,06H,5BH,4FH,66H,6DH,7DH,07H,7FH,6FH
AJYS:MOVR6,#255
L102:MOVR5,#255
L92:DJNZR5,L92
DJNZR6,L102
RET
TIME0:;定时器0的中断处理程序
PUSHACC
PUSHPSW;将PSW和ACC推入堆栈保护
CPLP0.0
CPLP0.1
JBP0.0,L8
JBP0.1,L9
L8:MOVP1,R3
JNBP2.7,DSQ1
AJMPDSQ2
L9:MOVP1,R4
JBP2.7,DSQ1
AJMPDSQ2
DSQ1:MOVTH0,#EEH
MOVTL0,#88H
AJMPSSS
DSQ2:MOVTH0,#77H
MOVTL0,#88H;重置定时常数
SSS:POPPSW
POPACC
RETI
BCSJ:MOV21H,R1
MOV22H,R2
AJMPBH1
END
热心网友
时间:2天前
网上查好久只看到测试程序什么后面自己写的问题肯定很多望高手赐教,感激不尽我用的是汇编,如果你是汇编,我还能帮你看看,可C语言就不行了,它们认识追问我要个按钮加减用MAX7219驱动数码管显示的汇编程序
热心网友
时间:2天前
max7219不太好用,特别不稳定。不如用两个4094.也是串行通讯。
加减计数简单多了,二位数十进制连续加减调整位闪烁汇编程序,
以前写的,肯定有好多漏洞或错误。请自己分析,希望对你有所帮助。
ORG0000H
AJMPSTART
ORG000BH;定时器0的中断向量地址
AJMPTIME0;跳转到真正的定时器程序处
ORG30H
START:MOVTMOD,#00000001B;定时/计数器0工作于方式1
MOVTH0,#15H
MOVTL0,#0A0H;即数5536
SETBEA;开总中断允许
SETBET0;开定时/计数器0允许
SETBTR0
SETBP0.0
CLRP0.1
CLRP2.7
MOVR3,#C0H
MOVR4,#C0H
AJMPBH1
BH10:LCALLAJYS
JBP2.4,BH1
CPLP2.7
BH11:JNBP2.4,BH11
LCALLAJYS
JNBP2.4,BH11
AJMPBH1
JIAKS:MOVR1,#0
MOVR3,#C0H
MOVP1,R3
AJMPBH1
JIANKS:MOVR1,#9
MOVR3,#90H
MOVP1,R3
BH1:JNBP2.4,BH10
JNBP2.2,JIA
JNBP2.3,JIAN
JNBP2.5,BCSJ;BCSJ意思是保存数据
JNBP2.7,BH1
AJMPBH2
;============================
JIA:LCALLAJYS ;加
JBP2.2,BH1
INCR1
CJNER1,#10,D1
AJMPJIAKS
D1:MOVA,R1
MOVDPTR,#TABLE
MOVCA,@A+DPTR
CPLA
MOVR3,A
MOVP1,A
LCALLAJYS
AJMPBH1
;============================
JIAN:LCALLAJYS ;减
JBP2.3,BH1
DECR1
CJNER1,#FFH,D2
AJMPJIANKS
D2:MOVA,R1
MOVDPTR,#TABLE
MOVCA,@A+DPTR
CPLA
MOVR3,A
MOVP1,A
LCALLAJYS
AJMPBH1
;============================
JIAKS2:MOVR2,#0
MOVR4,#C0H
MOVP1,R4
AJMPBH2
JIANKS2:MOVR2,#9
MOVR4,#90H
MOVP1,R4
BH2:JNBP2.4,BH10
JNBP2.2,JIA2
JNBP2.3,JIAN2
JNBP2.5,BCSJ
JNBP2.7,BH1
AJMPBH2
;============================
JIA2:LCALLAJYS
JBP2.2,BH2
INCR2
CJNER2,#10,D3
AJMPJIAKS2
D3:MOVA,R2
MOVDPTR,#TABLE
MOVCA,@A+DPTR
CPLA
MOVR4,A
MOVP1,A
LCALLAJYS
L5:AJMPBH2
;============================
JIAN2:LCALLAJYS
JBP2.3,BH2
DECR2
CJNER2,#FFH,D4
AJMPJIANKS2
D4:MOVA,R2
MOVDPTR,#TABLE
MOVCA,@A+DPTR
CPLA
MOVR4,A
MOVP1,A
LCALLAJYS
AJMPBH2
;============================
TABLE:DB3FH,06H,5BH,4FH,66H,6DH,7DH,07H,7FH,6FH
AJYS:MOVR6,#255
L102:MOVR5,#255
L92:DJNZR5,L92
DJNZR6,L102
RET
TIME0:;定时器0的中断处理程序
PUSHACC
PUSHPSW;将PSW和ACC推入堆栈保护
CPLP0.0
CPLP0.1
JBP0.0,L8
JBP0.1,L9
L8:MOVP1,R3
JNBP2.7,DSQ1
AJMPDSQ2
L9:MOVP1,R4
JBP2.7,DSQ1
AJMPDSQ2
DSQ1:MOVTH0,#EEH
MOVTL0,#88H
AJMPSSS
DSQ2:MOVTH0,#77H
MOVTL0,#88H;重置定时常数
SSS:POPPSW
POPACC
RETI
BCSJ:MOV21H,R1
MOV22H,R2
AJMPBH1
END
热心网友
时间:2天前
网上查好久只看到测试程序什么后面自己写的问题肯定很多望高手赐教,感激不尽我用的是汇编,如果你是汇编,我还能帮你看看,可C语言就不行了,它们认识追问我要个按钮加减用MAX7219驱动数码管显示的汇编程序