|
Register |
000000 sssss ttttt ddddd 00000 ffffff |
R |
s, t, d are unsigned |
|
Immediate |
oooooo sssss ttttt iiiii iiiii iiiiii |
I |
i is two's complement |
Add |
add $d, $s, $t |
000000 sssss ttttt ddddd 00000 100000 |
R |
$d = $s + $t |
Subtract |
sub $d, $s, $t |
000000 sssss ttttt ddddd 00000 100010 |
R |
$d = $s - $t |
Multiply |
mult $s, $t |
000000 sssss ttttt 00000 00000 011000 |
R |
hi:lo = $s * $t |
Multiply Unsigned |
multu $s, $t |
000000 sssss ttttt 00000 00000 011001 |
R |
hi:lo = $s * $t |
Divide |
div $s, $t |
000000 sssss ttttt 00000 00000 011010 |
R |
lo = $s / $t; hi = $s % $t |
Divide Unsigned |
divu $s, $t |
000000 sssss ttttt 00000 00000 011011 |
R |
lo = $s / $t; hi = $s % $t |
Move From High/Remainder |
mfhi $d |
000000 00000 00000 ddddd 00000 010000 |
R |
$d = hi |
Move From Low/Quotient |
mflo $d |
000000 00000 00000 ddddd 00000 010010 |
R |
$d = lo |
Load Immediate And Skip |
lis $d |
000000 00000 00000 ddddd 00000 010100 |
R |
$d = MEM[pc]; pc = pc + 4 |
Load Word |
lw $t, i($s) |
100011 sssss ttttt iiiii iiiii iiiiii |
I |
$t = MEM [$s + i] |
Store Word |
sw $t, i($s) |
101011 sssss ttttt iiiii iiiii iiiiii |
I |
MEM [$s + i] = $t |
Set Less Than |
slt $d, $s, $t |
000000 sssss ttttt ddddd 00000 101010 |
R |
$d = 1 if $s < $t; 0 otherwise |
Set Less Than Unsigned |
sltu $d, $s, $t |
000000 sssss ttttt ddddd 00000 101011 |
R |
$d = 1 if $s < $t; 0 otherwise |
Branch On Equal |
beq $s, $t, i |
000100 sssss ttttt iiiii iiiii iiiiii |
I |
if ($s == $t) pc += i * 4 |
Branch On Not Equal |
bne $s, $t, i |
000101 sssss ttttt iiiii iiiii iiiiii |
I |
if ($s != $t) pc += i * 4 |
Jump Register |
jr $s |
000000 sssss 00000 00000 00000 001000 |
R |
pc = $s |
Jump And Link Register |
jalr $s |
000000 sssss 00000 00000 00000 001001 |
R |
temp = $s; $31 = pc; pc = temp |