- Download or install "MARS" or "QtSpim".
- Copy and paste the code in recursion.s
- Run with any input!
Note: I understand the directions were listed to use the STACK to store the result which would have been an easier method than I chose. But what made sense to me was to STORE my result using .data strings. Besides this change I followed the directions to the best of my ability.
Preliminary Step: Check tabs/spaces and valid characters.
- Recursively call each character in our string; (which I will call c).
- Convert c (starting with the rightmost digit; backtrack) to its decimal representation; (which I will call d).
- If c does not need to be multiplied go to step 8. If c does:
- Multiply d by base (33).
- Store in tempAnswer (string in memory) which will be our new d.
- Check if multiply again by 33
- If yes go to step 4. If not continue:
- Add to tempAnswer to finalAnswer.
- If done multiplying, check if done with characters: If no go to step 2, if yes continue.
- Print finalAnswer.
Note: This took incredibly long to do, with a lot of planning, frustration, and time. But I will say it was a learning experience and taught me how to break a problem down into chunks. It also helped me learn efficient ways to debug a program.