MIPS: Summary So Far

 


Arithmetic Instructions

Name Syntax Meaning
add add $rd, $rs, $rt $rd = $rs + $rt
addu addu $rd, $rs, $rt $rd = $rs + $rt (unsigned)
sub sub $rd, $rs, $rt $rd = $rs - $rt
subu subu $rd, $rs, $rt $rd = $rs - $rt (unsigned)
addi addi $rd, $rs, constantValue $rd = $rs + constantValue
addiu addiu $rd, $rs, constantValue $rd = $rs + constantValue (unsigned)

Logical Instructions (so far)

Name Syntax Meaning
sll (shift left logical) sll $rd, $rs, shiftAmount shift $rd by shiftAmount, put in $rd
srl (shift right logical) srl $rd, $rs, shiftAmount shift $rd by shiftAmount, put in $rd

Memory Access Instructions (so far)

Name Syntax Meaning
lw (load word) lw $rd, offset($base) load word from address ($base+offset) to $rd
sw (store word) sw $rs, offset($base) store word from $rs to address ($base+offset)

Registers (so far)

Number Name Comments
0$zero constant 0
...
8
.
.
.
15
$t0
.
.
.
$t7
temporary (not preserved across function call)
.
.
.
temporary (not preserved across function call)
16
.
.
.
23
$s0
.
.
.
$s7
saved temporary (preserved across function call)
.
.
.
saved temporary (preserved across function call)
24
25
$t8
$t9
temporary (not preserved across function call)
temporary (not preserved across function call)
...

 


Alyce Brady, Kalamazoo College