In question iv.
Does my first instruction successfully negate the register i? Does my second instruction complete the problem?
In question iv.
Does my first instruction successfully negate the register i? Does my second instruction complete the problem?
Yes, that works!
The use of $t2 is unnecessary in this instruction sequence, as the first instruction can simply put the result directly back in $t0, since $t0 is going to be updated anyway, and you need only -i after that point, but no longer need the original value of i itself.
Generally, it is good to reduce the number of registers used for small code sequences like this, since there are larger contexts in which we can run out of registers.
To me it would have been more natural to do:
li $t2, 1
sub $t0, $t2, $t0
Of course, that does require a 2nd register (no way to eliminate it), so to one measure, your code sequence (modified to use $t0 only) is more optimal.