| Instruction | Operation | Notes |
| add RD, RS, RT |
RD = RS + RT; exception on overflow |
|
| addi RT, RS, IMM |
RT = RS + signed-IMM;
exception on overflow |
|
| addiu RT, RS, IMM |
RT = RS + signed-IMM |
|
| addu RD, RS, RT |
RD = RS + RT |
|
| and RD, RS, RT |
RD = RS & RT |
|
| andi RS, RT, IMM |
RT = RS & unsigned-IMM |
|
| beq RS, RT, branch-offset |
if (RS == RT) NEXTPC += (branch-offset << 2) |
|
| bgez RS, branch-offset |
if (signed-RS <= 0)
NEXTPC += (branch-offset << 2) |
|
| bgezal RS, branch-offset |
$31 = NEXTPC; if (signed-RS >= 0)
NEXTPC += (branch-offset << 2) |
|
| bgtz RS, branch-offset |
if (signed-RS > 0)
NEXTPC += (branch-offset << 2) |
|
| blez RS, branch-offset |
if (signed-RS <= 0)
NEXTPC += (branch-offset << 2) |
|
| bltz RS, branch-offset |
if (signed-RS < 0)
NEXTPC += (branch-offset << 2) |
|
| bltzal RS, branch-offset |
$31 = NEXTPC; if (signed-RS < 0
NEXTPC += (branch-offset << 2) |
|
| bne RS, RT, branch-offset |
if (RS != RT)
NEXTPC += (branch-offset << 2) |
|
| break |
breakpoint (immediate breakpoint exception)
with no delay slot |
|
| div RS, RT |
LO = signed-RS / signed-RT;
HI = signed-RS % signed-RT |
|
| divu RS, RT |
LO = unsigned-RS / unsigned-RT;
HI = unsigned-RS % unsigned-RT |
|
| j address |
NEXTPC = (NEXTPC & 0xf0000000) | (address << 2) |
|
| jal address |
$31 = NEXTPC; NEXTPC = (NEXTPC & 0xf0000000) | (address << 2) |
|
| jalr RD, RS |
RD = NEXTPC; NEXTPC = RS. RD is normally $31. |
|
| jr RS |
NEXTPC = RS |
|
| lb RT, offset(RS) |
RT = signed-8-memory[RS + offset] |
|
| lbu RT, offset(RS) |
RT = unsigned-8-memory[RS + offset] |
|
| lh RT, offset(RS) |
RT = signed-16-memory[RS + offset] |
|
| lhu RT, offset(RS) |
RT = unsigned-16-memory[RS + offset] |
|
| lui RT, IMM |
RT = unsigned-IMM << 16 |
|
| lw RT, offset(RS) |
RT = 32-memory[RS + offset] |
|
| lwl RT, offset(RS) |
RT = unaligned-32-memory[RS + offset] |
1 |
| lwr RT, offset(RS) |
RT = unaligned-32-memory[RS + offset] |
1 |
| mfc0 RT, C0_REG |
RT = C0_REG |
|
| mfhi RD |
RD = HI |
|
| mflo RD |
RD = LO |
|
| mtc0 RT, C0_REG |
C0_REG = RT |
|
| mthi RS |
HI = RS |
|
| mtlo RS |
LO = RS |
|
| mult RS, RT |
HI:LO = signed-RS * signed-RT |
|
| multu RS, RT |
HI:LO = unsigned-RS * unsigned-RT |
|
| nor RD, RS, RT |
RD = ~(RS | RT) |
|
| or RD, RS, RT |
RD = RS | RT |
|
| ori RT, RS, IMM |
T = RS | unsigned-IMM |
|
| rfe |
return from exception |
2 |
| sb RT, offset(RS) |
8-memory[RS + offset] = RT |
|
| sh RT, offset(RS) |
16-memory[RS + offset] = RT |
|
| sll RD, RT, IMM |
RD = RT << unsigned-IMM |
|
| sllv RD, RT, RS |
RD = RT << RS |
|
| slt RD, RS, RT |
RD = signed-RS < signed-RT |
|
| slti RT, RS, IMM |
RT = signed-RS < signed-IMM |
|
| sltiu RT, RS, IMM |
RT = unsigned-RS < unsigned-signed-IMM
Yes, according to my reference it actually takes the 16-bit immediate,
sign-extends it, and then reinterprets it as an unsigned value. Don't
ask me.
|
4 |
| sltu RD, RS, RT |
RD = unsigned-RS < unsigned-RT |
|
| sra RD, RT, IMM |
RD = signed-RT >> unsigned-IMM |
|
| srav RD, RT, RS |
RD = signed- RT >> RS |
|
| srl RD, RT, IMM |
RD = unsigned-RT >> unsigned-IMM |
|
| srlv RD, RT, RS |
RD = unsigned-RT >> RS |
|
| sub RD, RS, RT |
RD = RS - RT; exception on overflow |
|
| subu RD, RS, RT |
RD = RS - RT |
|
| sw RT, offset(RS) |
32-memory[RS + offset] = RT |
|
| swl RT, offset(RS) |
unaligned-32-memory[RS + offset] = RT |
1 |
| swr RT, offset(RS) |
unaligned-32-memory[RS + offset] = RT |
1 |
| syscall |
make system call; immediate syscall exception
with no delay slot |
|
| tlbp |
probe tlb: search TLB for entry matching c0_entryhi; set probe-failed bit
and index field in c0_index. |
3 |
| tlbr |
read tlb entry: load the TLB entry named by the index field of c0_index
into c0_entryhi and c0_entrylo. |
3 |
| tlbwi |
write tlb entry indexed: store c0_entryhi and c0_entrylo into the TLB
entry named by the index field of c0_index. |
3 |
| tlbwr |
write tlb entry "random": store c0_entryhi and c0_entrylo into the TLB
entry named by the index field of c0_random. |
3 |
| xor RD, RS, RT |
RD = RS ^ RT |
|
| xori RT, RS, IMM |
RD = RS ^ unsigned-IMM |
|