English
Language : 

SH7020 Datasheet, PDF (75/509 Pages) Renesas Technology Corp – SuperH™ RISC engine
4.4.3 Interrupt Exception Processing
When an interrupt is generated, the INTC ascertains the interrupt rankings. NMI is always
accepted, but other interrupts are only accepted if their ranking is higher than the ranking set in the
interrupt mask bits (I3–I0) of the SR.
When an interrupt is accepted, interrupt exception processing begins. In the interrupt exception
processing sequence, the SR and PC are pushed onto the stack, and the priority level of the
accepted interrupt is copied to the interrupt mask level bits (I3–I0) in the SR. In NMI exception
processing, the priority ranking is 16 but the value 15 (H'F) is stored in I3–I0. The exception
service routine start address for the accepted interrupt is fetched from the exception vector table
and the program branches to that address and starts executing. For further information on
interrupts, see section 5.4, Interrupt Operation.
4.5 Instruction Exceptions
4.5.1 Types of Instruction Exceptions
Table 4.8 shows the three types of instruction that start exception processing (trap instructions,
illegal slot instructions, and general illegal instructions).
Table 4.8 Types of Instruction Exceptions
Type
Trap instruction
Illegal slot
instruction
General illegal
instructions
Source Instruction
TRAPA
Undefined code or instruction
that rewrites the PC located
immediately after a delayed
branch instruction (delay slot)
Undefined code in other than
delayed slot
Comments
—
Delayed branch instructions are: JMP, JSR,
BRA, BSR, RTS, RTE. Instructions that
rewrite the PC are: JMP, JSR, BRA, BSR,
RTS, RTE, BT, BF and TRAPA
—
4.5.2 Trap Instruction
Trap instruction exception processing is carried out when a trap instruction (TRAPA) is executed.
The CPU then:
1. Saves the status register by pushing register contents onto the stack.
2. Pushes the program counter value onto the stack. The PC value saved is the top address of the
next instruction after the TRAPA instruction.
3. Reads an exception processing service routine start address from the vector table
corresponding to a vector number specified in the TRAPA instruction, branches to that
address, and starts program execution. The branch is not a delayed branch.
RENESAS 55