English
Language : 

UPD78320 Datasheet, PDF (45/88 Pages) NEC – 16/8-BIT SINGLE-CHIP MICROCONTROLLER
µPD78320, 78322
4.3 CONTEXT SWITCHING FUNCTION
This is the function to first select the specified register bank in hardware terms by generating an interrupt request or
executing BRKCS instruction, to branch the selected register bank to the vector address prestored in the register bank, and
also to stack the current PC and PSW contents into the register bank.
4.3.1 Context Switching Function by Interrupt Request
The context switching function start is enabled by setting the × ×CSE bit preset at each interrupt request to 1.
If an unmasked interrupt request for which the context switching function has been enabled is generated in the EI state,
the register bank which is specified by the lower 3 bits of the low address (even address) of the corresponding interrupt
vector table address is selected. The vector address prestored in the selected register bank is transferred to the PC, the
PC and PSW contents are saved into the register bank, and the operation is branched to the interrupt service routine.
Return is by means of executing the RETCS instruction.
Figure 4-3. Context Switching by Interrupt Request Generation
RBANK n
A
X
PC
B
C
Exchange
Save
PSW
R5
R4
R7
R6
VP
UP
D
E
H
L
Register
Banks
(0 – 7)
45