max7219驱动8个共阴数码管的汇编程序,求大神指导程序哪里出错了
DINBITP2.0LOADBITP2.1CLKBITP2.2ORG0000HAJMPSTARTORG0030HSTART:MOVSP,#60HMOVA,#0AHMOVB...
DIN BIT P2.0
LOAD BIT P2.1
CLK BIT P2.2
ORG 0000H
AJMP START
ORG 0030H
START: MOV SP,#60H
MOV A,#0AH
MOV B,#0AH
LCALL WRITE
MOV A,#09H
MOV B,#05H
LCALL WRITE
MOV A,#0BH
MOV B,#07H
LCALL WRITE
MOV A,#0CH
MOV B,#01H
LCALL WRITE
MOV A,#01H
MOV B,#0FFH
LCALL WRITE
MOV A,#02
MOV B,#0FFH
LCALL WRITE
MOV A,#03
MOV B,#08H
LCALL WRITE
MOV A,#04
MOV B,#00H
LCALL WRITE
MOV A,#05
MOV B,#05H
LCALL WRITE
MOV A,#06
MOV B,#01H
LCALL WRITE
MOV A,#07
MOV B,#0FFH
LCALL WRITE
MOV A,#08
MOV B,#0FFH
LCALL WRITE
WRITE: MOV R0,#8
LOOP1: RLC A
MOV DIN,C
CLR CLK
SETB CLK
DJNZ R0,LOOP1
MOV R0,#8
MOV A,B
LOOP2: RLC A
MOV DIN,C
CLR CLK
SETB CLK
DJNZ R0,LOOP1
CLR LOAD
SETB LOAD
RET
END 展开
LOAD BIT P2.1
CLK BIT P2.2
ORG 0000H
AJMP START
ORG 0030H
START: MOV SP,#60H
MOV A,#0AH
MOV B,#0AH
LCALL WRITE
MOV A,#09H
MOV B,#05H
LCALL WRITE
MOV A,#0BH
MOV B,#07H
LCALL WRITE
MOV A,#0CH
MOV B,#01H
LCALL WRITE
MOV A,#01H
MOV B,#0FFH
LCALL WRITE
MOV A,#02
MOV B,#0FFH
LCALL WRITE
MOV A,#03
MOV B,#08H
LCALL WRITE
MOV A,#04
MOV B,#00H
LCALL WRITE
MOV A,#05
MOV B,#05H
LCALL WRITE
MOV A,#06
MOV B,#01H
LCALL WRITE
MOV A,#07
MOV B,#0FFH
LCALL WRITE
MOV A,#08
MOV B,#0FFH
LCALL WRITE
WRITE: MOV R0,#8
LOOP1: RLC A
MOV DIN,C
CLR CLK
SETB CLK
DJNZ R0,LOOP1
MOV R0,#8
MOV A,B
LOOP2: RLC A
MOV DIN,C
CLR CLK
SETB CLK
DJNZ R0,LOOP1
CLR LOAD
SETB LOAD
RET
END 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询