![Siemens C500 User Manual Download Page 92](http://html.mh-extra.com/html/siemens/c500/c500_user-manual_382114092.webp)
Instruction Set
C500 Family
Semiconductor Group
4-66
1998-04-01
RETI
Function:
Return from interrupt
Description:
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.
Example:
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.
Operation:
RETI
(PC15-8)
¬
((SP))
(SP)
¬
(SP) Ð 1
(PC7-0)
¬
((SP))
(SP)
¬
(SP) Ð 1
Bytes:
1
Cycles:
2
Encoding:
0 0 1 1
0 0 1 0