How could you compute 4× $8 + $8
?
Multiply $8 by four by shifting left two positions, then add it the original $8
Here is the program. Unfortunately, there are a few blanks. This would be a good time to use that scratch pad and pencil next to your keyboard.
## slowMult.asm ## ## Program to calculate 5 × x - 74 ## ## Register Use: ## $8 x ## $9 result .text .globl main main: ori $8, $0, 12 # put x into $8 sll $___, $___, ___ # $___ <-- 4x addu $___, $___, $___ # $___ = 5x addiu $___, $___,-74 # $___ = 5x - 74 ## End of file