Instruction List

Core instructions appear in green.
Instructions "borrowing" opcodes (not pseudo-instructions) appear in blue.
Unimplemented instructions appear in red.

 

Arithmetic

Instruction Type Assembly Language Example IR Format
add R add $dest, $addend1, $addend2 add $3, $1, $2
0 1 2 3 0
sub R sub $dest, $minuend, $subtrahend sub $3, $1, $2
0 1 2 3 1
mult R mult $dest, $multiplicand, $multiplier mult $3, $1, $2
0 1 2 3 3
div R div $dest, $dividend, $divisor div $3, $1, $2
0 1 2 3 2

 

Logical

Instruction Type Assembly Language Example IR Format
and R and $dest, $operand1, $operand2 and $3, $1, $2
1 1 2 3 0
or R or $dest, $operand1, $operand2 or $3, $1, $2
1 1 2 3 1
ori M ori $reg, constant ori $1, 5
14 1 1 5
andi M andi $reg, constant andi $1, 5
14 1 0 5
xor R xor $dest, $operand1, $operand2 xor $3, $1, $2
1 1 2 3 3
nand R nand $dest, $operand1, $operand2 nand $3, $1, $2
1 1 2 3 4
nor R nor $dest, $operand1, $operand2 nor $3, $1, $2
1 1 2 3 5
xnor R xnor $dest, $operand1, $operand2 xnor $3, $1, $2
1 1 2 3 7
slt R slt $dest, $value1, $value2 slt $3, $1, $2
0 1 2 3 4

 

Shift

Instruction Type Assembly Language Example IR Format
sll I sll $dest, $source, offset sll $2, $1, 5
12 1 2 5
srl I srl $dest, $source, offset srl $2, $1, 5
13 1 2 5

 

Memory and Register

Instruction Type Assembly Language Example IR Format
lw I lw $dest, offset($base) lw $2, 4($1)
4 1 2 4
sw I sw $source, offset($base) sw $2, 4($1)
5 1 2 4
copy R copy $dest, $source copy $2, $1
0 1 2   6
lui M lui $dest, constant lui $2, 100
6 2   100
mtm I mtm $dest, offset($base) mtm $2, 4($1)
7 1 2 4
swap R swap $reg1, $reg2 swap $1, $2
0 1 2   5
swra I swra offset($base) swra 4($1)
15 1   4
lwra I lwra offset($base) lwra 4($1)
4 1 0 4

 

Branch

Instruction Type Assembly Language Example IR Format
beq I beq $val1, $val2, Label beq $1, $2, Label
2 1 2 Label
bne I bne $val1, $val2, Label bne $1, $2, Label
3 1 2 Label

 

Jump

Instruction Type Assembly Language Example IR Format
j J j Label j Label
8 Label
jr R jr $reg jr $1
10 1     0
jal J jal Label jal Label
9 Label
jm M jm offset($base) jm 4($1)
11 1   4
jra R jra jra
10       1