Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help solve. Please add comments. Thanks. MIPS Assembly 1 Write and debug a MIPS program that performs the following operations: Prompt for and input

Please help solve. Please add comments. Thanks.

MIPS Assembly 1

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+c)+c

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

3. (a+c)*(c-4)*(b+5)

and display the result of each computation. Be careful with operator precedence. Return to the operating system.

Notice that several of the terms are reused in the three computations. Part of your grade will be based on how you reuse precomputed terms in your code to make it efficient.

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

Submission (20 points):

Submit ONLY the following to D2L before the deadline:

a. Assembly Source code. (filename format: firstnameLastname.s

a. PDF document containing screen shots of output of your program with three different data inputs pasted in a word

file. (filename format: firstnameLastname.pdf).

Formatting Information (See the code in practice lab 01 as an example)

Read the following information/instructions before you start.

Comment your code explain the logic of your code. Initial comments in your code must include:

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

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.

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

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

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

a # sign).

Read the resources posted on D2L for a full list of directives and instruction set.

All characters in a string are represented in ASCII code.

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.

A "syscall 10" to return control to OS. For example,

li $v0, 10

syscall

For better readability well format your code: o use distinct columns for labels, opcode, operands and comments (see the format in the example below).

Always read the assignment specification, where most hints to write the code is provided.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Next Generation Databases NoSQLand Big Data

Authors: Guy Harrison

1st Edition

1484213300, 978-1484213308

More Books

Students also viewed these Databases questions

Question

7. What is coaching? Is there only one type of coaching? Explain.

Answered: 1 week ago