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
DMA DMA stands for Direct Memory Access It is uses same Address/Data lines on ISA bus It controls the ISA bus instead of the processor ("bus master") Floppy

SHL/SAL : Shift logical/Arithmetic Left: These instructions shift the operand byte or word bit by bit to the left and insert 0 in the newly introduced least significant bits. In c

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?

take an integer and its base and the base in which you want to convert the number from user and perform conversion.

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

Flag Manipulation and Processor Control Instructions These instructions control the functioning of available hardware inside the processor chip. These are categorized into thes

Type of Microprocessor : Microprocessors fall into 3 categories: Single Chip Microcomputers: - Contains RWM, ROM, microprocessor, I/O port, timer and clock. General pu

Declare 1 constant. This can be done just below the prototype section. Put the following divider above the constant section. ;************************ Constants ****************

how to add 111 and 333 in assembly language

Hold Response Sequence The HOLD pin is examined at leading edge of each clock pulse. If it is received active line by the processor before T4 of the earlier cycle/during the T1