6.89.1 Description
Returns from the interrupt. The return address is loaded from the STACK, and the Global Interrupt Enable bit is set.
Note: The Status Register is not automatically stored when entering an
interrupt routine and is not restored when returning from one. The application program must
handle this. The Stack Pointer uses a pre-increment scheme during RETI.
Note: For AVRxm and AVRxt devices, the interrupt controller status
(CPUINT.STATUS) register contains the interrupt state information that ensures return to
the correct interrupt level when the RETI instruction is executed at the end of the
interrupt handler. The flag corresponding to the processed interrupt is cleared when RETI
is executed.
Operation: | Comment: | |||
(i) |
PC(15:0) ← STACK |
Devices with a 16-bit program counter (PC) and a maximum of 128 KB of program memory. | ||
(ii) |
PC(21:0) ← STACK |
Devices with a 22-bit program counter (PC) and a maximum of 8 MB of program memory. | ||
Syntax: |
Operands: |
Program Counter: |
Stack: | |
(i) |
RETI |
None |
See Operation |
SP ← SP + 2 (2 bytes, 16 bits) |
(ii) |
RETI | None | See Operation |
SP ← SP + 3 (3 bytes, 22 bits) |
16-bit Opcode:
1001 | 0101 | 0001 | 1000 |