Does SB store the whole register?
SB stores only the low 8 bits of rs2, not necessarily the full XLEN-wide register.
Store the low 8 bits of rs2 to memory
SB (S-type, opcode=0100011, funct3=000) stores the low 8 bits of rs2 to the effective address (rs1 + sign-extended 12-bit offset). The S-type immediate is split: upper 7 bits at inst[11:5], lower 5 bits at inst[4:0]. Misaligned access behavior is EEI-defined.
Uses the same rhythm as the ADDI page: machine-code fields, fixed-field identification, operand reads, instruction-specific execution, and ISA-visible state update.
The machine code is split by the current instruction format; the animation starts from encoding/decode.
This animation shows ISA-visible decode and state changes, not any specific CPU pipeline, cache, prediction, or timing implementation.
SB forms the effective address as rs1 plus a signed 12-bit offset and stores the low 8 bits of rs2 to memory.
Understand this scenario with real code like «sb x5, 0(x10) # mem[x10+0][7:0] = x5[7:0]».
Understand this scenario with real code like «sb x5, 0(x10) # mem[x10+0][7:0] = x5[7:0]».
Understand this scenario with real code like «sb x5, 0(x10) # mem[x10+0][7:0] = x5[7:0]».
SB stores only the low 8 bits of rs2, not necessarily the full XLEN-wide register.
The effective address is the base register rs1 plus a sign-extended 12-bit byte offset.