ORG 0000H
AJMP START
ORG 000BH
AJMP TIME0
ORG 0013H
AJMP INTE1
ORG 001BH
AJMP TIME1
ORG 100H
TABLE: DB 7EH,0BDH,0DBH,0E7H,0DBH,0BDH,7EH,0AAH,55H,00H,0FFH
START:
TIMERINIT:
MOV TMOD,#11H
MOV TH1,#3CH
MOV TL1,#0B0H
SETB TR1
SETB ET1
SETB EA
INTERRUINIT:
SETB EX1
SETB IT1
MAIN:
LOOP1:
MOV R2,#0BH
MOV DPTR,#100H
LOOP2:
MOV A,R1
MOVC A,@A+DPTR
MOV P1,A
DJNZ R2,LOOP1
AJMP LOOP2
TIME0:
MOV TH0,#3CH
MOV TL0,#0B0H
INC R4
CJNE R4,#64H,AAA
MOV R5,#0FH
MOV R4,#00H
AAA:
RETI
TIME1:
MOV TH1,#3CH
MOV TL1,#0B0H
INC R3
CJNE R3,#14H,AA
INC R1
CJNE R1,#0BH,BB
MOV R1,#00H
BB:
MOV R3,#00H
AA:
RETI
INTE1:
MOV P1,#0C3H
MOV P2,#00H
SETB TR0
SETB ET0
TEST:
CJNE R5,#0FH,TEST
MOV R5,#00H
CLR TR0
CLR ET0
RETI
END
题目是:程序开始后P1口的LED按规则亮灭(此处没有问题),当按下键触发中断时P1.2,P1.3,P1.4,P1.5亮,并持续五秒然后跳出中断继续最初的动作,我用PROYEUS仿真发现进入中断后程序一直停在
TEST:
CJNE R5,#0FH,TEST
处跳不出中断,多次检查,修改无果,希望朋友们能帮我看一下问题出在哪里了~ |