Question: In this class, we will be using a MIPS simulator tool called MARS. You will need this tool to do programming assignments throughout the course.
- In this class, we will be using a MIPS simulator tool called MARS. You will need this tool to do programming assignments throughout the course. The tool can be downloaded here, and a walkthrough can be found in Canvas.
- If you check in section 7.2, Appendix A in zybooks, you will see that system calls are often used to prompt the user for input and print different results. A printing syscall will look something like the code below. Note that the two different sections .data and .text
.data
str:
.asciiz Example"
.text
li $v0, 4 # System call code for print str
la $a0, str # address of string to print
syscall # print the string
- (10 Points) Create a small program that will prompt the user (with a dialog) for an integer, then a second integer. The program should then output the sum of the two numbers. Please cut/paste your code into your homework for this week. An output should look something like this:
Enter an integer: 25
Enter a second integer: 20
The sum is: 45
-- program is finished running --
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
