CHAPTER 14 INTERRUPT FUNCTIONS
154
14.3.2 Return from the Interrupt Routine
Execute the RETI instruction to return from the interrupt handling routine. During the RETI instruction cycle,
processing in the figure below occurs.
Figure 14-3. Return from Interrupt Handling
Execute RETI instruction
Load contents of stack pointed to by stack
pointer into program counter
Load contents of interrupt-dedicated stack
register into PSWORD
Increment stack pointer value by one
Cautions 1.
The INTE flag is not set for the RETI instruction.
Interrupt handling is completed. To handle a pending interrupt successively, execute the EI
instruction immediately before the RETI instruction and set the INTE flag to 1.
2.
To execute the RETI instruction following the EI instruction, no interrupt is accepted between
EI instruction execution and RETI instruction execution. This is because the EI instruction
sets the INTE flag to 1 after the execution of the subsequent instruction is completed.
Example
EI instruction execution
Timer 0 interrupt generation
Timer 1 interrupt generation
(held)
Timer 0 interrupt generation
(held)
RETI
Timer 1 interrupt handling
EI
RETI
Timer 0 interrupt handling
Single interrupt
Summary of Contents for mPD17120 Subseries
Page 15: ... x MEMO ...
Page 23: ... MEMO 8 ...
Page 45: ... MEMO 30 ...
Page 49: ... MEMO 34 ...
Page 55: ... MEMO 40 ...
Page 93: ... MEMO 78 ...
Page 99: ... MEMO 84 ...
Page 102: ...CHAPTER 11 ARITHMETIC AND LOGIC UNIT 87 MEMO ...
Page 119: ... MEMO 104 ...
Page 175: ... MEMO 160 ...
Page 199: ... MEMO 184 ...
Page 265: ... MEMO 250 ...
Page 281: ...266 MEMO ...
Page 285: ... MEMO 270 ...
Page 289: ... MEMO 274 ...