MIPS Stands for Microprocessor without Interlocked Pipeline Stages. MIPS instruction set is a Reduced Instruction Set Computer ISA(Instruction Set Architecture). Mips instruction set has a variety of operational code AKA opcodes. These opcodes are used to perform different types of task such as addition, subtraction, multiplication of signed or unsigned numbers. As MIPS instruction set has a complete reference sheet for these opcodes but in counter, there are MIPS instruction set formats to write these instructions and perform the operations.
Here in MIPS instruction set session, we will discuss some MIPS opcodes in detail as well as complete reference sheet in pdf form will also be shared.
MIPS Instruction Set Opcodes
MIPS Opcodes are divided into different categories. To understand each category you have to see the complete opcode list in table form then go through the description and example for each opcode. See different categories below:
Arithmetic and Logic Instruction Opcodes
MIPS instruction set arithmetic and logic instructions opcodes entire table. Generaly these opcodes include:
- Addition
- Subtraction
- Multiplication
- Division
- And
- Or
- Not
- Shift Arithmetic left
- Shift Arithmetic Right
Instruction | Opcode/Function | Syntax | Operation | Format |
---|---|---|---|---|
addu | 100001 | f $d, $s, $t | t$d = $s + $t | R |
add | 100000 | f $d, $s, $t | $d = $s + $ | R |
addiu | 001001 | f $d, $s, i | $d = $s + SE(i) | I |
addi | 001000 | f $d, $s, i | $d = $s + SE(i) | I |
andi | 001100 | f $d, $s, i | $t = $s & ZE(i) | I |
div | 011010 | f $s, $t | lo = $s / $t; hi = $s % $t | R |
and | 100100 | f $d, $s, $t | $d = $s & $t | R |
mult | 011000 | f $s, $t | hi:lo = $s * $t | R |
divu | 011011 | f $s, $t | lo = $s / $t; hi = $s % $t | R |
nor | 100111 | f $d, $s, $t | $d = ~($s | $t) | R |
multu | 011001 | f $s, $t | hi:lo = $s * $t | R |
ori | 001101 | f $d, $s, i | $t = $s | ZE(i) | I |
or | 100101 | f $d, $s, $t | $d = $s | $t | R |
sllv | 000100 | f $d, $t, $s | $d = $t << $s | R |
sll | 000000 | f $d, $t, a | $d = $t << a | R |
srav | 000111 | f $d, $t, $s | $d = $t >> $s | R |
sra | 000011 | f $d, $t, a | $d = $t >> a | R |
srlv | 000110 | f $d, $t, $s | $d = $t >>> $s | R |
srl | 000010 | f $d, $t, a | $d = $t >>> $s | R |
subu | 100011 | f $d, $s, $t | $d = $s – $t | R |
sub | 100010 | f $d, $s, $t | $d = $s – $t | R |
xori | 001110 | f $d, $s, i | $d = $s ^ ZE(i) | I |
xor | 100110 | f $d, $s, $t | $d = $s ^ $t | R |
Comparison Instructions
MIPS instruction set comparison instruction opcodes entire table. They generally include:
- Set If Less Than
- Unsigned Set If Less Than
- Set If Less Than Immediate
- Unsigned Set If Less Than Immediate
Instruction | Opcode/Function | Syntax | Operation | Format |
---|---|---|---|---|
uslt | 101010 | f $d, $s, $t | $d = ($s < $t) | R |
slt | 101001 | f $d, $s, $t | $d = ($s < $t) | R |
sltiu | 001001 | f $d, $s, i | $t = ($s < SE(i)) | I |
slti | 001010 | f $d, $s, i | $t = ($s < SE(i)) | I |
Constant-Manipulating Instructions
MIPS instruction set constant manipulating instructions opcodes complete table. It generally includes:
Instruction | Opcode/Function | Syntax | Operation | Format |
---|---|---|---|---|
llo | 011000 | o $t, immed32 | LH ($t) = i | R |
lhi | 011001 | o $t, immed32 | HH ($t) = i | R |
Branch Instructions
MIPS instruction set branch opcodes complete table. It includes:
- Branch greater than zero
- Branch equal to
- Branch not equal to
- Branch less than or equal to zero
Instruction | Opcode/Function | Syntax | Operation | Format |
---|---|---|---|---|
bgtz | 000111 | o $s, label | if ($s > 0) pc += i << 2 | |
beq | 000100 | o $s, $t, label | if ($s == $t) pc += i << 2 | I |
bne | 000101 | o $s, $t, label | if ($s != $t) pc += i << 2 | I |
blez | 000110 | o $s, label | if ($s <= 0) pc += i << 2 |
Load Instructions
MIPS instruction set Load Instruction opcodes complete table. It includes:
- Load byte unsigned
- Load byte
- Load half word unsigned
- Load half word
- Load word
Instruction | Opcode/Function | Syntax | Operation | Format |
---|---|---|---|---|
lbu | 100100 | o $t, i ($s) | $t = ZE (MEM [$s + i]:1) | I |
lb | 100000 | o $t, i ($s) | $t = SE (MEM [$s + i]:1) | I |
lhu | 100101 | o $t, i ($s) | $t = ZE (MEM [$s + i]:2) | I |
lh | 100001 | o $t, i ($s) | $t = SE (MEM [$s + i]:2) | I |
lw | 100011 | o $t, i ($s) | $t = MEM [$s + i]:4 | I |
Jump Instructions
MIPS instruction set Jump Instruction opcodes complete table. It includes:
- Jump and link
- Jump
- Jump Register
- Jump and link register
Instruction | Opcode/Function | Syntax | Operation | Format |
---|---|---|---|---|
jal | 000011 | o label | $31 = pc; pc += i << 2 | J |
j | 000010 | o label | pc += i << 2 | J |
jr | 001000 | o labelR | pc = $s | R |
jalr | 001001 | o labelR | $31 = pc; pc = $s | R |
Store Instructions
MIPS instruction set Store Instructions opcodes complete table. It generally includes:
- Store half word
- Store Byte
- Store word
Instruction | Opcode/Function | Syntax | Operation | Format |
---|---|---|---|---|
sh | 101001 | o $t, i ($s) | MEM [$s + i]:2 = LH ($t) | I |
sb | 101000 | o $t, i ($s) | MEM [$s + i]:1 = LB ($t) | I |
sw | 101011 | o $t, i ($s) | MEM [$s + i]:4 = $t | I |
Data Movement Instructions
Mips instruction set Data Movement Instructions opcodes complete table. It includes:
- Move from low
- Move from high
- Move to low
- Move to high
Instruction | Opcode/Function | Syntax | Operation | Format |
---|---|---|---|---|
mflo | 010010 | f $d | $d = lo | R |
mfhi | 010000 | f $d | $d = hi | R |
mtlo | 010011 | f $s | lo = $s | R |
mthi | 010001 | f $s | hi = $s | I |
Exception and Interrupt Instructions
MIPS instruction set Exception and interrupt opcodes include one major opcode:
- Trap
Instruction | Opcode/Function | Syntax | Operation | Format |
---|---|---|---|---|
trap | 011010 | o i | Dependent on OS; different values for immed26 specify different operations. |
MIPS Opcodes Reference Sheet PDF Free Download
To download pdf format of MIPS green sheet click the below Download button.
[thrive_link color=’blue’ link=” target=’_self’ size=’medium’ align=’aligncenter’]Download Pdf[/thrive_link]That was all about MIPS opcodes and instructions. Hope you will find it easy to understand.
Comment to show me that your are alive!