Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Develop in detail the following problem for MARS assembler instructions It is mandatory that the code contains comments that explain the reason for what was

Develop in detail the following problem for MARS assembler
instructions
It is mandatory that the code contains comments that explain the reason for what was done.
The main function should only contain calls to other functions and not large blocks of code.
You should not use floating point instructions.
Arithmetic
Write a function that calculates the arithmetic mean (average) of an Array of words, this array contains only positive numbers, a negative number indicates that the end of the Array has been reached. This function must receive the address of the Array through the $a0 register and must return the part in $v0 integer of the average and in $v1 the remainder of the same. The function must only use instructions that do not generate exceptions, however, it must be checked that the result of the sums is correct. In case it is detected that the average cannot be calculated due to
If the result of the sums does not fit, -1 must be returned in $v0 and $v1.
A main function must be included that tests the average function with at least 3 Arrays, at least of these one should raise a carry error. The main function should print each Array and the average result, If the average cannot be calculated, you must indicate so.
Rubric
Use only instructions, not pseudo-instructions, except "la"5p
The main function only contains variable initialization and calls to other functions 5p
Functions correctly use the convention established in class for registers 10p
It uses the stack and handles it correctly 5p
The program has comments 5p
The program is correctly set (dented")5p
Shows the 3 arrays that are requested to test the 10p program
Correctly calculate the error of the sums 5p
The program works correctly 50p

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_2

Step: 3

blur-text-image_3

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

Database In Depth Relational Theory For Practitioners

Authors: C.J. Date

1st Edition

0596100124, 978-0596100124

More Books

Students also viewed these Databases questions

Question

e. What do you know about your ethnic background?

Answered: 1 week ago

Question

5. Identify three characteristics of the dialectical approach.

Answered: 1 week ago