STM, STMIA, STMEA
Store Multiple (Increment After, Empty Ascending)
Store Multiple (Increment After, Empty Ascending) stores multiple registers to consecutive memory locations using an address from a base register. The consecutive memory locations start at this address, and the address just above the last of those locations can optionally be written back to the base register.
The lowest-numbered register is loaded from the lowest memory address, through to the highest-numbered register from the highest memory address. See also Encoding of lists of general-purpose registers and the PC.
Armv8.2 permits the deprecation of some Store Multiple ordering behaviors in AArch32 state, for more information see FEAT_LSMAOC. For details of related system instructions see STM (User registers).
For more information about the constrained unpredictable behavior of this instruction, see Architectural Constraints on UNPREDICTABLE behaviors.
If CPSR.DIT is 1, the timing of this instruction is insensitive to the value of the data being loaded or stored.
It has encodings from the following instruction sets:
A32 (
A1
)
and
T32 (
T1
and
T2
)
.
!= 1111
1
0
0
0
1
0
0
STM{IA}{<c>}{<q>} <Rn>{!}, <registers>
STMEA{<c>}{<q>} <Rn>{!}, <registers>
n = UInt(Rn); registers = register_list; wback = (W == '1');
if n == 15 || BitCount(registers) < 1 then UNPREDICTABLE;
BitCount(registers) < 1
The instruction operates as an STM with the same addressing mode but targeting an unspecified set of registers. These registers might include R15. If the instruction specifies writeback, the modification to the base address on writeback might differ from the number of registers stored.
n == 15 && wback
The instruction executes with writeback to the PC. The instruction is handled as described in Using R15.
1
1
0
0
0
STM{IA}{<c>}{<q>} <Rn>!, <registers>
STMEA{<c>}{<q>} <Rn>!, <registers>
n = UInt(Rn); registers = '00000000':register_list; wback = TRUE;
if BitCount(registers) < 1 then UNPREDICTABLE;
BitCount(registers) < 1
The instruction operates as an STM with the same addressing mode but targeting an unspecified set of registers. These registers might include R15. If the instruction specifies writeback, the modification to the base address on writeback might differ from the number of registers stored.
n == 15 && wback
The instruction executes with writeback to the PC. The instruction is handled as described in Using R15.
1
1
1
0
1
0
0
0
1
0
0
(0)
STM{IA}{<c>}.W <Rn>{!}, <registers>
STMEA{<c>}.W <Rn>{!}, <registers>
STM{IA}{<c>}{<q>} <Rn>{!}, <registers>
STMEA{<c>}{<q>} <Rn>{!}, <registers>
n = UInt(Rn); registers = P:M:register_list; wback = (W == '1');
if n == 15 || BitCount(registers) < 2 then UNPREDICTABLE;
if wback && registers<n> == '1' then UNPREDICTABLE;
if registers<13> == '1' then UNPREDICTABLE;
if registers<15> == '1' then UNPREDICTABLE;
BitCount(registers) < 1
The instruction operates as an STM with the same addressing mode but targeting an unspecified set of registers. These registers might include R15. If the instruction specifies writeback, the modification to the base address on writeback might differ from the number of registers stored.
BitCount(registers) == 1
The instruction operates as an STM with the same addressing mode but targeting an unspecified set of registers. These registers might include R15.
wback && registers<n> == '1'
registers<13> == '1'
The store instruction performs all of the stores using the specified addressing mode but the value of R13 is unknown.
registers<15> == '1'
The store instruction performs all of the stores using the specified addressing mode but the value of R15 is unknown.
n == 15 && wback
The instruction executes with writeback to the PC. The instruction is handled as described in Using R15.
IA
Is an optional suffix for the Increment After form.
<c>
See Standard assembler syntax fields.
<q>
See Standard assembler syntax fields.
<Rn>
Is the general-purpose base register, encoded in the "Rn" field.
!
The address adjusted by the size of the data loaded is written back to the base register. If specified, it is encoded in the "W" field as 1, otherwise this field defaults to 0.
<registers>
For encoding A1: is a list of one or more registers to be stored, separated by commas and surrounded by { and }.
The PC can be in the list. However, Arm deprecates the use of instructions that include the PC in the list.
If base register writeback is specified, and the base register is not the lowest-numbered register in the list, such an instruction stores an unknown value for the base register.
<registers>
For encoding T1: is a list of one or more registers to be stored, separated by commas and surrounded by { and }. The registers in the list must be in the range R0-R7, encoded in the "register_list" field. If the base register is not the lowest-numbered register in the list, such an instruction stores an unknown value for the base register.
<registers>
For encoding T2: is a list of one or more registers to be stored, separated by commas and surrounded by { and }.
The registers in the list must be in the range R0-R12, encoded in the "register_list" field, and can optionally contain the LR. If the LR is in the list, the "M" field is set to 1, otherwise it defaults to 0.
if ConditionPassed() then
EncodingSpecificOperations();
address = R[n];
for i = 0 to 14
if registers<i> == '1' then
if i == n && wback && i != LowestSetBit(registers) then
MemS[address,4] = bits(32) UNKNOWN; // Only possible for encodings T1 and A1
else
MemS[address,4] = R[i];
address = address + 4;
if registers<15> == '1' then // Only possible for encoding A1
MemS[address,4] = PCStoreValue();
if wback then R[n] = R[n] + 4*BitCount(registers);