Search code examples
mipsmips32

What is stored in the shift amount field of R type instructions


An R-type instruction has the format: opcode rs rt rd shamt func.

For example, I have an R-type instruction sll $s0,$so,2, what is stored in shamt (shift amount) field of the above format?


Solution

  • Shamt stands for shift amount which will contain the number by which you want you shift, in this case 2, so the shamt will be 2 in binary: 00010