Question: using mips assembly on mars. we have to you the stack $sp, can someone help me I dont quite understand how to use the stack

using mips assembly on mars. we have to you the stack $sp, can someone help me I dont quite understand how to use the stack $sp

Create a program that will continuously take in numbers from the user until the user enters 0, and will then output all of the numbers that were entered, in order.

For example, the program output might look something like the following:

Please enter numbers, press (0) to exit:

393

21

5

120

456

3

22

0

Your numbers were:

393

21

5

120

456

3

Hints:

It might be a good idea to store the number of places $sp is from where it started so you know where to start and finish outputting numbers

You arent allowed to load a word using a register offset by another register; however, you can add those two registers together beforehand and then load the sum instead. For instance:

addu $t2, $t2, $sp # $t2 holds our offset

lw $a0, ($t2)

22

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!