Question: Write a MIPS assembly language program that repeatedly prompts the user for a ZIP code, calculates the sum of all digits then prints out the

Write a MIPS assembly language program that repeatedly prompts the user for a ZIP code, calculates the sum of all digits then prints out the result. If the input is 0 then the program stops. The sum calculation part must be written in 2 versions: recursive and non-recursive and the results are stored in two memory locations A and B, respectively. The output should be something that shows both calculations:

The sum of all digits using the recursive function is xxxxxx, using the non-recursive function is yyyyy. xxxxxx is taken from memory location A and yyyyy is from memory location B. Obviously, both numbers must be the same.

No input validation is needed.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!