Details of the MIPS instruction set
Register zero always has the value zero
- even if you try to write it
Branch and jump instructions put the return address PC+4 into the link register
All instructions change all 32 bits of the destination register (lui, lb, lh) and read all 32 bits of sources (add, sub, and, or, …)
Immediate arithmetic and logical instructions are extended as follows:
- logical immediates are zero extended to 32 bits
- arithmetic immediates are sign extended to 32 bits
lb and lh extend data as follows:
- lbu, lhu are zero extended
- lb, lh are sign extended