4.2.10. RFE

Return From Exception.


RFE{addr_mode}{cond} Rn{!}



is any one of the following:


Increment address After each transfer (Full Descending stack)


Increment address Before each transfer (ARM only)


Decrement address After each transfer (ARM only)


Decrement address Before each transfer.

If addr_mode is omitted, it defaults to Increment After.


is an optional condition code (see Conditional execution).


cond is allowed only in Thumb-2 code, using a preceding IT instruction. This is an unconditional instruction in ARM.


specifies the base register. Do not use r15 for Rn.


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


You can use RFE to return from an exception if you previously saved the return state using the SRS instruction (see SRS). Rn is usually the sp where the return state information was saved.


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


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

  • For a return to ARM, the address written to the pc must be word-aligned.

  • For a return to Thumb-2, 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.

The results of breaking these rules are unpredictable. However, no special precautions are required in software, if the instructions are used to return after a valid exception entry mechanism.

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

The time order of the accesses to individual words of memory generated by RFE is not architecturally defined. Do not use this instruction on memory-mapped I/O locations where access order matters.

Do not use RFE in unprivileged modes, see Processor mode.

Do not use RFE in Thumb2-EE.


This ARM instruction is available in ARMv6 and above.

This 32-bit Thumb instruction is available in ARMv6T2 and above, except the ARMv7-M profile.

There is no 16-bit version of this instruction.


    RFE sp!
Copyright © 2002-2010 ARM. All rights reserved.ARM DUI 0204J