LW Mips: Load Word Opcode Example

LW is a MIPS Assembly instruction(opcode), stand for Load word. Lw MIPS is used to load a word from memory into a register. The general form of LW(Load word) in MIPS Assembly is:

Lw d, off(base)

Characteristics of LW MIPS Instruction

Lw instruction includes:

  • LW to perform a load word instruction.
  • A destination register(d) where the word would be loaded.
  • An offset which is a 16-bit unsigned integer, necessary to make a memory address.
  • A base register. The offset and base register combine to give memory address.

MIPS Lw Program Example

See the below example to understand the use of load word instruction.



In the above program, we described the use of LW(load word) in an array. We initialized an array(lwExample) and assigned five values of type word. In the main body of the program, we used a while loop to increment the index at each iteration. At each increment, we add 4 to index because each value is stored in 4 bytes. We used a lw instruction to retrieve values from each index of the array and print it.


Nauman Rehmat

Nauman Rehmat is the owner of Assembly Language Tuts.He is interested in Programming and SEO. He is also pursuing a degree in Computer Software Engineering from Comsats.