SB
Store Byte
SB rs2, offset(rs1)
Stores the lowest 8 bits of a register to memory.
Encoding
Binary Layout
imm12hi
31:25
rs2
24:20
rs1
19:15
000
14:12
imm12lo
11:7
0100011
6:0
Operands
-
rs2
Source -
rs1
Base Address -
offset
Offset
Example
SB x5, 0(x10)
// Store low byte of x5 to address in x10.
Related
More in RV32I
Reference
View in RISC-V Unprivileged ISA Specification ↗
RISC-V ISA Manual
Description
SB stores the least-significant byte of rs2 to memory at address rs1+sext(offset).
Operation
M[R[rs1] + sext(offset)][7:0] = R[rs2][7:0];