You copied the Doc URL to your clipboard.

13.93 RFE

Return From Exception.

Syntax

RFE{addr_mode}{cond} Rn{!}

where:

addr_mode

is any one of the following:

IA

Increment address After each transfer (Full Descendingstack)

IB

Increment address Before each transfer (A32 only)

DA

Decrement address After each transfer (A32 only)

DB

Decrement address Before each transfer.

If addr_mode is omitted, itdefaults to Increment After.

cond

is an optional condition code.

Note

cond is permitted only in T32 code, using a preceding IT instruction, but this is deprecated in ARMv8. This is an unconditional instruction in A32 code.
Rn

specifies the base register. Rn mustnot be PC.

!

is an optional suffix. If ! ispresent, the final address is written back into Rn.

Usage

You can use RFE to return froman exception if you previously saved the return state using the SRS instruction. Rn isusually the SP where the return state informationwas saved.

Operation

Loads the PC and the CPSR from the address contained in Rn,and the following address. Optionally updates Rn.

Notes

RFE writes an address to the PC.The alignment of this address must be correct for the instruction setin use after the exception return:

  • For a return to A32, the address written to the PC must be word-aligned.
  • For a return to T32, the address written to the PC must be halfword-aligned.
  • For a return to Jazelle, there are no alignment restrictions on the address written to the PC.

No special precautions are required in software to followthese rules, if you use the instruction to return after a validexception entry mechanism.

Where addresses are not word-aligned, RFE ignoresthe least significant two bits of Rn.

The time order of the accesses to individual words of memorygenerated by RFE is not architecturallydefined. Do not use this instruction on memory-mapped I/O locationswhere access order matters.

Do not use RFE in unprivilegedsoftware execution.

Architectures

This instruction is available in A32.

This 32-bit T32 instruction is available, except in the ARMv7-M architecture.

There is no 16-bit version of this instruction.

Example

    RFE sp!
Was this page helpful? Yes No