4.3.3. SUBS PC, LR (Thumb-2 only)

Exception return, without stack popping.

Syntax

SUBS{cond} PC, LR, #immed_8

where:

immed_8

is an 8-bit immediate constant.

cond

is an optional condition code (see Conditional execution).

Usage

You can use SUBS PC, LR to return from an exception if there is no return state on the stack.

SUBS PC, LR subtracts a value from the link register and loads the PC with the result, then copies the SPSR to the CPSR.

Notes

SUBS PC, LR 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, they 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.

MOVS pc, lr is a synonym of SUBS pc, lr, #0 in Thumb-2.

Architectures

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

Copyright © 2002-2005 ARM Limited. All rights reserved.ARM DUI 0204F
Non-Confidential