This Web page was created by reformatting portions of the LaTeX source file of the public domain documentation distributed with the SPIM simulator. This documentation is fairly consistent with the information in our online manual but it is not identical.
Chris Edmondson-Yurkanan (with thanks to John Conery at the University of Oregon)
Last update: 29 Oct 98 16:18:29
In all instructions below, Src2 can either be a register or an immediate value (a 16 bit integer). The immediate forms of the instructions are only included for reference. The assembler will translate the more general form of an instruction (e.g., add) into the immediate form (e.g., addi) if the second argument is constant.
| abs Rdest, Rsrc | Absolute Value | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Put the absolute value of the integer from register Rsrc in register Rdest. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| li Rdest, imm | Load Immediate | ||||
Move the immediate imm into register Rdest. | |||||
In all instructions below, Src2 can either be a register or an immediate value (a 16 bit integer).
| seq Rdest, Rsrc1, Src2 | Set Equal | ||||||||||||||||||||||||||||||||
Set register Rdest to 1 if register Rsrc1 equals Src2 and to be 0 otherwise. | |||||||||||||||||||||||||||||||||
In all instructions below, Src2 can either be a register or an immediate value (integer). Branch instructions use the PC relative addressing mode, hence have a signed 16-bit offset field; hence they can jump 2^15-1 instructions (not bytes) forward or 2^15 instructions backwards. The jump/jump and link instructions contain a 26 bit address field (a variant of the memory direct addressing mode).
| b label | Branch instruction | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| la Rdest, address | Load Address | ||||||||||||||||||||
Load computed address, not the contents of the location, into register Rdest. | |||||||||||||||||||||
| sb Rsrc, address | Store Byte | ||||||||||||
Store the low byte from register Rsrc at address. | |||||||||||||
| move Rdest, Rsrc | Move | ||||||||||||||
Move the contents of Rsrc to Rdest. The multiply and divide unit produces its result in two additional registers, hi and lo. These instructions move values to and from these registers. The multiply, divide, and remainder instructions described above are pseudoinstructions that make it appear as if this unit operates on the general registers and detect error conditions such as divide by zero or overflow. | |||||||||||||||
| mfhi Rdest | Move From hi | ||||||||||||||
| mflo Rdest | Move From lo | ||||||||||||||
Move the contents of the hi (lo) register to register Rdest. | |||||||||||||||
| pushgm | Push word on stack | ||||
| |||||
| rfe | Return From Exception | ||||
Restore the Status register. | |||||