493
CHAPTER 21 INTERRUPT AND TEST FUNCTIONS
21.4.3 Software interrupt request acknowledge operation
A software interrupt request is acknowledged by BRK instruction execution. Software interrupt cannot be disabled.
If a software interrupt request is acknowledged, the contents of acknowledged interrupts are saved in the stacks,
program status word (PSW) and program counter (PC), in that order, the IE flag is reset to 0 and the contents of the
vector tables (003EH and 003FH) are loaded into PC and branched.
Return from the software interrupt is possible with the RETB instruction.
Caution
Do not use the RETI instruction for returning from the software interrupt.
21.4.4 Multiple interrupt servicing
Acknowledging another interrupt request while one interrupt is processed is called multiple interrupts.
A multiple interrupt is not generated unless the interrupt request is enabled (IE = 1) (except the non-maskable
interrupt). When an interrupt request is acknowledged, the other interrupts are disabled (IE = 0). To enable a multiple
interrupt, therefore, the IE flag must be set to 1 by executing the EI instruction during interrupt servicing and the
interrupt must be enabled. Even if the interrupt request is enabled, some multiple instructions are not acknowledged.
However, the multiple instructions are controlled by the programmable priority.
An interrupt has two types of priorities: default priority and programmable priority. The multiple interrupt is
controlled by the programmable priority.
In the EI status, if an interrupt request having the same as or higher priority than that of the interrupt currently
serviced is generated, the interrupt is acknowledged as multiple interrupt. If an interrupt request with a priority lower
than that of the interrupt currently serviced is generated, the interrupt is not acknowledged as multiple interrupt.
If an interrupt is disabled, or if a multiple interrupt is not acknowledged because it has a low priority, the interrupt
is kept pending. After the servicing of the current interrupt has been completed, and after one instruction of the main
processing has been executed, the pending interrupt is acknowledged.
Multiple interrupts are not acknowledged while the non-maskable interrupt is serviced.
Table 21-4 shows interrupt requests enabled for multiple interrupts. Figure 21-16 shows multiple interrupt
examples.
Table 21-4. Interrupt Request Enabled for Multiple Interrupt During Interrupt Servicing
Non-maskable
Interrupt
Request
Maskable Interrupt Request
PR = 0
PR = 1
IE = 1
IE = 0
IE = 1
IE = 0
Non-maskable interrupt
D
D
D
D
D
Maskable interrupt
ISP = 0
E
E
D
D
D
ISP = 1
E
E
D
E
D
Software interrupt
E
E
D
E
D
Remarks 1.
E
: Multiple interrupt enable
2.
D : Multiple interrupt disable
3.
ISP and IE are the flags contained in PSW
ISP = 0 : An interrupt with higher priority is being serviced
ISP = 1 : An interrupt request is not accepted or an interrupt with lower priority
is being serviced
IE = 0
: Interrupt request acknowledge is disabled
IE = 1
: Interrupt request acknowledge is enabled
4.
PR is a flag contained in PR0L, PR0H, and PR1L
PR = 0 : Higher priority level
PR = 1 : Lower priority level
Servicing
Interrupt
Multiple Interrupt
Request