
139
6.5 Software Interrupts
6.5
Software Interrupts
When the software interrupt instruction is executed, control is transferred from the
main program to the interrupt processing program. Hardware interrupts are disabled
while the software interrupt instruction is being executed.
s Software Interrupt Activation
r Software interrupt activation
The INT instruction is used to activate a software interrupt. A software interrupt does not have
an interrupt request flag bit or enable flag like that of a hardware interrupt. Thus, an interrupt
request is output whenever the INT instruction is executed.
r Hardware interrupt suppression
Since the INT instruction does not have interrupt levels, the interrupt level mask register (ILM) is
not updated. During the execution of the INT instruction, the I flag of the condition code register
(CCR) is set to 0, and hardware interrupts are masked.
To enable hardware interrupts during software interrupt processing, set the I flag of the
condition code register (CCR) to "1" in the software interrupt processing routine.
r Software interrupt operation
When the CPU fetches the INT instruction, the software interrupt processing microcode is
activated.
This microcode saves the internal CPU registers on the system stack, masks
hardware interrupts (CCR: I = 0), and branches to the corresponding interrupt vector.
See Section
6.2 "Interrupt Causes and Interrupt Vectors", in CHAPTER
6 "INTERRUPTS" for
more information about the allocation of interrupt numbers and interrupt vectors.
s Returning from a Software Interrupt
In the interrupt processing program, when the interrupt return instruction (RETI instruction) is
executed, the data saved to the system stack is restored to the dedicated registers and the
processing that was being executed before branching for the interrupt is resumed.