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
do you have experts that know 4 digit 7_Seg dispaly

i want to develop traffic light system so which kind of software is needed to develop this project?

Multiply two numbers by using shift and rotate instruction

Write a MC68HC12 assembly language program to average ten 16-bit values that are stored starting at address $1100. Place the two-byte result at $1110. Use indexed addressing. Us

#question.flow chart for a program to find out the number of even and odd numbers from a given series of 16-bit hexadecimal numbers.

MOVSW/MOVSB : Move String Word or String Byte: Imagine a string of bytes, stored in a set  of consecutive memory locations is to be moved to another set of  the destination locati

Compute the Fibonacci sequence - assembly program: Problem: Fibonacci   In this problem you will write a program that will compute the first 20 numbers in the Fibonacci sequ

Program : Write a program to perform a one byte BCD addition. Solution : It is consider that the operands are in BCD form, but the CPU considers it as hexadecimal and acco

Write an assembly program that adds the elements in the odd indices of the following array. Use LOOP. What is the final value in the register?

Flowchart for the sequence of 8251 Whether the control, mode or sync character register is selected depends on the accessing sequence.  A flowchart of the sequencing is given i