ori $7, $0, 146 # put +146 into $7 addiu $10,$7,-82 # add -82
The program is much shorter.
subu
InstructionMIPS has two integer subtraction instructions:
subu d,s,t # $d <-- s - t . No overflow trap. # This is equivalent to $d <-- s + (-t) # where (-t) is reflect-add-one of t.
sub d,s,t # $d <-- s - t . Trap overflow! # This is equivalent to $d <-- s + (-t) # where (-t) is reflect-add-one of t.