English
Language : 

SH7706 Datasheet, PDF (129/749 Pages) Renesas Technology Corp – Renesas 32-Bit RISC Microcomputer SuperH™ RISC engine Family/SH7700 Series
Section 4 Exception Processing
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.
Rev. 5.00 May 29, 2006 page 81 of 698
REJ09B0146-0500