Section 5 Exception Handling
Rev. 3.00 Sep. 27, 2007 Page 72 of 758
REJ09B0243-0300
5.1.2
Exception Handling Operations
The exceptions are detected and the exception handling starts according to the timing shown in
table 5.2.
Table 5.2
Timing for Exception Detection and Start of Exception Handling
Exception
Timing of Source Detection and Start of Exception Handling
Reset
Power-on reset Started when the
RES
pin changes from low to high or when the
WDT overflows.
Manual reset
Started when the
MRES
pin changes from low to high or when the
WDT overflows.
Address error
Interrupt
Detected during the instruction decode
stage and started after the
execution of the current instruction is completed.
Instruction
Trap instruction Started by the execution of the TRAPA instruction.
General
illegal
instructions
Started when an undefined code placed at other than a delay slot
(immediately after a delayed branch instruction) is decoded.
Illegal
slot
instructions
Started when an undefined code placed at a delay slot
(immediately after a delayed branch instruction) or an instruction
that changes the PC value is detected.
When exception handling starts, the CPU operates
Exception Handling Triggered by Reset:
The initial values of the program counter (PC) and
stack pointer (SP) are fetched from the exception handling vector table (PC from the address
H'00000000 and SP
from the address H'00000004 when a power-on reset. PC from the address
H'00000008 and SP from the address H'0000000C when a manual reset.). For details, see section
5.1.3, Exception Handling Vector Table. H'00000000 is then written to the vector base register
(VBR), and H'F (B'1111) is written to the interrupt mask bits (I3 to I0) in the status register (SR).
The program starts from the PC address fetched from the exception handling vector table.
Exception Handling Triggered by Address Error, Interrupt, and Instruction:
SR and PC are
saved to the stack indicated by R15. For interrupt exception handling, the interrupt priority level is
written to the interrupt mask bits (I3 to I0) in SR. For address error and instruction exception
handling, bits I3 to I0 are not affected. The start address is then fetched from the exception
handling vector table and the program starts from that address.
Summary of Contents for SH7124 R5F7124
Page 2: ...Rev 3 00 Sep 27 2007 Page ii of xx ...
Page 8: ...Rev 3 00 Sep 27 2007 Page viii of xx ...
Page 36: ...Section 1 Overview Rev 3 00 Sep 27 2007 Page 16 of 758 REJ09B0243 0300 ...
Page 68: ...Section 2 CPU Rev 3 00 Sep 27 2007 Page 48 of 758 REJ09B0243 0300 ...
Page 108: ...Section 5 Exception Handling Rev 3 00 Sep 27 2007 Page 88 of 758 REJ09B0243 0300 ...
Page 166: ...Section 7 User Break Controller UBC Rev 3 00 Sep 27 2007 Page 146 of 758 REJ09B0243 0300 ...
Page 724: ...Section 20 List of Registers Rev 3 00 Sep 27 2007 Page 704 of 758 REJ09B0243 0300 ...
Page 772: ...Rev 3 00 Sep 27 2007 Page 752 of 758 REJ09B0243 0300 ...
Page 778: ...Rev 3 00 Sep 27 2007 Page 758 of 758 REJ09B0243 0300 ...
Page 781: ......