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.


is an optional condition code (see Conditional execution).


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


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).


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


Data Abort.


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, that is, the results cannot be relied upon. 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.

If User mode is specified by mode, the usual rules apply about writing to CPSR (see ARM Architecture Reference Manual for details).

If Monitor mode is specified by mode, the result is unpredictable, that is, it cannot be relied upon (see SMI).


This ARM instruction is available in ARMv6 and above.

This 32-bit Thumb-2 instruction is available in T2 variants of ARMv6 and above.

There is no 16-bit version of this instruction.


    RFE r13!

Incorrect example

    RFEFD   r15     ; do not use r15
Copyright © 2002-2005 ARM Limited. All rights reserved.ARM DUI 0204F