
R-Format Coding |
Load Coding Example |
The immediate operations are fairly straight-forward. Consider:
addi $t5, $15, 40
- Look up the values of the registers:
$t5 is 13 = 011012, but $15 is just plain 15, or 01111.
- Convert the immediate value
to binary: 40 = 1010002.
- Look up the instruction to find its type and format.
(You'll find it on p. A-55.)
Plug the numbers into the format,
being careful to get the registers in the right places,
and pad the immediate to 16 bits:
| 001000 | 01111 | 01101 | 0000000000101000 | |
- Regroup the bits.
| 0010 | 0001 | 1110 | 1101 | 0000 | 0000 | 0010 | 1000 | |
- Represent as a hex number: 21ED0028
R-Format Coding |
Load Coding Example |