Peer Review
- Part 1 and 2 are not done.
- The code does not give correct output.
One problem is that your not saving
$a0
and$a1
before advancing them for the recursive call. Because$a0
and$a1
are caller-saved registers. That means when you call decode recursively, the recursive call can overwrite$a0
and$a1
. So save the original$a0
and$a1
on the stack before recursion, then restore after.
Edited by Hudeyfi Elmi