All procedures submitted on any homework or project assignment should be thoroughly tested on the computer so they work for all reasonable inputs. (For example, if a procedure is written to compute n factorial, it should work for non-negative integers.) If a procedure fails to work, you should state how it fails. You will be graded more severely for unreported bugs. Every procedure should be printed, not handwritten.
tmp at our disposal, we can start by
eliminating sne, since
sne s, a, bb can be replaced by the sequence of instructions:
seq s, a, b li tmp, 1 sub s, tmp, sor with the sequence of instructions:
sub, s, a, b li tmp, done-label jeqz s, tmp li s, 1 done-label:
Remember, that the instruction you are replacing
could appear anywhere in a larger program, so (for example) your
proposed replacement should not halt. (It's always best
if you can avoid using an an auxiliary register such as tmp.)