English
Language : 

UPD78361A Datasheet, PDF (47/88 Pages) NEC – 16/8-BIT SINGLE-CHIP MICROCONTROLLER
µPD78361A, 78362A
4.3 CONTEXT SWITCHING
This function is to select a specific register bank through the hardware, and to branch execution to a vector
address predetermined in the register bank. At the same time, it saves the present contents of the PC and PSW
to the register bank when an interrupt occurs, or when the BRKCS instruction is executed.
4.3.1 Context Switching Function by Interrupt Request
When a context switching enable flag corresponding to each maskable interrupt request is set to 1 in the EI
(interrupt enable) status, the context switching function can be started.
The context switching operation by an interrupt request is performed as follows:
(1) When an interrupt request is generated, a register bank to which the context is to be switched is specified
by the contents of the lower 3 bits of the row address (even address) of the corresponding vector table.
(2) A predetermined vector address is transferred to the PC in the register bank to which the context is to
be switched, and the contents of the PC and PSW immediately before the switching takes place are saved
to the register bank.
(3) Execution branches to an address indicated by the contents of the PC newly set.
Figure 4-1. Operation of Context Switching
PC
Exchange
Save
PSW
Registor Bank
RP0
RP1
RP2
RP3
RP4
RP5
RP6
RP7
Registor Bank
(0-7)
47