Write a assembly language subroutine, Assembly Language

Assignment Help:

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.


Related Discussions:- Write a assembly language subroutine

Arithmetic instruction-microprocessor , Arithmetic Instruction :           ...

Arithmetic Instruction :               These instructions are usually perform the arithmetic operations, like subtraction ,multiplication, addition, and division along with th

Estimation of a definite integral, Can any one assist me with this program....

Can any one assist me with this program. I am not efficient with assembly language and I need assistance badly. I am not asking anyone to do my work I just need help step by step

8086, Write a program to mask bits D3D2D1D0 and to set bits D5D4 and to inv...

Write a program to mask bits D3D2D1D0 and to set bits D5D4 and to invert bits D7D6 of ax register

Base convertor, take an integer and its base and the base in which you want...

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

#largest number, #write a program 8086 to find the largest number

#write a program 8086 to find the largest number

Code using hla language, You have been hired by the Elbonian government to ...

You have been hired by the Elbonian government to write an Assembly program to help its workforce determine how much their tax will be. The tax laws in Elbonian are very simple. Th

Program to average ten 16-bit values, Write a MC68HC12 assembly language pr...

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

Sub-arithmetic instruction-microprocessor, SUB: Subtract :- The subtract in...

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

PIC, LIST p=18f4550 #include org 0x0000 movlw 0x00 _________ movlw 0xFF ...

LIST p=18f4550 #include org 0x0000 movlw 0x00 _________ movlw 0xFF movwf PORTB end .

Project 1: Text Conversion, I need a text conversion program written in ass...

I need a text conversion program written in assembly language

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd