strb

Store Register Byte (Immediate)

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

Stores the low byte of a register.

Pseudocode Operation

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

Example

STRB w3, [x1, #16]

Encoding

Binary Layout
00
31:30
111
29:27
0
26
01
25:24
00
23:22
imm12
21:10
Rn
9:5
Rt
4:0
 
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

Related

Other forms of strb

  • strb Store Register Byte (Register)

More in Base

Reference

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;