create a assembly language subroutine mulsum that


Create a assembly language subroutine MULSUM that takes an array named A containing n bytes of positive numbers, and fills two arrays, array B containing n words and array C containing n long words as given:

Sum = 0;

for(i = 0; i   Sum = A[i] + Sum;
   if(Sum is an EVEN number) then

         B[i] = Sum;
 else
C[i] = Sum * A[i];
 end if
end for

In computing the expression Sum * A[i] you are NOT allowed to use the MULTU, or MULTS instructions, therefore, you are to find another way to evaluate this expression. This program passes all the required parameters to subroutine MULSUM by pushing them on stack.

a) Write the main program

b) Write the subroutine MULSUM

c) Show the stack frame for entire program and clearly label SP at different stages of program.

Solution Preview :

Prepared by a verified Expert
Assembly Language: create a assembly language subroutine mulsum that
Reference No:- TGS0442217

Now Priced at $15 (50% Discount)

Recommended (95%)

Rated (4.7/5)