You copied the Doc URL to your clipboard.

13.132 SRS

Store Return State onto a stack.

Syntax

SRS{addr_mode}{cond} sp{!}, #modenum

SRS{addr_mode}{cond} #modenum{!} ; This is pre-UAL syntax

where:

addr_mode

is any one of the following:

IA

Increment address After each transfer

IB

Increment address Before each transfer (A32 only)

DA

Decrement address After each transfer (A32 only)

DB

Decrement address Before each transfer (Full Descendingstack).

If addr_mode is omitted, itdefaults to Increment After. You can also use stack oriented addressingmode suffixes, for example, when implementing stacks.

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

is an optional suffix. If ! ispresent, the final address is written back into the SP of the modespecified by modenum.

modenum

specifies the number of the mode whose banked SPis used as the base register. You must use only the defined modenumbers.

Operation

SRS stores the LR and the SPSRof the current mode, at the address contained in SP of the mode specifiedby modenum, and the following wordrespectively. Optionally updates SP of the mode specified by modenum.This is compatible with the normal use of the STM instructionfor stack accesses.

Note

For full descending stack, you must use SRSFD or SRSDB.

Usage

You can use SRS to store returnstate for an exception handler on a different stack from the one automaticallyselected.

Notes

Where addresses are not word-aligned, SRS ignoresthe least significant two bits of the specified address.

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

Do not use SRS in User and Systemmodes because these modes do not have a SPSR.

SRS is not permitted in a non-secure state if modenum specifies monitor mode.

Availability

This 32-bit instruction is available in A32 and T32.

There is no 16-bit version of this instruction in T32.

Example

R13_usr  EQU     16         SRSFD   sp,#R13_usr
Was this page helpful? Yes No