[prev] 28 [next]

MIPS Instructions (cont)

Some common MIPS/SPIM instructions include

InstructionDescriptionExplanation
add Rd Rs Rt Rd = Rs + RtAdd contents of Rs and Rt register and store in register Rd
addi Rd Rs Imm Rd = Rs + ImmAdd contents of register Rs and a constant value and store in register Rd
mul Rd Rs Rt Rd = Rs * RtMultiply contents of register Rs and Rt and store in register Rd
move Rd Rs Rd = RsMove the contents of register Rsinto register Rd
la Rd Addr Rd = AddrLoad address into register Rd
li Rd Imm Rd = ImmLoad constant value into register Rd
lw Rd Addr Rd = word at Mem[addr]Load a word from memory at the given address into register Rd
sw Rs Addr Mem[addr] = RsStore the word from register Rs into the given address in memory
jr Rs Jump to location in RsSets the program counter to the address in Rs

See Spim Instruction Set for full set of instructions and more details