Question: Write and debug a MIPS program that performs the following operations: Prompt for and input three integers a, b, c using syscall s Display one

Write and debug a MIPS program that performs the following operations:

Prompt for and input three integers a, b, c using syscalls

Display one of the following statements depending on if a+b>c, or a+b=c or a+b

- You entered a+b greater than c

- You entered a+b equal to c

- You entered a+b less than c

Compute 1. 7*(a+b)+c

2. (c-2)*(a+b)+1

3. (a+b)*(c-2)*(b+5) and display the result of each computation. Be careful with operator precedence. Return to the operating system.

Your runs output must look exactly in format like the sample below. (If only close, but not exact, will result in lost points.). Note that only the output result will vary depending on the input numbers. Adjust your code until your output exactly matches (including horizontal and vertical spacing). You can use \" to put a double quote inside a text string. The values shown in bold here (not in your console window) are user inputs for this run.

What is integer "a"? 3

What is integer "b"? 4

What is integer "c"? 20

 You entered a+b less than c 
 7*(a+b)+c is 69 (c-2)*(a+b)+1 is 127 (a+b)*(c-2)*(b+5) is 1134 

1. You will need to use .text and .data directives to define program and data areas in SPIM.

2. A colon (:) must follow all labels. Note that labels allow easy reference to a specific address/place in the program or

an argument that is required.

3. Each data entry must be uniquely labeled to avoid any potential error.

4. The word "main:" must label the first line in a SPIM program and always be made global.

5. You may write only one instruction to a line (once past the instruction, you may add a comment, simply preceding with

a # sign).

6. All characters in a string are represented in ASCII code.

7. Use comments (#) to adequately write the logic of the program. Note comments do not wrap. If a comment takes

more than one line, start a new line with # and continue your comment.

8. A "syscall 10" to return control to OS. For example, li $v0, 10

syscall

9. For better readability well format your code:

use distinct columns for labels, opcode, operands and comments

IF POSSIBLE CAN U PUT A SCREENT SHOT OF THE CODING WORK AND THE RESULT

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!