Write a assembly language subroutine, Assembly Language

Write a M68000 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 follows:

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 evaluating the expression Sum * A[i] you are NOT allowed to use the MULTU, or MULTS instructions, hence, you are to find another way to calculate this expression.

Main program along with data section is shown below. This program passes all the required parameters to subroutine MULSUM by pushing them on stack.

Note: There is no overflow occurring during any operation.

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.

Posted Date: 4/1/2013 1:27:20 AM | Location : United States







Related Discussions:- Write a assembly language subroutine, Assignment Help, Ask Question on Write a assembly language subroutine, Get Answer, Expert's Help, Write a assembly language subroutine Discussions

Write discussion on Write a assembly language subroutine
Your posts are moderated
Related Questions
need some project ideas

ORG : Origin:- The ORG directive directs the assembler to begin the memory allotment for the specific segment, code or block from the declared  address in the ORG  statement. W

Using the AddSub program from Ch3 under c:\Masm615\examples as a reference, write a program that subtracts three 16-bit integers using only registers. Insert a call DumpRegs statem

Cache Memory Caching is a technology based on the memory subsystem of any computer. The majoraim of a cache is to accelerate the computer while keeping the cost of the computer

Write a M68000 assembly language subroutine MULSUM that takes an array named A containing n bytes of positive numbers, and fills two arrays, array B containing n

program to find negative and positive integers from given signed numbers with output and explanation of every instructions.

SUB: Subtract :- The subtract instruction subtracts the source operand from destination operand and result is left in the destination operand. Source operand might be memory locati

SBB: Subtract  with Borrow  :- The subtract with borrow instruction subtracts the source operand and the borrow flag (CF) which might reflect the result of the past calculations,

give the explaination of timing diagram minimum mode memory write cycle

code to add two matrices