249
Chapter 5 Interrupt
5.1.2 Software Interrupts
Software interrupts are generated by some instruction that generates an interrupt request when ex-
ecuted. Software interrupts are nonmaskable interrupts.
(1) Undefined-instruction interrupt
This interrupt occurs when the UND instruction is executed.
(2) Overflow interrupt
This interrupt occurs if the INTO instruction is executed when the O flag is 1.
The following lists the instructions that cause the O flag to change:
ABS, ADC, ADCF, ADD, CMP, DIV, DIVU, DIVX, NEG, RMPA, SBB, SHA, SUB
(3) BRK interrupt
This interrupt occurs when the BRK instruction is executed.
(4) INT instruction interrupt
This interrupt occurs when the INT instruction is executed after specifying a software interrupt number
from 0 to 63. Note that software interrupt numbers 0 to 31 are assigned to peripheral I/O interrupts. This
means that by executing the INT instruction, you can execute the same interrupt routine as used in
peripheral I/O interrupts.
The stack pointer used in INT instruction interrupt varies depending on the software interrupt number.
For software interrupt numbers 0 to 31, the U flag is saved when an interrupt occurs and the U flag is
cleared to 0 to choose the interrupt stack pointer (ISP) before executing the interrupt sequence. The
previous U flag before the interrupt occurred is restored when control returns from the interrupt routine.
For software interrupt numbers 32 to 63, such stack pointer switchover does not occur.
5.1 Outline of Interrupt
Commentaires sur ces manuels