Abstract


+--------+-----+-------+-----------------+
| Opcode |  Rs  |  Rt  |    Immediate    |
| 6 bits |5 bits|5 bits|     16 bits     |
+--------+-----+-------+-----------------+
  • Opcode is used to uniquely specify an Instruction

  • rs specifies register containing first operand

  • rt specifies register to receive result

  • immediate: see Immediate Value for more info

  • I because it is Instruction that contains immediate value

  • Meaning: Add the Source Register with the Immediate Value, and store the result to the Target Register

4 types of instructions

  1. arith $rt, $rs, 16_2s
  2. lw/sw $rt, 16_2s($rs)
  3. logic $rt, $rs, 16
  4. branch $rs, $rt, label, label in branch instruction refers to the number of instructions from the next instruction address.

slti

  • Set Less Than Immediate
  • If value in Source Register is smaller than Immediate Value, then Target Register is set to 1 else 0
  • The mips code - slti $t0, $t0, 100
  • The equivalent more high-level code - R[rt] = (R[rs]<SignExtImm) ? 1 : 0

Immediate Value