Answered step by step
Verified Expert Solution
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 $a register and must return the part in $v integer of the average and in $v 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, must be returned in $v and $v
A main function must be included that tests the average function with at least 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 pseudoinstructions, except lap
The main function only contains variable initialization and calls to other functions p
Functions correctly use the convention established in class for registers p
It uses the stack and handles it correctly p
The program has comments p
The program is correctly set dentedp
Shows the arrays that are requested to test the p program
Correctly calculate the error of the sums p
The program works correctly p
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started