str.w

Store Register (Wide)

STR.W <Rt>, [<Rn>, #<imm>]

Thumb-2 32-bit Store Word.

Details

Store a 32-bit word from Rt to memory at address [Rn + imm12]. The immediate offset is unsigned and ranges from 0 to 4095 bytes. Condition flags (N, Z, C, V) are not affected. T32 (Thumb-2) instruction only.

Pseudocode Operation

address ← Rn + ZeroExtend(imm12, 32);
[address]<31:0> ← Rt;

Example

STR.W r3, [r1, #16]

Encoding

Binary Layout
111110001
10
0
Rn
Rt
imm12
 
Format Thumb Store
Opcode 0xF8C00000
Extension T32 (Thumb2)

Operands

  • Rt
    Transfer general-purpose register (load/store)
  • Rn
    First source / base general-purpose register
  • imm
    Signed immediate value

Reference (Arm AArch32 ISA)

Instruction Forms

Encoding Instruction ISA Bit pattern
0x05000000 STR{<c>}{<q>} <Rt>, [<Rn> {, #{+/-}<imm>}] A32 cond | 010 | 1 | U | 0 | 0 | 0 | Rn | Rt | imm12
0x04000000 STR{<c>}{<q>} <Rt>, [<Rn>], #{+/-}<imm> A32 cond | 010 | 0 | U | 0 | 0 | 0 | Rn | Rt | imm12
0x05200000 STR{<c>}{<q>} <Rt>, [<Rn>, #{+/-}<imm>]! A32 cond | 010 | 1 | U | 0 | 1 | 0 | Rn | Rt | imm12
0x6000 STR{<c>}{<q>} <Rt>, [<Rn> {, #{+}<imm>}] T32 011 | 0 | 0 | imm5 | Rn | Rt
0x9000 STR{<c>}{<q>} <Rt>, [SP{, #{+}<imm>}] T32 1001 | 0 | Rt | imm8
0xF8C00000 STR{<c>}.W <Rt>, [<Rn> {, #{+}<imm>}] T32 111110001 | 10 | 0 | Rn | Rt | imm12
0xF8400C00 STR{<c>}{<q>} <Rt>, [<Rn> {, #-<imm>}] T32 111110000 | 10 | 0 | Rn | Rt | 1 | 1 | 0 | 0 | imm8
0xF8400900 STR{<c>}{<q>} <Rt>, [<Rn>], #{+/-}<imm> T32 111110000 | 10 | 0 | Rn | Rt | 1 | 0 | U | 1 | imm8
0xF8400D00 STR{<c>}{<q>} <Rt>, [<Rn>, #{+/-}<imm>]! T32 111110000 | 10 | 0 | Rn | Rt | 1 | 1 | U | 1 | imm8
0x07000000 STR{<c>}{<q>} <Rt>, [<Rn>, {+/-}<Rm>{, <shift>}] A32 cond | 011 | 1 | U | 0 | 0 | 0 | Rn | Rt | imm5 | stype | 0 | Rm
0x06000000 STR{<c>}{<q>} <Rt>, [<Rn>], {+/-}<Rm>{, <shift>} A32 cond | 011 | 0 | U | 0 | 0 | 0 | Rn | Rt | imm5 | stype | 0 | Rm
0x07200000 STR{<c>}{<q>} <Rt>, [<Rn>, {+/-}<Rm>{, <shift>}]! A32 cond | 011 | 1 | U | 0 | 1 | 0 | Rn | Rt | imm5 | stype | 0 | Rm
0x5000 STR{<c>}{<q>} <Rt>, [<Rn>, {+}<Rm>] T32 0101 | 0 | 0 | 0 | Rm | Rn | Rt
0xF8400000 STR{<c>}.W <Rt>, [<Rn>, {+}<Rm>] T32 111110000 | 10 | 0 | Rn | Rt | 000000 | imm2 | Rm

Description

Store Register (immediate) calculates an address from a base register value and an immediate offset, and stores a word from a register to memory. It can use offset, post-indexed, or pre-indexed addressing. For information about memory accesses see Memory accesses.

Operation

if CurrentInstrSet() == InstrSet_A32 then
    if ConditionPassed() then
        EncodingSpecificOperations();
        offset_addr = if add then (R[n] + imm32) else (R[n] - imm32);
        address = if index then offset_addr else R[n];
        MemU[address,4] = if t == 15 then PCStoreValue() else R[t];
        if wback then R[n] = offset_addr;
else
    if ConditionPassed() then
        EncodingSpecificOperations();
        offset_addr = if add then (R[n] + imm32) else (R[n] - imm32);
        address = if index then offset_addr else R[n];
        MemU[address,4] = R[t];
        if wback then R[n] = offset_addr;