
398
CHAPTER 16 INTERRUPT FUNCTIONS
16.7.1 Vectored interrupt
When a vectored interrupt maskable interrupt request is acknowledged, the program status word (PSW) and program
counter (PC) are saved in that order to the stack, the IE flag is cleared (0) (the interrupt disabled state is set), and the in-
service priority register (ISPR) bit corresponding to the priority of the acknowledged interrupt is set (1). Also, data in the
vector table predetermined for each interrupt request is loaded into the PC, and a branch is performed. The return from
a vectored interrupt is performed by means of the RETI instruction.
Caution When a maskable interrupt is acknowledged by vectored interrupt, the RETI instruction must be used
to return from the interrupt. Subsequent interrupt acknowledgment will not be performed normally if
a different instruction is used.
16.7.2 Context switching
Initiation of the context switching function is enabled by setting (1) the context switching enable flag of the interrupt control
register.
When an interrupt request for which the context switching function is enabled is acknowledged, the register bank specified
by 3 bits of the lower address (even address) of the corresponding vector table address is selected.
The vector address stored beforehand in the selected register bank is transferred to the program counter (PC), and at
the same time the contents of the PC and program status word (PSW) up to that time are saved in the register bank and
a branch is made to the interrupt service program.
Figure 16-11. Context Switching Operation by Generation of an Interrupt Request
Register Bank
(0 to 7)
A
B
R5
R7
X
C
R4
R6
D
H
VP
UP
E
L
V
U
T
W
Register Bank n (n = 0 to 7)
7 Transfer
6 Exchange
4
2 Save
(Temporary
Register
Bit 8-11)
5 Save
1 Save
PC
15-0
PC
19-16
0000B
Temporary Register
PSW
n
3 Register Bank Switching
(RBS0-RBS2
←
n)
Vector Table
RSS
←
0
(
IE
←
0
)