Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is what I have so far: .text .globl main main: li $t0, 0 li $t1, 0 li $t2, 0 li $t3, 0 li $t4,

image text in transcribed

This is what I have so far:

.text .globl main

main: li $t0, 0 li $t1, 0 li $t2, 0 li $t3, 0 li $t4, -1 la, $a0, scores

evaluate: lw $t2, 0($a0) beq $t2, $t4, compute slti $t3, $t2, 0 bne $t3, $t2, badnum slti $t3, $t2, 101 beq $t3, $zero, badnum

beq $t2, $t4, compute add $t1, $t1, $t2 addi $t0, $t0, 1 addi $a0, $a0, 4 j evaluate

badnum: addi $a0, $a0, 4 j evaluate

compute: li $a1, 4 la $a0, avgStr syscall

div $t1, $t0 mflo $a1 move $a0, $a1 li $a1, 1 syscall

.data scores: .word 145, 101, 97, 92, 84, 100, 89, 90, 66, 78, 94, -124, 82, 79, -4, 55, -1 avgStr: .asciiz "The average is: " remstr: .asciiz "The remainder is: "

MIPS 1(b): # write and compile a program that will compute average of list of test scores and return in $a1, with the #remainder in Sa 2. The program should also print the average and remainder in the 1/0 window: e.g. 'The #average is' and 'with the remainder of # The list consists of numbers from 0 through 100 and is terminated with -1. However, values > 100 and = 0 && *score 100 This is the data (scores) section .data scores: .word 145, 101, 97, 92, 84, 100, 89, 90, 66, 78, 94, -124, 82, 79,-4, 55, -1 avgstr: .asciiz "The average is" remstr: .asciiz" with a remainder of" # Add meaningful comments (documentation) to your code and submit it as MIPS 1(b): # write and compile a program that will compute average of list of test scores and return in $a1, with the #remainder in Sa 2. The program should also print the average and remainder in the 1/0 window: e.g. 'The #average is' and 'with the remainder of # The list consists of numbers from 0 through 100 and is terminated with -1. However, values > 100 and = 0 && *score 100 This is the data (scores) section .data scores: .word 145, 101, 97, 92, 84, 100, 89, 90, 66, 78, 94, -124, 82, 79,-4, 55, -1 avgstr: .asciiz "The average is" remstr: .asciiz" with a remainder of" # Add meaningful comments (documentation) to your code and submit it as

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

Securing SQL Server Protecting Your Database From Attackers

Authors: Denny Cherry

1st Edition

1597496251, 978-1597496254

More Books

Students also viewed these Databases questions

Question

9-3. What are the different types of tariffs?

Answered: 1 week ago

Question

What advice would you provide to Jennifer?

Answered: 1 week ago

Question

What are the issues of concern for each of the affected parties?

Answered: 1 week ago