
256
Chapter 5 Interrupt
Value that is set to IPL
7
0
Not changed
5.3.2 Changes of IPL When Interrupt Request Acknowledged
When an interrupt request is acknowledged, the interrupt priority level of the acknowledged interrupt is
set to the processor interrupt priority level (IPL).
If an interrupt request is acknowledged that does not have an interrupt priority level, the value shown in
Table 5.3.2 is set to the IPL.
Table 5.3.2 Relationship between Interrupts without Interrupt Priority Levels and IPL
Interrupt sources without interrupt priority levels
_______
Watchdog timer, NMI
Reset
Other
5.3.3 Saving Registers
In an interrupt sequence, only the contents of the flag register (FLG) and program counter (PC) are
saved to the stack area.
The order in which these contents are saved is as follows: First, the 4 high-order bits of the program
counter and 4 high-order bits and 8 low-order bits of the FLG register for a total of 16 bits are saved to
the stack area. Next, the 16 low-order bits of the program counter are saved. Figure 5.3.2 shows the
stack status before an interrupt request is acknowledged and the stack status after an interrupt request
is acknowledged.
If there are any other registers you want to be saved, save them in software at the beginning of the
interrupt routine. The PUSHM instruction allows you to save all registers except the stack pointer (SP)
by a single instruction.
5.3 Interrupt Sequence
[SP]
Stack pointer
value before
interrupt occurs
Stack status before interrupt request is acknowledged
Address
Stack status after interrupt request is acknowledged
Figure 5.3.2 Stack status before and after an interrupt request is acknowledged
m–4
m–3
m–2
m–1
m
m+1
LSBMSB
LSB
MSB
Address
Stack area Stack area
Flag register
(FLG
L
)
Program counter
(PC
H
)
Flag register
(FLG
H
)
Content of
previous stack
Content of
previous stack
Content of
previous stack
Content of
previous stack
Program counter
(PC
L
)
Program counter
(PC
M
)
[SP]
New stack
pointer value
m–4
m–3
m–2
m–1
m
m+1
Comentarios a estos manuales