SB

Store Byte

SB rs2, offset(rs1)

Stores the lowest 8 bits of a register to memory.

Details

SB stores the least-significant byte of rs2 to memory at address rs1+sext(offset).

Pseudocode Operation

M[R[rs1] + sext(offset)][7:0] = R[rs2][7:0];

Example

SB x5, 0(x10)

Encoding

Binary Layout
imm[11:5]
31:25
rs2
24:20
rs1
19:15
000
14:12
imm[4:0]
11:7
0100011
6:0
 
Format S-Type
Opcode 0x23
Extension RV32I

Operands

  • rs2
    Source
  • rs1
    Base Address
  • offset
    Offset