English
Language : 

SAB80515 Datasheet, PDF (193/270 Pages) Siemens Semiconductor Group – 8-Bit Single-Chip Microcontroller Family
Instruction Set
RETI
Function:
Description:
Example:
Operation:
Return from interrupt
RETI pops the high and low-order bytes of the PC successively from the stack, and
restores the interrupt logic to accept additional interrupts at the same priority level
as the one just processed. The stack pointer is left decremented by two. No other
registers are affected; the PSW is not automatically restored to its pre-interrupt
status. Program execution continues at the resulting address, which is generally the
instruction immediately after the point at which the interrupt request was detected.
If a lower or same-level interrupt is pending when the RETI instruction is executed,
that one instruction will be executed before the pending interrupt is processed.
The stack pointer originally contains the value 0BH. An interrupt was detected
during the instruction ending at location 0122H. Internal RAM locations 0AH and
0BH contain the values 23H and 01H, respectively. The instruction
RETI
will leave the stack pointer equal to 09H and return program execution to location
0123H.
RETI
(PC15-8) ← ((SP))
(SP) ← (SP) – 1
(PC7-0) ← ((SP))
(SP) ← (SP) – 1
Encoding:
Bytes:
Cycles:
0011 0010
1
2
Semiconductor Group
193