lwz

Load Word and Zero

lwz RT, D(RA)

Loads a word (32 bits) from memory and clears the upper 32 bits.

Details

The effective address (EA) is calculated as (RA|0) + EXTS64(D). The word in storage addressed by EA is loaded into RT32:63. RT0:31 are set to 0.

Pseudocode Operation

EA ← (RA|0) + EXTS64(D)
RT ← 320 || MEM(EA, 4)

Programming Note

The lwz instruction is commonly used for loading a word from memory into a register while zeroing the upper half of the target register. Ensure that the address is properly aligned to avoid alignment exceptions. This instruction operates at user privilege level and does not generate any exceptions under normal circumstances.

Example

lwz r3, 8(r4)

Encoding

Binary Layout
32
0
RT
6
RA
11
D
16
 
Format D-form
Opcode 0x80000000
Extension Base

Operands

  • RT
    Target Register
  • D
    Displacement
  • RA
    Base Register