bold ones are important
Name | OP Code | Funct | Instruction | C equivalent |
---|---|---|---|---|
add | 0 | 32 | add $rd, $rs, $rt | a = b + c |
sub | 0 | 34 | sub $rd, $rs, $rt | a = b - c |
and | 0 | 36 | and $rd, $rs, $rt | a = b & c |
or | 0 | 37 | or $rd, $rs, $rt | a = b | c |
xor | 0 | 38 | xor $rd, $rs, $rt | a = b ^ c |
nor | 0 | 39 | nor $rd, $rs, $rt | a = !(b | c) |
slt | 0 | 42 | slt $rd, $rs, $rt | a = (b < c) |
Z is a constant
Name | OP Code | Instruction | C equivalent |
---|---|---|---|
sll | 0 | sll $rd, $rt, const | a = b << Z |
srl | 2 | srl $rd, $rt, const | a = b >> Z |
beq | 4 | beq $rs, $rt, imm | if(a==b) |
bne | 5 | bne $rs, $rt, imm | if(a!=b) |
addi | 8 | addi $rt, $rs, imm | a = b + Z |
slti | 10 | slti $rt, $rs, imm | a = b < Z |
andi | 12 | andi $rt, $rs, imm | a = b & Z |
ori | 13 | ori $rt, $rs, imm | a = b | Z |
xori | 14 | xori $rt, $rs, imm | a = b ^ Z |
lw | 35 | lw $rt, imm($rs) | a = b[Z] |
sw | 43 | sw $rt, imm($rs) | b[Z] = a |
Name | OP Code | Instruction | C equivalent |
---|---|---|---|
j | 2 | j label | goto label |
More Here: https://inst.eecs.berkeley.edu/~cs61c/resources/MIPS_help.html