R3000 instruction set
Contents
- 1 Intro
- 2 Instructions
- 2.1 add
- 2.2 addu
- 2.3 sub
- 2.4 subu
- 2.5 addi
- 2.6 addiu
- 2.7 mult
- 2.8 multu
- 2.9 div
- 2.10 divu
- 2.11 lw
- 2.12 lh
- 2.13 lhu
- 2.14 lb
- 2.15 lbu
- 2.16 sw
- 2.17 sh
- 2.18 sb
- 2.19 lui
- 2.20 mfhi
- 2.21 mflo
- 2.22 mfcZ
- 2.23 mtcZ
- 2.24 and
- 2.25 andi
- 2.26 or
- 2.27 ori
- 2.28 xor
- 2.29 nor
- 2.30 slt
- 2.31 slti
- 2.32 sll
- 2.33 srl
- 2.34 sra
- 2.35 sllv
- 2.36 srlv
- 2.37 srav
- 2.38 beq
- 2.39 bne
- 2.40 j
- 2.41 jr
- 2.42 jal
- 2.43 nop
Intro
Instructions
Note: This section is meant to be linked to, and used to generate tooltips (title text) for code pages.
The first paragraph of an instruction's description should be a short one-liner. It will be used as the tooltip. Think "reminder", rather than "explanation".
add
Add
Example:
add $d,$s,$t
addu
Add unsigned
Example:
addu $d,$s,$t
sub
Subtract
Example:
sub $d,$s,$t
subu
Subtract unsigned
Example:
subu $d,$s,$t
addi
Add immediate
Example:
addi $t,$s,C
addiu
Add immediate unsigned
Example:
addiu $t,$s,C
mult
Multiply
Example:
mult $s,$t
multu
Multiply unsigned
Example:
multu $s,$t
div
Divide
Example:
div $s, $t
divu
Divide unsigned
Example:
divu $s, $t
lw
Load word
Example:
lw $t,C($s)
lh
Load halfword
Example:
lh $t,C($s)
lhu
Load halfword unsigned
Example:
lhu $t,C($s)
lb
Load byte
Example:
lb $t,C($s)
lbu
Load byte unsigned
Example:
lbu $t,C($s)
sw
Store word
Example:
sw $t,C($s)
sh
Store half
Example:
sh $t,C($s)
sb
Store byte
Example:
sb $t,C($s)
lui
Load upper immediate
Example:
lui $t,C
mfhi
Move from high
Example:
mfhi $d
mflo
Move from low
Example:
mflo $d
mfcZ
Move from Control Register
Example:
mfcZ $t, $d
mtcZ
Move to Control Register
Example:
mtcZ $t, $d
and
And
Example:
and $d,$s,$t
andi
And immediate
Example:
andi $t,$s,C
or
Or
Example:
or $d,$s,$t
ori
Or immediate
Example:
ori $t,$s,C
xor
Exclusive or
Example:
xor $d,$s,$t
nor
Nor
Example:
nor $d,$s,$t
slt
Set on less than
Example:
slt $d,$s,$t
slti
Set on less than immediate
Example:
slti $t,$s,C
sll
Shift left logical immediate
Example:
sll $d,$t,shamt
srl
Shift right logical immediate
Example:
srl $d,$t,shamt
sra
Shift right arithmetic immediate
Example:
sra $d,$t,shamt
sllv
Shift left logical
Example:
sllv $d,$t,$s
srlv
Shift right logical
Example:
srlv $d,$t,$s
srav
Shift right arithmetic
Example:
srav $d,$t,$s
beq
Branch on equal
Example:
beq $s,$t,C
bne
Branch on not equal
Example:
bne $s,$t,C
j
Jump
Example:
j C
jr
Jump register
Example:
jr $s
jal
Jump and link
Example:
jal C
nop
No operation (do nothing)
Example:
nop