Section 5 Exception Handling
Rev. 3.00 Sep. 27, 2007 Page 81 of 758
REJ09B0243-0300
5.5
Exceptions Triggered by Instructions
5.5.1
Types of Exceptions Triggered by Instructions
Exception handling can be triggered by the trap instruction, illegal slot instructions, and general
illegal instructions, as shown in table 5.9.
Table 5.9
Types of Exceptions Triggered by Instructions
Type Source
Instruction Comment
Trap instruction
TRAPA
Illegal slot
instructions
*
Undefined code placed
immediately after a delayed
branch instruction (delay slot) or
instructions that changes the PC
value
Delayed branch instructions: JMP, JSR,
BRA, BSR, RTS, RTE, BF/S, BT/S, BSRF,
BRAF
Instructions that changes the PC value: JMP,
JSR, BRA, BSR, RTS, RTE, BT, BF, TRAPA,
BF/S, BT/S, BSRF, BRAF, LDC Rm,SR,
LDC.L @Rm+,SR
General illegal
instructions
*
Undefined code anywhere
besides in a delay slot
Note:
*
The operation is not guaranteed when undefined instructions other than H'F000 to
H'FFFF are decoded.
5.5.2 Trap
Instructions
When a TRAPA instruction is executed, the trap instruction exception handling starts. The CPU
operates as follows:
1. The status register (SR) is saved to the stack.
2. The program counter (PC) is saved to the stack. The PC value saved is the start address of the
instruction to be executed after the TRAPA instruction.
3. The CPU reads the start address of the exception handling routine from the exception handling
vector table that corresponds to the vector number specified in the TRAPA instruction,
program execution branches to that address, and then the program starts. This branch is not a
delayed branch.
Содержание SH7124 R5F7124
Страница 2: ...Rev 3 00 Sep 27 2007 Page ii of xx ...
Страница 8: ...Rev 3 00 Sep 27 2007 Page viii of xx ...
Страница 36: ...Section 1 Overview Rev 3 00 Sep 27 2007 Page 16 of 758 REJ09B0243 0300 ...
Страница 68: ...Section 2 CPU Rev 3 00 Sep 27 2007 Page 48 of 758 REJ09B0243 0300 ...
Страница 108: ...Section 5 Exception Handling Rev 3 00 Sep 27 2007 Page 88 of 758 REJ09B0243 0300 ...
Страница 166: ...Section 7 User Break Controller UBC Rev 3 00 Sep 27 2007 Page 146 of 758 REJ09B0243 0300 ...
Страница 400: ...Section 9 Multi Function Timer Pulse Unit 2 MTU2 Rev 3 00 Sep 27 2007 Page 380 of 758 REJ09B0243 0300 ...
Страница 724: ...Section 20 List of Registers Rev 3 00 Sep 27 2007 Page 704 of 758 REJ09B0243 0300 ...
Страница 772: ...Rev 3 00 Sep 27 2007 Page 752 of 758 REJ09B0243 0300 ...
Страница 778: ...Rev 3 00 Sep 27 2007 Page 758 of 758 REJ09B0243 0300 ...
Страница 781: ......
Страница 782: ...SH7125 Group SH7124 Group Hardware Manual ...