|
如下为何二级中断优先级动作后不返回一级低级中断?还有的是优先级动作后返回主程序了,一级低级中断再也不能有动作?
请指点~~~~~~~~谢了
$MOD52
ORG 0000H
LJMP MAIN
ORG 0003H
LJMP INT
ORG 0013H
LJMP INT2
MAIN:
MOV IE,#85H
MOV TCON,#05H
SETB PX1
MOV P0,#00H
MOV P2,#00H
CLR P1.3
SETB P1.0
LCALL DELAY
CLR P1.0
LCALL DELAY
LJMP MAIN
DELAY:
MOV R7,#250
D1: MOV R6,#100
D2: DJNZ R6,D2
DJNZ R7,D1
RET
DELAY2:
MOV R7,#10
A3: MOV R6,#255
A1: MOV R5,#255
A2: DJNZ R5,A2
DJNZ R6,A1
DJNZ R7,A3
RET
INT:
CLR EA
PUSH PSW
PUSH ACC
SETB EA
SETB P1.3
LCALL DELAY2
CLR EA
POP ACC
POP PSW
SETB EA
RETI
INT2:
PUSH PSW
PUSH ACC
MOV A,#0FFH
CLR CY
MOV R1,#8
LEFT:
RLC A
MOV P2,A
LCALL DELAY
DJNZ R1,LEFT
POP ACC
POP PSW
RETI
END
[em01] |
|