Question: Write a MIPS assembly program to initialize an array that has five elements by storing register $s0 in the first element of the array, register
Write a MIPS assembly program to initialize an array that has five elements by storing register $s0 in the first element of the array, register $s1 in the second element, register $s2 in the third element, register $s3 in the fourth element, and register $s4 in the fifth element. Assume $s0=10, $s1=16, $s2=17 , $s3=$13, and $s4= 14. Use a loop to calculate the sum of all elements in the array, then write the result as the sixth element of the array. Use another loop to calculate the sum of all elements that are smaller than 15 and sum of the elements that are greater than 12.
Finally, display the results. Please explain each instruction with a comment. Please submit your source code and a screenshot that shows the sum of all elements that are smaller than 15 and sum of the elements that are greater than 12.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
