User's Manual

Table Of Contents
R01UH0823EJ0110 Rev.1.10 Page 268 of 1852
Nov 30, 2020
RX23W Group 14. Exception Handling
14.2 Exception Handling Procedure
In the exception handling, part of the processing is handled automatically by hardware and part of it is handled by a
program (exception handling routine) that has been written by the user. Figure 14.2 shows the processing procedure
when an exception other than a reset is accepted.
Figure 14.2 Outline of Exception Handling Procedure
UND: Undefined instruction exception
PIE: Privileged instruction exception
ACE: Access exception
FPE: Floating-point exception
EI: Interrupt
TRAP: Unconditional trap
(For the fast interrupt)
PC BPC
PSW BPSW
U = 0
I = 0
PM = 0
(For exceptions other than the fast interrupt)
PC Saved on the stack (ISP)
PSW Saved on the stack (ISP)
U = 0
I = 0
PM = 0
(For the fast interrupt)
BPC PC
BPSW PSW
Clear the LI flag
(For exceptions other than the fast interrupt)
Stack PC
Stack PSW
Clear the LI flag
Shifts to the user mode when the
PM bit in PSW is 1.
Shifts to the supervisor mode.
Hardware pre-processing
The program is suspended and
the exception is accepted.
Instruction
A
Instruction
B
Instruction
C
Instruction
D
Instruction
C
Restarting of program execution
User-written processing program
Branch to the vector
read handling
routine
Generation of
exception event
General-purpose
registers saved on
the stack
Handling routine
Restoration of
general-purpose
registers
(For the fast interrupt)
RTFI instruction
(For exceptions other than the fast interrupt)
RTE instruction
Non-maskable
interrupt processing
Program completion or system reset
Exception handling
routine other than
the non-maskable
interrupt
Non-maskable
interrupt
Hardware post-processing
Instruction canceling type
(UND, PIE, ACE and FPE)
Instruction suspending type
(Reception of an EI during execution of the RMPA instruction or a
string manipulation instruction)
Instruction completion type
(EI and TRAP)
Exception request