Section 4 Exception Processing
Rev. 5.00 May 29, 2006 page 81 of 698
REJ09B0146-0500
Section 4 Exception Processing
4.1
Exception Processing Function
Exception processing is separate from normal program processing, and is performed by a routine
separate from the normal program. In response to an exception processing request due to abnormal
termination of the executing instruction, control is passed to a user-written exception handler.
However, in response to an interrupt request, normal program execution continues until the end of
the executing instruction. Here, all exceptions other than resets and interrupts will be called
general exceptions. There are thus three types of exceptions: resets, general exceptions, and
interrupts.
4.1.1
Exception Processing Flow
In exception processing, the contents of the program counter (PC) and status register (SR) are
saved in the saved program counter (SPC) and saved status register (SSR), respectively, and
execution of the exception handler is invoked from a vector address. The return from exception
handler (RTE) instruction is issued by the exception handler routine at the completion of the
routine, restoring the contents of the PC and SR to return to the processor state at the point of
interruption and the address where the exception occurred.
A basic exception processing sequence consists of the following operations:
1. The contents of the PC and SR are saved in the SPC and SSR, respectively.
2. The block (BL) bit in SR is set to 1, masking any subsequent exceptions.
3. The mode (MD) bit in SR is set to 1 to place the SH7706 in the privileged mode.
4. The register bank (RB) bit in SR is set to 1.
5. An exception code identifying the exception event is written to bits 11 to 0 of the exception
event (EXPEVT) or interrupt event (INTEVT and INTEVT2) register.
6. Instruction execution jumps to the designated exception processing vector address to invoke
the handler routine.
Содержание SH7706 Series
Страница 8: ...Rev 5 00 May 29 2006 page viii of xlviii ...
Страница 160: ...Section 5 Cache Rev 5 00 May 29 2006 page 112 of 698 REJ09B0146 0500 ...
Страница 370: ...Section 11 Watchdog Timer WDT Rev 5 00 May 29 2006 page 322 of 698 REJ09B0146 0500 ...
Страница 532: ...Section 16 Serial Communication Interface with FIFO SCIF Rev 5 00 May 29 2006 page 484 of 698 REJ09B0146 0500 ...
Страница 554: ...Section 17 Pin Function Controller PFC Rev 5 00 May 29 2006 page 506 of 698 REJ09B0146 0500 ...
Страница 576: ...Section 18 I O Ports Rev 5 00 May 29 2006 page 528 of 698 REJ09B0146 0500 ...
Страница 614: ...Section 21 User Debugging Interface H UDI Rev 5 00 May 29 2006 page 566 of 698 REJ09B0146 0500 ...
Страница 746: ...Index Rev 5 00 May 29 2006 page 698 of 698 REJ09B0146 0500 ...
Страница 749: ...SH7706 Group Hardware Manual ...