Question: Write a program in MIPS assembly language using the MARS Simulator that does the following: Display a prompt to the user: Enter an integer: Wait

Write a program in MIPS assembly language using the MARS Simulator that does the following:
Display a prompt to the user: Enter an integer:
Wait for the user to enter an integer.
If the number entered is zero
Print The sum is: followed by the sum of all of the integers entered.
On a new line print The number of integers entered was: followed by the number. This number should not include the final zero.
Exit the program
Add the number to a running sum.
Increment the count of integers.
Loop back to step 1.
For example, if the user enters 4, then 6, then 0, the program would print the following 2 lines:
The sum is 10
The number of integers entered was 2
Assume that there will be no invalid input. Your program will crash if you enter non-integers, but dont worry about that.
To hand in through eLearning: A Zip file named CS2340-Asg1-.zip containing your program, named CS2340-asg1.asm and possibly SysCalls.asm. Replace with your netID. For example, if I were to hand it in, the name would be CS2340-Asg1-jxc064000.zip.
Additional grading criteria:
Your program is not named properly or does not have .asm as the file extension: -5
Your program does not have your name, NetID, and other header information, and is in general not properly commented: -5 to -15
Incorrect output: -5 to -55 depending upon severity
Improperly formatted code: -3 to -10 depending upon severity.
Does not exit properly. -5
Misuse of instructions, for example using la when you should use li.-2 to -10
Doesnt assemble: -50

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 Programming Questions!