English
Language : 

SH-2A Datasheet, PDF (346/501 Pages) Renesas Technology Corp – Renesas 32-Bit RISC Microcomputer SuperH™ RISC engine Family
Section 7 Register Banks
7.5 Register Bank Exceptions
There are two types of register bank exception (register bank error): register bank overflow and
register bank underflow.
7.5.1 Register Bank Error Sources
(1) Register Bank Overflow
This exception occurs if, after data has been saved to all of the register banks, an interrupt for
which register bank use is allowed is received by the CPU, and the register bank overflow
exception is not masked by the interrupt controller. In this case the bank number (BN) bits in the
bank number register (IBNR) remain set to the maximum value, N, and no data is saved to the
register bank.
(2) Register Bank Underflow
This exception occurs if the RESBANK instruction is executed when no data has been saved to
the register banks. In this case the values of R0 to R14, GBR, MACH, MACL, and PR do not
change. In addition, the bank number (BN) bits in the bank number register (IBNR) remain set to
0.
7.5.2 Register Bank Error Exception Processing
If a register bank error is generated, register bank error exception processing begins. When this
happens the CPU performs the following operations.
1. The contents of the status register (SR) are saved to the stack.
2. The value of the program counter (PC) is saved to the stack. The PC value that is saved when a
register bank overflow occurs is the starting address of the next instruction after the last
executed instruction. The PC value that is saved when a register bank underflow occurs is the
starting address of the relevant RESBANK instruction.
To prevent multiple interrupts from occurring when a bank overflow occurs, the level of the
interrupt that caused the overflow is written to the interrupt mask bits (I3 to I0) of the status
register (SR).
3. The exception service routine start address is extracted from the exception processing vector
table corresponding to the register bank error, and the program is run beginning from that
address.
Rev. 3.00 Jul 08, 2005 page 332 of 484
REJ09B0051-0300