0% found this document useful (0 votes)
32 views1 page

W 07 Ref

This document provides a reference sheet for basic MIPS instruction formats and examples of common MIPS instructions. It lists the opcode, format, and functionality for instructions like add, subtract, load, store, branch, and jump. Register instructions use a register-register format with opcodes, source, target and destination registers specified. Immediate instructions embed an immediate value in the instruction word.

Uploaded by

anon-843323
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views1 page

W 07 Ref

This document provides a reference sheet for basic MIPS instruction formats and examples of common MIPS instructions. It lists the opcode, format, and functionality for instructions like add, subtract, load, store, branch, and jump. Register instructions use a register-register format with opcodes, source, target and destination registers specified. Immediate instructions embed an immediate value in the instruction word.

Uploaded by

anon-843323
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

MIPS Reference Sheet

Basic Instruction Formats


Register 0000 00ss ssst tttt dddd d000 00ff ffff R
Immediate oooo ooss ssst tttt iiii iiii iiii iiii I

Instructions
Word .word i iiii iiii iiii iiii iiii iiii iiii iiii
Add add $d, $s, $t 0000 00ss ssst tttt dddd d000 0010 0000 R $d = $s + $t
Subtract sub $d, $s, $t 0000 00ss ssst tttt dddd d000 0010 0010 R $d = $s - $t
Multiply mult $s, $t 0000 00ss ssst tttt 0000 0000 0001 1000 R hi:lo = $s * $t
Multiply Unsigned multu $s, $t 0000 00ss ssst tttt 0000 0000 0001 1001 R hi:lo = $s * $t
Divide div $s, $t 0000 00ss ssst tttt 0000 0000 0001 1010 R lo = $s / $t; hi = $s % $t
Divide Unsigned divu $s, $t 0000 00ss ssst tttt 0000 0000 0001 1011 R lo = $s / $t; hi = $s % $t
Move From High/Remainder mfhi $d 0000 0000 0000 0000 dddd d000 0001 0000 R $d = hi
Move From Low/Quotient mflo $d 0000 0000 0000 0000 dddd d000 0001 0010 R $d = lo
Load Immediate And Skip lis $d 0000 0000 0000 0000 dddd d000 0001 0100 R $d = MEM[pc]; pc = pc + 4
Load Word lw $t, i($s) 1000 11ss ssst tttt iiii iiii iiii iiii I $t = MEM [$s + i]:4
Store Word sw $t, i($s) 1010 11ss ssst tttt iiii iiii iiii iiii I MEM [$s + i]:4 = $t
Set Less Than slt $d, $s, $t 0000 00ss ssst tttt dddd d000 0010 1010 R $d = 1 if $s < $t; 0 otherwise
Set Less Than Unsigned sltu $d, $s, $t 0000 00ss ssst tttt dddd d000 0010 1011 R $d = 1 if $s < $t; 0 otherwise
Branch On Equal beq $s, $t, i 0001 00ss ssst tttt iiii iiii iiii iiii I if ($s == $t) pc += i * 4
Branch On Not Equal bne $s, $t, i 0001 01ss ssst tttt iiii iiii iiii iiii I if ($s != $t) pc += i * 4
Jump Register jr $s 0000 00ss sss0 0000 0000 0000 0000 1000 R pc = $s
Jump And Link Register jalr $s 0000 00ss sss0 0000 0000 0000 0000 1001 R $31 = pc; pc = $s

You might also like