strb

Store Register Byte (Immediate)

STRB <Wt>, [<Xn|SP>, #<pimm>]

Stores the low byte of a register.

Details

Stores the low byte (bits 7:0) of a 32-bit register to memory at an address calculated from a base register and a positive immediate offset (unscaled). Does not affect condition flags. AArch64-only instruction.

Pseudocode Operation

address ← Xn + imm12
[address] ← Wt[7:0]

Example

STRB w3, [x1, #16]

Encoding

Binary Layout
00
111
0
01
00
imm12
Rn
Rt
 
Format Load/Store
Opcode 0x39000000
Extension Base

Operands

  • Wt
    Transfer 32-bit integer register (load/store)
  • Xn
    First source / base 64-bit integer register
  • pimm
    Positive immediate offset

Reference (Arm A64 ISA)

Instruction Forms

Encoding Instruction ISA Bit pattern
0x38000400 STRB <Wt>, [<Xn|SP>], #<simm> A64 00 | 111 | 0 | 00 | 00 | 0 | imm9 | 01 | Rn | Rt
0x38000C00 STRB <Wt>, [<Xn|SP>, #<simm>]! A64 00 | 111 | 0 | 00 | 00 | 0 | imm9 | 11 | Rn | Rt
0x39000000 STRB <Wt>, [<Xn|SP>{, #<pimm>}] A64 00 | 111 | 0 | 01 | 00 | imm12 | Rn | Rt
0x38200800 STRB <Wt>, [<Xn|SP>, (<Wm>|<Xm>), <extend> {<amount>}] A64 00 | 111 | 0 | 00 | 00 | 1 | Rm | option | S | 10 | Rn | Rt
0x38206800 STRB <Wt>, [<Xn|SP>, <Xm>{, LSL <amount>}] A64 00 | 111 | 0 | 00 | 00 | 1 | Rm | 011 | S | 10 | Rn | Rt

Description

Store Register Byte (immediate) stores the least significant byte of a 32-bit register to memory. The address that is used for the store is calculated from a base register and an immediate offset. For information about memory accesses, see Load/Store addressing modes.

Operation

bits(64) address;
bits(8) data;

boolean privileged = PSTATE.EL != EL0;
AccessDescriptor accdesc = CreateAccDescGPR(MemOp_STORE, FALSE, privileged, tagchecked);

if n == 31 then
    CheckSPAlignment();
    address = SP[];
else
    address = X[n, 64];

if !postindex then
    address = GenerateAddress(address, offset, accdesc);

if rt_unknown then
    data = bits(8) UNKNOWN;
else
    data = X[t, 8];
Mem[address, 1, accdesc] = data;

if wback then
    if postindex then
        address = GenerateAddress(address, offset, accdesc);
    if n == 31 then
        SP[] = address;
    else
        X[n, 64] = address;