Question: In part 5 you must make an assembly program (start with Template-AddArray.s ) to add the contents of two Arrays (element by element) and print

In part 5 you must make an assembly program (start with Template-AddArray.s ) to add the contents of two Arrays (element by element) and print out each index and total value on a separate line. Example: The index is: x with value. Name your new file Lastname-AddArrays.s Make sure you comment your code so I (and more so you) understand what you are doing. For printing each element, use the jal command to jump to a section of the code for printing each line (dont worry about saving specific registers for the call just use any current registers for the reading the appropriate values). Your program should be similar to the following C-code

i=0;

while(i

{

A[i] = A[i] + B[i];

i++;

}

construct the loop via slt and a conditional branch. Assume you only have 5 elements and that your arrays holds the following C-equivalent.

int A[] = 2, 4, 6, 8, 10;

int B[] = 2, 3, 5, 7, 11;

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!