CHAPTER 10 INTERRUPT FUNCTIONS
User’s Manual U18172EJ2V0UD
173
Figure 10-6 shows the algorithm of interrupt request acknowledgment.
When a maskable interrupt request is acknowledged, the contents of the PSW and PC are saved to the stack in
that order, the IE flag is reset to 0, and the data in the vector table determined for each interrupt request is loaded to
the PC, and execution branches.
To return from interrupt servicing, use the RETI instruction.
Figure 10-6. Interrupt Request Acknowledgment Processing Algorithm
Start
××
IF = 1?
××
MK = 0?
IE = 1?
Vectored interrupt
servicing
Yes (Interrupt request generated)
Yes
Yes
No
No
No
Interrupt request pending
Interrupt request pending
××
IF:
Interrupt request flag
××
MK: Interrupt mask flag
IE:
Flag to control maskable interrupt request acknowledgment (1 = enable, 0 = disable)
Figure 10-7. Interrupt Request Acknowledgment Timing (Example of MOV A, r)
Clock
CPU
Interrupt
MOV A, r
Saving PSW and PC, jump
to interrupt servicing
8 clocks
Interrupt servicing program
If an interrupt request flag (
××
IF) is set before an instruction clock n (n = 4 to 10) under execution becomes n
−
1,
the interrupt is acknowledged after the instruction under execution is complete. Figure 10-7 shows an example of the
interrupt request acknowledgment timing for an 8-bit data transfer instruction MOV A, r. Since this instruction is
executed for 4 clocks, if an interrupt occurs for 3 clocks after the instruction fetch starts, the interrupt acknowledgment
processing is performed after the MOV A, r instruction is executed.