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
Assume that the registers are initialized to EAX=12345h,EBX =9528h ECX=1275h,EDX=3001h sub AH,AH sub DH,DH mov DL,AL mov CL,3 shl DX,CL shl AX,1 add DX,AX

to find the matrix addition


The modes are determined by the contents of the control register, whose format is given in Figure These modes are: Mode 0: If a group is in mode 0, it is divided into 2 sets.

The Intel Processors :         The Intel Corporation is the biggest manufacturer  of microchips  in the world,  in addition  to being  the leading provider of chips for PCs. I

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

This is a short program to practice assembly language loops and if/else statements. You will use various jump commands and the cmp instruction. The program will generate a random

Write a program that will input a number from the keyboard, and then display the number in binary form, as well as the number of one's in the number. Hint: Shift the value left (or


Display control 8279  provides  a  16  byte  display  memory  and  refresh  logic.  Every address in the display memory corresponds to a display unit with address zero represen