Effective Address
Store instructions form the effective byte address by adding rs1 to a sign-extended 12-bit offset. SW uses the same -2048 to 2047 offset range.
RISC-V Unprivileged ISA, RV32I load and store instructionsStore the full 32-bit value of rs2 to memory
SW (S-type, opcode=0100011, funct3=010) stores the low 32 bits of rs2 to the effective address (rs1 + sign-extended 12-bit offset). Naturally aligned word addresses are multiples of 4. This is the primary store instruction in RV32I, used to save register values to memory.
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.
SW forms the effective address as rs1 plus a signed 12-bit offset and stores the low 32 bits of rs2 to memory.
These notes are checked against the RISC-V Unprivileged ISA manual and summarize operation semantics, immediate ranges, and edge behavior.
Store instructions form the effective byte address by adding rs1 to a sign-extended 12-bit offset. SW uses the same -2048 to 2047 offset range.
RISC-V Unprivileged ISA, RV32I load and store instructionsSW stores the low 32 bits of rs2 to memory; it does not store the full XLEN-wide register value.
RISC-V Unprivileged ISA, RV32I load and store instructionsUnderstand this scenario with real code like «sw x5, 0(x10) # mem[x10+0][31:0] = x5[31:0]».
Understand this scenario with real code like «sw x5, 0(x10) # mem[x10+0][31:0] = x5[31:0]».
Understand this scenario with real code like «sw x5, 0(x10) # mem[x10+0][31:0] = x5[31:0]».
SW stores only the low 32 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.