deveopmen
Interrupts
Rev.B2 for proof reading
Mitsubishi Microcomputers
M32C/83 group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
95
Value that is set to IPL
7
0
Not changed
Figure 1.9.7. Stack status before and after an interrupt request is acknowledged
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 1.9.6 is set to the IPL.
Table 1.9.6 Relationship between Interrupts without Interrupt Priority Levels and IPL
Interrupt sources without interrupt priority levels
Watchdog timer, NMI
Reset
Other
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 are as follows: First, the FLG register is saved to the stack
area. Next, the 16 high-order bits and 16 low-order bits of the program counter expanded to 32-bit are
saved. Figure 1.9.7 shows the stack status before an interrupt request is acknowledged and the stack
status after an interrupt request is acknowledged.
In a high-speed interrupt sequence, the contents of the flag register (FLG) are saved to the flag save
register (SVF) and program counter (PC) are saved to PC save register (SVP).
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.
In high speed interrupt, switch register bank, then register bank 1 is used as high speed interrupt register.
In this case, switch register bank mode for high-speed interrupt routine.
[SP]
Stack pointer
value before
interrupt occurs
Stack status before interrupt request is acknowledged
Address
Stack status after interrupt request is acknowledged
m-6
m-5
m
–
4
m
–
3
m
–
2
m
–
1
m
m+1
LSB
MSB
LSB
MSB
Address
Stack area
Stack area
Flag register
(FLG
L
)
Flag register
(FLG
H
)
Program counter
(PC
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-6
m-5
m
–
4
m
–
3
m
–
2
m
–
1
m
m+1
0 0