|
Arithmetic
| Instruction |
Type |
Assembly Language |
Example |
IR Format |
| add |
R |
add $dest, $addend1, $addend2 |
add $3, $1, $2 |
|
| sub |
R |
sub $dest, $minuend, $subtrahend |
sub $3, $1, $2 |
|
| mult |
R |
mult $dest, $multiplicand, $multiplier |
mult $3, $1, $2 |
|
| div |
R |
div $dest, $dividend, $divisor |
div $3, $1, $2 |
|
Logical
| Instruction |
Type |
Assembly Language |
Example |
IR Format |
| and |
R |
and $dest, $operand1, $operand2 |
and $3, $1, $2 |
|
| or |
R |
or $dest, $operand1, $operand2 |
or $3, $1, $2 |
|
| ori |
M |
ori $reg, constant |
ori $1, 5 |
|
| andi |
M |
andi $reg, constant |
andi $1, 5 |
|
| xor |
R |
xor $dest, $operand1, $operand2 |
xor $3, $1, $2 |
|
| nand |
R |
nand $dest, $operand1, $operand2 |
nand $3, $1, $2 |
|
| nor |
R |
nor $dest, $operand1, $operand2 |
nor $3, $1, $2 |
|
| xnor |
R |
xnor $dest, $operand1, $operand2 |
xnor $3, $1, $2 |
|
| slt |
R |
slt $dest, $value1, $value2 |
slt $3, $1, $2 |
|
Shift
| Instruction |
Type |
Assembly Language |
Example |
IR Format |
| sll |
I |
sll $dest, $source, offset |
sll $2, $1, 5 |
|
| srl |
I |
srl $dest, $source, offset |
srl $2, $1, 5 |
|
Memory and Register
| Instruction |
Type |
Assembly Language |
Example |
IR Format |
| lw |
I |
lw $dest, offset($base) |
lw $2, 4($1) |
|
| sw |
I |
sw $source, offset($base) |
sw $2, 4($1) |
|
| copy |
R |
copy $dest, $source |
copy $2, $1 |
|
| lui |
M |
lui $dest, constant |
lui $2, 100 |
|
| mtm |
I |
mtm $dest, offset($base) |
mtm $2, 4($1) |
|
| swap |
R |
swap $reg1, $reg2 |
swap $1, $2 |
|
| swra |
I |
swra offset($base) |
swra 4($1) |
|
| lwra |
I |
lwra offset($base) |
lwra 4($1) |
|
Branch
| Instruction |
Type |
Assembly Language |
Example |
IR Format |
| beq |
I |
beq $val1, $val2, Label |
beq $1, $2, Label |
|
| bne |
I |
bne $val1, $val2, Label |
bne $1, $2, Label |
|
Jump
| Instruction |
Type |
Assembly Language |
Example |
IR Format |
| j |
J |
j Label |
j Label |
|
| jr |
R |
jr $reg |
jr $1 |
|
| jal |
J |
jal Label |
jal Label |
|
| jm |
M |
jm offset($base) |
jm 4($1) |
|
| jra |
R |
jra |
jra |
|
|