Question: Write a MIPS assembly language program to solve the following problem. For a set of integers stored in an array, calculate the sum of the

Write a MIPS assembly language program to solve the following problem.

For a set of integers stored in an array, calculate the sum of the positive numbers and the sum of the negative numbers. The program should store both sums in memory variables: posSum and negSum. 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 "sentinel" value).

For examle, if your array has the values: 1010 -510 -3010 1510 2010 -110 -2610 -1810 010, then you program should update the posSum and negSum variables to 4510 and -8010, respectively.

For example, your .data section for the array values: 1010 -510 -3010 1510 2010 -110 -2610 -1810 010, will be:

Write a MIPS assembly language program to solve the following problem. For

Before you start writing MIPS assembly language, write a high-level language algorithm. THEN, translate it to MIPS assembly language. You can download the MIPS simulator at: http://sourceforge.net/projects/spimsimulator/files/ Select the latest version of QtSpim for either Windows, MAC or Linux.

.data .word 10,-5, -30,15, 20,-1,-26,-18,0 array: posSum: negSum: word 0 word o .text globl main # MIPS Assembly language program here main: # system call to exit the program li $v0, 10 syscall

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!