| Arithmetic: R-type | ||||||||||
| 000000 | 01000 | 01001 | 01010 | 00000 | 100000 | |||||
| b31-26 | b25-21 | b20-16 | b15-11 | b10-6 | b5-0 | |||||
| opcode | $rs | $rt | $rd | shamt | function | |||||
| add, sub | ||||||||||
| add $rd, $rs, $rt # R[d] <- R[s] + R[t] | ||||||||||
| sub $rd, $rs, $rt # R[d] <- R[s] - R[t] | ||||||||||
| R-type: 3 registers | ||||||||||
| add or subtract 2C values | ||||||||||
| note that there is nothing to indicate whether the registers used | ||||||||||
| actually contain values of the proper type | ||||||||||
| unlike high-level languages, there is no type; | ||||||||||
| the bitstrings are simply used as 2C | ||||||||||
| opcode: 0 | ||||||||||
| function | add: 32 | |||||||||
| sub: 34 | ||||||||||
| addu, subu | ||||||||||
| Unsigned add or subtract | ||||||||||
| Ignore overflow | ||||||||||
| opcode: 0 | ||||||||||
| function | add: 33 | |||||||||
| sub: 35 | ||||||||||