stw

Store Word

stw RS, D(RA)

Stores the low 32 bits of a register to memory.

Details

The stw instruction stores the lower 32 bits of the contents of register RS into the word in storage addressed by the effective address (EA). The EA is calculated as (RA|0) + EXTS64(D).

Pseudocode Operation

EA ← (RA|0) + EXTS64(D)
MEM(EA, 4) ← (RS)32:63

Programming Note

The stw instruction stores the lower 32 bits of a register into memory. Ensure that the destination address is properly aligned to avoid alignment faults. This instruction operates at user privilege level and will raise an exception if the EA is out of bounds or access permissions are violated.

Example

stw r3, 0(r4)

Encoding

Binary Layout
36
0
RS
6
RA
11
D
16
 
Format D-form
Opcode 0x90000000
Extension Base

Operands

  • RS
    Source Register
  • D
    Displacement
  • RA
    Base Register