Write a MIPS Assembly program that inputs numbers until a sentinel of 0 is entered.--do not save the entered numbers output the sum of all the even numbers the sum of all the odd numbershow many even...

1 answer below »
Write a MIPS Assembly program that inputs numbers until a sentinel of 0 is entered.--do not save the entered numbers
output the sum of all the even numbers the sum of all the odd numbershow many even numbers were enteredhow many odd numbers were enteredoutput if there were more even or odd numbers, or the same amountoutput the average of all the numbers entered. The average is to be output as quotient and remainder. However if you output the average to 3 decimal places you will receive extra credit.
Use only instructions we've done in class (ex: add, addi, sub, mult, mul, div, li, la, syscall, all forms of branch, move). no floating point instructions or functions allowed if you use an incorrect name, or instructions we haven't done as of today, it will not be graded. be sure to comment


P:SPlease make sure it is in MIPS AssemblyImage attached for more details.
Answered Same DayApr 22, 2021

Answer To: Write a MIPS Assembly program that inputs numbers until a sentinel of 0 is entered.--do not save the...

Sandeep Kumar answered on Apr 23 2021
151 Votes
#$n - used to hold the nuumber
#$t1- used to store the sum of even numbers
#$t2- used to store the
sum of odd numbers
#$t3- used to store the number of even numbers
#$t4- used to store the number of odd numbers
#$v0=- syscall paramter and return value
#$a0- syscall parameter
.data
prompt1: .asciiz "The sum of even numbers is: " //String requried while displaying sum of even numbers
prompt2: .asciiz "The sum of odd numbers is: " //String required while displaying sum of odd numbers
main:
##Get the number from user, put into $n
li $v0,...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here