Section 4 Exception Handling
Rev. 3.00 Mar. 14, 2006 Page 83 of 804
REJ09B0104-0300
4.7
Instruction Exception Handling
There are two types of instructions that cause exception handling: trap instruction and illegal
instructions.
4.7.1 Trap
Instruction
Trap instruction exception handling starts when a TRAPA instruction is executed. Trap instruction
exception handling can be executed at all times in the program execution state. The trap
instruction exception handling is as follows:
1. The contents of PC, CCR, and EXR are saved in the stack.
2. The interrupt mask bit is updated and the T bit is cleared to 0.
3. An exception handling vector table address corresponding to the vector number specified in
the TRAPA instruction is generated, the start address of the exception service routine is loaded
from the vector table to PC, and program execution starts from that address.
A start address is read from the vector table corresponding to a vector number from 0 to 3, as
specified in the instruction code.
Table 4.8 shows the state of CCR and EXR after execution of trap instruction exception handling.
Table 4.8
Status of CCR and EXR after Trap Instruction Exception Handling
CCR EXR
Interrupt Control Mode
I
UI
T
I2 to I0
0 1
2 1
0
[Legend]
1:
Set to 1
0:
Cleared to 0
:
Retains the previous value.
electronic components distributor