strb.w

Store Register Byte (Wide)

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

Thumb-2 32-bit Store Byte.

Details

Store the lowest 8 bits of 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]<7:0> ← Rt<7:0>;

Example

STRB.W r3, [r1, #16]

Encoding

Binary Layout
111110001
00
0
Rn
Rt
imm12
 
Format Thumb Store
Opcode 0xF8800000
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
0x05400000 STRB{<c>}{<q>} <Rt>, [<Rn> {, #{+/-}<imm>}] A32 cond | 010 | 1 | U | 1 | 0 | 0 | Rn | Rt | imm12
0x04400000 STRB{<c>}{<q>} <Rt>, [<Rn>], #{+/-}<imm> A32 cond | 010 | 0 | U | 1 | 0 | 0 | Rn | Rt | imm12
0x05600000 STRB{<c>}{<q>} <Rt>, [<Rn>, #{+/-}<imm>]! A32 cond | 010 | 1 | U | 1 | 1 | 0 | Rn | Rt | imm12
0x7000 STRB{<c>}{<q>} <Rt>, [<Rn> {, #{+}<imm>}] T32 011 | 1 | 0 | imm5 | Rn | Rt
0xF8800000 STRB{<c>}.W <Rt>, [<Rn> {, #{+}<imm>}] T32 111110001 | 00 | 0 | Rn | Rt | imm12
0xF8000C00 STRB{<c>}{<q>} <Rt>, [<Rn> {, #-<imm>}] T32 111110000 | 00 | 0 | Rn | Rt | 1 | 1 | 0 | 0 | imm8
0xF8000900 STRB{<c>}{<q>} <Rt>, [<Rn>], #{+/-}<imm> T32 111110000 | 00 | 0 | Rn | Rt | 1 | 0 | U | 1 | imm8
0xF8000D00 STRB{<c>}{<q>} <Rt>, [<Rn>, #{+/-}<imm>]! T32 111110000 | 00 | 0 | Rn | Rt | 1 | 1 | U | 1 | imm8
0x07400000 STRB{<c>}{<q>} <Rt>, [<Rn>, {+/-}<Rm>{, <shift>}] A32 cond | 011 | 1 | U | 1 | 0 | 0 | Rn | Rt | imm5 | stype | 0 | Rm
0x06400000 STRB{<c>}{<q>} <Rt>, [<Rn>], {+/-}<Rm>{, <shift>} A32 cond | 011 | 0 | U | 1 | 0 | 0 | Rn | Rt | imm5 | stype | 0 | Rm
0x07600000 STRB{<c>}{<q>} <Rt>, [<Rn>, {+/-}<Rm>{, <shift>}]! A32 cond | 011 | 1 | U | 1 | 1 | 0 | Rn | Rt | imm5 | stype | 0 | Rm
0x5400 STRB{<c>}{<q>} <Rt>, [<Rn>, {+}<Rm>] T32 0101 | 0 | 1 | 0 | Rm | Rn | Rt
0xF8000000 STRB{<c>}.W <Rt>, [<Rn>, {+}<Rm>] T32 111110000 | 00 | 0 | Rn | Rt | 000000 | imm2 | Rm

Description

Store Register Byte (immediate) calculates an address from a base register value and an immediate offset, and stores a byte 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,1] = R[t]<7:0>;
        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,1] = R[t]<7:0>;
        if wback then R[n] = offset_addr;