Conventions:
X means variable.
+ means or. (0+8) means 0 or 8, X000 in binary.
- means through. (0-3) means 0+1+2+3, 00XX in binary.
Code: Select all
R4000 ASM OPCODES (hex)
ADD = 0x0(0-3)(0-F)(0-F)(0-F)(0+8)20
ADDI = 0x2(0-3)(0-F)(0-F)(0-F)(0-F)(0-F)(0-F)
ADDIU = 0x2(4-7)(0-F)(0-F)(0-F)(0-F)(0-F)(0-F)
ADDU = 0x0(0-3)(0-F)(0-F)(0-F)(0+8)21
AND = 0x0(0-3)(0-F)(0-F)(0-F)(0+8)24
ANDI = 0x3(0-3)(0-F)(0-F)(0-F)(0-F)(0-F)(0-F)
BREAK = 0x0(0-3)(0-F)(0-F)(0-F)(0-F)(0+4+8+c)D
CACHE = 0xB(c-F)(0-F)(0-F)(0-F)(0-F)(0-F)(0-F)
DIV = 0x0(0-3)(0-F)(0-F)001A
DIVU = 0x0(0-3)(0-F)(0-F)001B
JUMP = 0x0(8-B)(0-F)(0-F)(0-F)(0-F)(0-F)(0-F)
JAL = 0x0(C-F)(0-F)(0-F)(0-F)(0-F)(0-F)(0-F)
JALR = 0x0(0-3)(0+2+4+6+8+A+C+E)0(0-F)(0+8)09
JR = 0x0(0-3)(0+2+4+6+8+A+C+E)00008
LB = 0x8(0-3)(0-F)(0-F)(0-F)(0-F)(0-F)(0-F)
LBU = 0x9(0-3)(0-F)(0-F)(0-F)(0-F)(0-F)(0-F)
MULT = 0x0(0-3)(0-F)(0-F)0018
MULTU = 0x0(0-3)(0-F)(0-F)0019
NOR = 0x0(0-3)(0-F)(0-F)(0-F)(0+8)27
OR = 0x0(0-3)(0-F)(0-F)(0-F)(0+8)25
ORI = 0x3(4-7)(0-F)(0-F)(0-F)(0-F)(0-F)(0-F)
SYNC = 0x0000000F
SYSCALL = 0x0(0-3)(0-F)(0-F)(0-F)(0-F)(0+4+8+C)C
XOR = 0x0(0-3)(0-F)(0-F)(0-F)(0+8)26
XORI = 0x3(8-B)(0-F)(0-F)(0-F)(0-F)(0-F)(0-F)
Does not address coprocessor, double, half, traps, etc. Just the basics.
R4000 manual