
R01UH0218EJ0110 Rev.1.10
Page 143 of 664
Sep 12, 2011
R32C/142 Group and R32C/145 Group
10. Interrupts
10.2
Software Interrupts
Software interrupts are non-maskable. A software interrupt is generated by executing an instruction.
There are five types of software interrupts shown below.
(1) Undefined Instruction Interrupt
This interrupt is generated when the UND instruction is executed.
(2) Overflow Interrupt
This interrupt is generated when the INTO instruction is executed while the O flag is 1. The following
instructions may change the O flag to 1, depending on the operation result:
ABS, ADC, ADCF, ADD, ADDF, ADSF, CMP, CMPF, CNVIF, DIV, DIVF, DIVU, DIVX, EDIV, EDIVU,
EDIVX, MUL, MULF, MULU, MULX, NEG, RMPA, ROUND, SBB, SCMPU, SHA, SUB, SUBF, SUNTIL,
and SWHILE
(3) BRK Instruction Interrupt
This interrupt is generated when the BRK instruction is executed.
(4) BRK2 Instruction Interrupt
This interrupt is generated when the BRK2 instruction is executed.
This interrupt is only meant for use as a development support tool and users are not allowed to use it.
(5) INT Instruction Interrupt
This interrupt is generated when the INT instruction is executed with a selected software interrupt
number from 0 to 255. Software interrupt numbers 0 to 127 are designated for peripheral interrupts.
That is, the INT instruction with a software interrupt number from 0 to 127 has the same interrupt
handler as that for peripheral interrupts.
The stack pointer (SP) used for this interrupt differs depending on the software interrupt numbers. For
software interrupt numbers 0 to 127, when an interrupt request is accepted, the U flag is saved and set
to 0 to select the interrupt stack pointer (ISP) during the interrupt sequence. The saved data of the U
flag is restored upon returning from the interrupt handler. For software interrupt numbers 128 to 255,
the stack pointer does not change during the interrupt sequence.