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
For example, if the user enters then then the program would print the following lines:
The sum is
The number of integers entered was
Assume that there will be no invalid input. Your program will crash if you enter nonintegers, but dont worry about that.
To hand in through eLearning: A Zip file named CSAsgzip containing your program, named CSasgasm and possibly SysCalls.asm. Replace with your netID. For example, if I were to hand it in the name would be CSAsgjxczip.
Additional grading criteria:
Your program is not named properly or does not have asm as the file extension:
Your program does not have your name, NetID, and other header information, and is in general not properly commented: to
Incorrect output: to depending upon severity
Improperly formatted code: to depending upon severity.
Does not exit properly.
Misuse of instructions, for example using la when you should use li to
Doesnt assemble:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
