Abstract
+--------+------+------+------+------+------+
| Opcode | Rs | Rt | Rd | Shamt| Funct|
| 6 bits |5 bits|5 bits|5 bits|5 bits|6 bits|
+--------+------+------+------+------+------+
- Opcode is always
000000
funct
combined with opcode exactly specifies the instructionrs
specifies register containing first operandrt
specifies register containing second operand. Set to0
for shift instructionsrd
specifies register which will receive result of computationshamt
forsll
andsrl
. Set to0
for non-shift instructions
2 types of instructions
arith $rd, $rs, $rt
shift $rd, $rt, shamt
Important
R format instructions has only registers as Instruction Operand except the shift instructions.
Function Code
- 6 bits
- Give MIPS (2^6-1) + 2^6 = 127 instead of 2^6=64 Instruction
- Dedicated for MIPS R-Type Instruction
Examples
srl
- Shift Right Logical
- Source Register is 0
- Shifts the value right by n bits, discarding the lower n bits
- Dividing the value in register
$s0
by 16 (2^4) -srl $s0, $s0, 4
Terminologies
Destination Register
- 5bits
- Labeled
rd
, mapped toWR
- Register that gets the result of Operation in MIPS R-Type Instruction Instruction