![](http://datasheet.mmic.net.cn/30000/M30956FKTGP_datasheet_2359453/M30956FKTGP_113.png)
10. Interrupts
10.2
Software Interrupts
Software interrupts occur when an instruction is executed. Software interrupts are non-maskable.
10.2.1
Undefined Instruction Interrupt
The undefined instruction interrupt occurs when the UND instruction is executed.
10.2.2
Overflow Interrupt
The overflow interrupt occurs when the INTO instruction is executed while the O flag in the FLG register is set
to 1 (arithmetic operation overflow). Instructions that set the O flag are: ABS, ADC, ADCF, ADD, ADDX,
CMP, CMPX, DIV, DIVU, DIVX, NEG, RMPA, SBB, SCMPU, SHA, SUB, SUBX
10.2.3
BRK Interrupt
The BRK interrupt occurs when the BRK instruction is executed.
10.2.4
BRK2 Interrupt
The BRK2 interrupt occurs when the BRK2 instruction is executed.
Do not use this interrupt. This is for use with development support tool only.
10.2.5
INT Instruction Interrupt
The INT instruction interrupt occurs when the INT instruction is executed. The INT instruction can specify a
software interrupt number from 0 to 63. Software interrupt number 8 to 54 and 57 are assigned to the vector
table used for the peripheral function interrupt. This means that the MCU is able to execute the peripheral
function interrupt routine by executing the INT instruction. When the INT instruction is executed, the FLG
register and PC are saved to the stack. PC stores the relocatable vector of specified software interrupt numbers.
Where the stack is saved varies depending on a software interrupt number.
ISP is selected for software interrupt number 0 to 31 (the U flag is set to 0). SP, which is set before the INT
instruction is executed, is selected for software interrupt number 32 to 63 (the U flag is not changed).
For the peripheral function interrupt, the FLG register is saved and the U flag is set to 0 (ISP selected) when an
interrupt request is acknowledged. For software interrupt number 32 to 54 and 57, SP to be used varies
depending on whether an interrupt is generated by a peripheral function or by the INT instruction.