0% found this document useful (0 votes)
32 views

Mipsref

The document provides a reference sheet for basic MIPS instructions including: - Instruction formats for register and immediate instructions. - A list of common arithmetic, logical, and branch instructions and their opcodes. - Explanations of register names and immediate values used. - Notes on loading/storing words to memory locations and I/O.

Uploaded by

1plus12
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views

Mipsref

The document provides a reference sheet for basic MIPS instructions including: - Instruction formats for register and immediate instructions. - A list of common arithmetic, logical, and branch instructions and their opcodes. - Explanations of register names and immediate values used. - Notes on loading/storing words to memory locations and I/O.

Uploaded by

1plus12
Copyright
© © All Rights Reserved
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
Immediate
0000 ooss ssst tttt iiii iiii iiii iiii
Word
Add
Subtract
Multiply
Multiply Unsigned
Divide
Divide Unsigned
Move From High/Remainder
Move From Low/Quotient
Load Immediate And Skip
Load Word
Store Word
Set Less Than
Set Less Than Unsigned
Branch On Equal
Branch On Not Equal
Jump Register
Jump And Link Register
Add Immediate
Jump
Jump And Link

.word i
add $d, $s, $t
sub $d, $s, $t
mult $s, $t
multu $s, $t
div $s, $t
divu $s, $t
mfhi $d
mflo $d
lis $d
lw $t, i($s)
sw $t, i($s)
slt $d, $s, $t
sltu $d, $s, $t
beq $s, $t, i
bne $s, $t, i
jr $s
jalr $s
addi $t, $s, i
ji
jal i

Instructions
iiii iiii
0000 00ss
0000 00ss
0000 00ss
0000 00ss
0000 00ss
0000 00ss
0000 0000
0000 0000
0000 0000
1000 11ss
1010 11ss
0000 00ss
0000 00ss
0001 00ss
0001 01ss
0000 00ss
0000 00ss
0010 00ss
0000 10ii
0000 11ii

iiii
ssst
ssst
ssst
ssst
ssst
ssst
0000
0000
0000
ssst
ssst
ssst
ssst
ssst
ssst
sss0
sss0
ssst
iiii
iiii

iiii
tttt
tttt
tttt
tttt
tttt
tttt
0000
0000
0000
tttt
tttt
tttt
tttt
tttt
tttt
0000
0000
tttt
iiii
iiii

iiii
dddd
dddd
0000
0000
0000
0000
dddd
dddd
dddd
iiii
iiii
dddd
dddd
iiii
iiii
0000
0000
iiii
iiii
iiii

iiii
d000
d000
0000
0000
0000
0000
d000
d000
d000
iiii
iiii
d000
d000
iiii
iiii
0000
0000
iiii
iiii
iiii

iiii
0010
0010
0001
0001
0001
0001
0001
0001
0001
iiii
iiii
0010
0010
iiii
iiii
0000
0000
iiii
iiii
iiii

iiii
0000
0010
1000
1001
1010
1011
0000
0010
0100
iiii
iiii
1010
1011
iiii
iiii
1000
1001
iiii
iiii
iiii

R
I

s, t, d are interpreted as unsigned


i is interpreted as twos complement

R
R
R
R
R
R
R
R
R
I
I
R
R
I
I
R
R
I
J
J

$d = $s + $t
$d = $s - $t
hi:lo = $s * $t
hi:lo = $s * $t
lo = $s / $t; hi = $s % $t
lo = $s / $t; hi = $s % $t
$d = hi
$d = lo
$d = MEM[pc]; pc = pc + 4
$t = MEM [$s + i]:4
MEM [$s + i]:4 = $t
$d = 1 if $s < $t; 0 otherwise
$d = 1 if $s < $t; 0 otherwise
if ($s == $t) pc += i * 4
if ($s != $t) pc += i * 4
pc = $s
temp = $s; $31 = pc; pc = temp
$t = $s + i
pc = high4(pc).(i<<2)
$31 = pc; pc = high4(pc).(i<<2)

When a word is stored to memory location 0xffff000c, the least-significant byte (eight bits) of the word are sent to the standard output.
Loading a word from memory location 0xffff0004 places the next byte from standard input into the least-significant byte of the destination register.

You might also like