lwa

Load Word Algebraic

lwa RT, DS(RA)

Loads a word (32 bits) from memory and sign-extends it to 64 bits.

Details

The lwz instruction loads a word from memory into the specified target register (RT), zeroing out the upper 32 bits of RT. The effective address is calculated by adding the displacement (D) to the base address in register RA, or using the value 0 if RA is 0.

Pseudocode Operation

RT <- EXTS(MEM(EA, 4))

Programming Note

The lwa instruction is commonly used for loading a 32-bit word from memory into a target register while zeroing out the upper 32 bits. Ensure that the base address in RA and displacement D are correctly aligned to avoid alignment faults. This instruction operates at user privilege level and will raise an exception if the effective address is invalid or if there is a protection fault.

Example

lwa r3, 8(r4)

Encoding

Binary Layout
58
0
RT
6
RA
11
DS
16
2
30
 
Format DS-form
Opcode 0xE8000002
Extension Base

Operands

  • RT
    Target Register
  • DS
    Displacement (Aligned)
  • RA
    Base Register