English
Language : 

UPD78361A Datasheet, PDF (48/88 Pages) NEC – 16/8-BIT SINGLE-CHIP MICROCONTROLLER
µPD78361A, 78362A
4.3.2 Context Switching Function by BRKCS Instruction
The context switching function can be started by the BRKCS instruction.
The operation of context switching by an interrupt request is as follows:
(1) An 8-bit register is specified by the operand of the BRKCS instruction, and the register bank to which
the context is to be switched is specified by the contents of this register (only the lower 3 bits of 8 bits are
valid).
(2) The vector address predetermined in the register bank to which the context is to be switched is transferred
to the PC, and at the same time, the contents of the PC and PSW immediately before the switching takes
place are saved to the register bank.
(3) Execution branches to the contents of the PC newly set.
4.3.3 Restoration from Context Switching
To restore from the switched context, one of the following two instructions are used. Which instruction is
to be executed is determined by the source that has started the context switching.
Table 4-2. Instructions to Restore from Context Switching
Restore instruction
RETCS
RETCSB
Context switching starting source
Occurrence of interrupt
Execution of BRKCS instruction
48