求助!七段显示器控制电路四位數汇编哪里出问题呢?
七段显示器控制电路四位數_使用译码器驱动
ORG 00H
JMP ST
ST: MOV R0,#30H
MOV 30H,#00H
MOV R1,#31H
MOV 31H,#00H
MAIN: MOV R5,#5
LOOP: MOV A,#E0H ;个位
XCHD A,@R0
MOV P2,A
CALL DELAY
XCHD A,@R0
MOV A,@R0 ;十位
SWAP A
MOV @R0,A
MOV A,#D0H
XCHD A,@R0
MOV P2,A
CALL DELAY
XCHD A,@R0
MOV A,@R0
SWAP A
MOV @R0,A
MOV A,#B0H ;百位
XCHD A,@R1
MOV P2,A
CALL DELAY
XCHD A,@R1
MOV A,@R1 ;千位
SWAP A
MOV @R1,A
MOV A,#70H
XCHD A,@R1
MOV P2,A
CALL DELAY
XCHD A,@R1
MOV A,@R1
SWAP A
MOV @R1,A
DJNZ R5,LOOP
MOV A,@R0 ;加1
ADD A,#1
DA A
MOV @R0,A
CJNE A,#00H,JMAIN
MOV A,@R1 ;加1
ADD A,#1
DA A
MOV @R1,A
CJNE A,#00H,JMAIN
JMP ST
JMAIN: JMP MAIN
DELAY: MOV R2,#10
D1: MOV R3,#249
DJNZ R3,$
DJNZ R2,D1
RET
END |