Rev. 5.00, 09/03, page 85 of 760
Section 4 Exception Handling
4.1 Overview
4.1.1 Features
Exception handling is separate from normal program processing, and is performed by a routine
separate from the normal program. In response to an exception handling request due to abnormal
terminat i on of the executing ins t ruct i on , cont rol i s passed to a user -writte n exceptio n ha nd ler.
However, in response to an interrupt request, normal program execution continues until the end of
the executing instruction. Here, all exceptions other than rese ts and interrupt s will be called
general exceptions. There are thus three types of exceptions: resets, general excepti ons, and
interrupts.
4.1.2 Register Configuration
Table 4.1 lists the registers used for exception handling. A register with an undefined initial value
should be initialized by software.
Table 4.1 Register Configuration
Register Abbr. R/W Size Initial Value Address
TRAPA exception register TRA R/W Longword Undefined H'FFFFFFD0
Exception event register EXPEVT R/W Longword Power-on reset: H'000
Manual reset: H'020*1H'FFFFFFD4
Interrupt event register INTEVT R/W Longword Undefined H'FFFFFFD8
Interrupt event register2 INTEVT2 R Longword Undefined H'04000000
(H'A4000000)*2
Notes: 1. H'000 is set in a pow er-on reset, and H'020 in a manua l reset.
2. When address tran slation by the MM U does not apply , the address in parentheses
should be used.
4.2 Exception Handling Function
4.2.1 Exception Handling Flow
In exception handling, 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 is sued by the exception handler routine on compl etion of the routine, re storing the