Store Return State onto a stack.
SRS{addr_mode}{cond} sp{!}, #modenum
SRS{addr_mode}{cond} #modenum{!} ; This is a pre-UAL syntax
where:
-
is any one of the following:
-
Increment address After each transfer
-
Increment address Before each transfer (ARM only)
-
Decrement address After each transfer (ARM only)
-
Decrement address Before each transfer (Full Descending stack).
IAIBDADBIf
is omitted, it defaults to Increment After. You can also use stack oriented addressing mode suffixes, for example, when implementing stacks.addr_mode -
-
is an optional condition code.
Note
is permitted only in Thumb code, using a precedingcondITinstruction. This is an unconditional instruction in ARM. -
is an optional suffix. If
!is present, the final address is written back into the SP of the mode specified by.modenum -
specifies the number of the mode whose banked SP is used as the base register. You must use only the defined mode numbers.
addr_mode
cond
!
modenum
SRS stores the LR and the SPSR of the current mode, at the address contained in SP of the mode specified by , and the following word respectively. Optionally updates SP of the mode specified by modenum. This is compatible with the normal use of the modenumSTM instruction for stack accesses.
Note
For full descending stack, you must use SRSFD or SRSDB.
You can use SRS to store return state for an exception handler on a different stack from the one automatically selected.
Where addresses are not word-aligned, SRS ignores the least significant two bits of the specified address.
The time order of the accesses to individual words of memory generated by SRS is not architecturally defined. Do not use this instruction on memory-mapped I/O locations where access order matters.
Do not use SRS in User and System modes because these modes do not have a SPSR.
Do not use SRS in Thumb-2EE.
SRS is not permitted in a non-secure state if specifies monitor mode.modenum
This ARM instruction is available in ARMv6 and above.
This 32-bit Thumb instruction is available in ARMv6T2 and above, except the ARMv7-M architecture.
There is no 16-bit version of this instruction.
-
Concepts
- Reference:
本文详细介绍了SRS(Store Return State onto a stack)指令的使用方法及其语法格式。SRS指令用于将异常处理程序的返回状态存储到指定模式的栈中。文章解释了不同寻址模式(如IA、IB、DA、DB)的含义,并说明了如何使用条件码及写回选项。此外,还提供了使用SRS指令时需要注意的一些事项。
Syntax
5893

被折叠的 条评论
为什么被折叠?



