NEC mPD784225 Series User Manual page 378

16-/8-bit single-chip microcontrollers
Table of Contents

Advertisement

22.4 Software Interrupt Acknowledgment Operations
A software interrupt is acknowledged in response to execution of a BRK or BRKCS instruction. Software interrupts
cannot be disabled.
22.4.1 BRK instruction software interrupt acknowledgment operation
When a BRK instruction is executed, the program status word (PSW) and program counter (PC) are saved in that
order to the stack, the IE flag is cleared (0), the vector table (003EH/003FH) contents are loaded into the lower 16
bits of the PC, and 0000B into the higher 4 bits, and a branch is performed (the start of the service program must be
in the base area).
The RETB instruction must be used to return from a BRK instruction software interrupt.
Caution The RETI instruction must not be used to return from a BRK instruction software interrupt.
22.4.2 BRKCS instruction software interrupt (software context switching) acknowledgment operation
The context switching function can be initiated by executing a BRKCS instruction.
The register bank to be used after context switching is specified by the BRKCS instruction operand.
When a BRKCS instruction is executed, the program branches to the start address of the interrupt service program
(which must be in the base area) stored beforehand in the specified register bank, and the contents of the program
status word (PSW) and program counter (PC) are saved in the register bank.
Figure 22-8. Context Switching Operation by Execution of a BRKCS Instruction
0000B
7 Transfer
PC
PC
19-16
6 Exchange
2 Save
(Bits 8 to 11 of
temporary register)
Temporary register
1 Save
PSW
The RETCSB instruction is used to return from a software interrupt due to a BRKCS instruction. The RETCSB
instruction must specify the start address of the interrupt service program for the next time context switching is
performed by a BRKCS instruction. This interrupt service program start address must be in the base area.
Caution The RETCS instruction must not be used to return from a BRKCS instruction software interrupt.
378
CHAPTER 22 INTERRUPT FUNCTIONS
Register bank n (n = 0 to 7)
15-0
5 Save
V
U
T
W
User's Manual U12697EJ3V0UM
A
X
B
C
R5
R4
R7
R6
VP
3 Register bank switching
UP
(RBS0-RBS2 ← n)
RSS ← 0
(
4
D
E
← 0
IE
H
L
Register bank
(0 to 7)
)

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mpd784225y seriesMpd784224Mpd784225Mpd78f4225Mpd784224yMpd784225y ... Show all

Table of Contents