The stack pointer for interrupts (SPI) is used in interrupt handling, whereas the stack pointer for the user (SPU) is used in all other processing.
The SPI and SPU hold the current stack pointer addresses. These registers can be accessed as general-purpose register R15. Whether this general-purpose register is used as SPI or as SPU is determined by the stack mode bit (SM) in the Processor Status Word register (PSW).
- When SM bit = 0, the register is used as the stack pointer for interrupts (SPI).
- When SM bit = 1, the register is used as the stack pointer for the user (SPU).
Table 1 shows types of EIT events and changes of the state of the SM bit caused by hardware preprocessing when each relevant EIT is accepted.
Table1. Types of EIT Events and Changes of the SM Bit Made Upon EIT Acceptance
|EIT Event||SM Bit|
|Reset interrupt (RI)||0|
|System break interrupt (SBI)||0|
|Reserved instruction exception (RIE)||Unchanged|
|Address exception (AE)||Unchanged|
|External interrupt (EI)||0|
For details about EIT events, please refer to the relevant chapter in the user's manual of your microcomputer in which EITs are described.