ORG 0000H
AJMP MAIN
ORG 0030H
MAIN:MOV P0,#0FFH
MOV A,#0FFH
WAIT:MOV P0,A
JB P1.0,WAIT
ACALL DELAY
ACALL DELAY
JB P1.0,LOOP
LOOP4:MOV P0,#00H
MOV A,#01H
LOOP3:MOV P0,A
RL A
ACALL DELAY
MOV R3,#0
CJNE R3,#7,LOOP3
JMP MAIN
LOOP:CPL A
JMP WAIT
DELAY:MOV R2,#0FFH
LOOP1:MOV R1,#0FFH
LOOP2:DJNZ R1,LOOP2
DJNZ R2,LOOP1
RET
END
为什么这段程序按了button之后一直循环在流水灯里面,貌似JMP MAIN都不跳出来
求大神帮忙啊,新手入门,爱学习哎好奇。 |