Question: Write a MIPS assembly language program to solve the following problem. For a set of integers stored in an array, determine the largest and smallest

Write a MIPS assembly language program to solve the following problem. For a set of integers stored in an array, determine the largest and smallest numbers. The program should store both numbers in memory variables: largestNumber and smallestNumber. Numbers should be read from the array one at a time with a zero value (0) being used to signal the end of data (the zero value is acting as a "sentine" value). For examle, if your array has the values: 10o -5 -30m 1 2010 -2610 -180 Oo, then you program should update the largest Number and smallestNumber variables to 20m and -30o, respectively For example, your .data section for the array values: 10o -5e -30m 15o 20,110 -26 -18 Os will be: data array: largest Number smallest Number: word 10, -5, -30, 15, 20, -1, -26, -18, 0 .word0 word 0 .text .globl main main: # MIPS Assembly language program here # system call to exit the program l $v0, 10 syscall Before you start writing MIPS assembly language, write a high-level language altm. THEN, translate it to MIPS assembly language
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
