Using mars write assembly code for risc that computes


#    Using MARS, write Assembly code (for RISC) that computes average of list of mideterm test scores in #  freshman ENGR121 class and return in $v0.  
#    The list consists of scores from 0 through 100 and is terminated with -1.
#    Ignore all other values < 0 and > 100.  
#
#    sum = count = 0;
#    while ( *score != -1) do {
#        sum += *score;
#        count += 1;
#        score += 4;
#    }  
#    average = sum / count;
#
# Inputs :
#    $a0 - address of list of scores
# Outputs:
#    $v0 - returns the average of the test scores or -1.
# Locals:
#    $t0 = score counter
#    $t1 = score sum
#    $t2 = temp for score
#    $t3 = temp
#    $t4 = holds terminator marker, -1
#
# scores:   .word    95, 92, 85, 100, 81, 151, 90, 75, -85, 99, 82, 79, -1

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: Using mars write assembly code for risc that computes
Reference No:- TGS0646145

Expected delivery within 24 Hours