R-type
Assembly Language
Format: [instruct] [rd] [rs1] [rs2]
- [instruct] name of the instructions
- [rd] destination register
- [rs1], [rs2] source registers
- e.g.,
add $t0 $t1 $t2 : add $t1, $t2 → store in $t0
Machine Language

- op (operation code):
- indicate the type of an instruction;
- e.g., R-type instructions have opcode 000000
- rs, rt, rd:
- Indicate which registers;
- Use 5-bits because we have 32 general-purpose registers.
- shamt: used in shift instruction; how many positions (bits) to shift
- funct: indicate which instruction; e.g., 100000 -> add