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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started