
2.1 CPU
48
Chapter 2: Hardware Configuration
Software Interrupts
(1) Overview
In a software interrupt, the CPU reacts to the execution of a dedicated instruction, and transfers control
from the execution of the program that it has been executing to an interrupt processing program defined
by the user. Software interrupts are always initiated by execution of a software interrupt instruction.
When a software interrupt is generated, the CPU performs interrupt processing as follows.
The contents of the A, DPR, ADB, DTB, PCB, PC and PS registers in the CPU are saved to the sys-
tem stack.
The I flag in the PS register is set to '0' to disable hardware interrupts.
The CPU branches to the corresponding interrupt vector.
A software interrupt, or interrupt request by execution of INT instruction in this case, is not provided
with an interrupt request flag or enable flag; execution of INT instruction always generates interrupt
request.
INT instruction has no interrupt levels; INT instruction, therefore, does not update ILM and the inter-
rupt request that followed is held in retention mode with the I flag set to "0."
(2) Configuration
All functions related to software interrupts are contained within the CPU. To use a software interrupt, it
is necessary to execute the corresponding instruction.
A shown in Table 2.1.12, interrupt vectors for both hardware interrupts and software interrupts share
the same space. For example, interrupt request number INT11 can be used for hardware interrupt #0,
and can also be used for software interrupt INT #11. Thus the same interrupt processing subroutine will
be called by both hardware interrupt #0 and software interrupt INT #11.
(3) Operation
When the CPU fetches and executes a software interrupt command, it activates the software interrupt
processing microcoding routine. In software interrupt processing microcoding, the 12 bytes of data con-
tained in memory in the A, DPR, ADB, DTB, PCB, PC and PS registers are saved to the area of mem-
ory designated by the SSB and SSP registers, then the contents of the 3-byte interrupt vector is read and
loaded into the PC and PCB register, the I flag is set to '0' and the S flag is set to '1,' and CPU processing
branches to the interrupt routine.
Figure 2.1.30 shows the flow of interrupt processing from the generation of the software interrupt, until
no more interrupt requests remain in the interrupt request program.