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;
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
Physical Memory Mapped I/O and Port I/O : CPU controlled I/O comes in 2 ways. Simply the difference is whether we utilize the normal memory addresses for I/O, this is mention

Write the structure of For…Next loop in VB.Net and also write a program to print integers from 1 to 10 on the console.

DQ:   Define  Quad word:-  This directive is taken in use to direct the assembler to reserve 4 words (8 bytes) of memory for the specified variable and can initialise it having

Power Pc : A Power PC is a microprocessor designed to meet a standard, which was combining designed by Motorola, Apple and IBM. The PowerPC standard specifies a common instruc

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,

DEC : A powerful new Alpha 64 bit RISC computer chip was introduced in the year 1977, as new VAX (Virtual Address Extension) Computer. The VAX was 32 bit computer line based on


Problems: 1. Write a single program. Each of the problems (2-4) should be written within a procedure. Your “main” procedure should call each procedure. Before calling each proc

move a byte string ,16 bytes long from the offset 0200H to 0300H in the segment 7000H

hi, i''m new to assembly language and my teacher told us to look for an example of the odd and even numbers program using debug.exe in ms dos as a guide since we just started. plea