RX610 Group
9. Exceptions
R01UH0032EJ0120 Rev.1.20
Page 205 of 1006
Feb 20, 2013
9.2
Exception Handling Procedure
For exception handling, part of the processing is handled automatically by hardware and part is handled by a program
(the exception handling routine) that has been written by the user. Figure 9.2 shows the handling procedure when an
exception other than a reset is accepted.
[Legend]
UND: Undefined instruction exception
PIE:
Privileged instruction exception
FPE:
Floating-point exceptions
NMI:
Non-maskable interrupt
EI:
Interrupts
TRAP: Unconditional trap
• • •
(For the fast interrupt)
PC BPC
PSW BPSW
U = 0
I = 0
PM = 0
(For excep ions o her 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
(For excep ions o her than the fast interrupt)
Stack PC
Stack PSW
Transition to the user mode
when the PM bit in the PSW
is 1.
Switch 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 the program
Processing of user-written program code
Read the vector.
Branch to the
start of the
handling routine.
Generation of an
exception
General-purpose
registers
preserved 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
End of the program or resetting of the system
Exception
handling
routine
other than the
non-maskable
interrupt
Hardware post-processing
•
Instruction canceling type
(UND, PIE, 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)
Non-maskable
interrupt
Exception request
Figure 9.2 Outline of the Exception Handling Procedure