Explore BrainMass
Share

An 8086 subroutine that multiplies two signed 16-bit values together without using the mul instruction.

This content was STOLEN from BrainMass.com - View the original, and get the already-completed solution here!

I'm trying to teach myself 8086 assembly. I need an example of how to use an assembly language subroutine, using only 16-bit registers, to multiply two signed 16-bit values together without using the mul instruction. My book gives the example below but doesn't give a clear explanation of how to use it:

a) clear the a register
b) place the multiplicand in the D register
c) do the next step 4 times (multiplying 4 bit numbers). if the left most bit of the D
register is a 1 then shift both registers to the left one bit, add the multiplier to the
A register, else shift both registers to the left one bit.

© BrainMass Inc. brainmass.com October 16, 2018, 5:42 pm ad1c9bdddf
https://brainmass.com/computer-science/programming-languages/61353

Solution Preview

Please find the attached file as the solution to your problem.

Thanks and regards.

UPDATE FROM OTA:
The problem can be solved as,

first load two numbers in two different registers. if both the registers are of 16 bit then the result should be stored in a 32 bit register.

The concept of loading the values is same as in multi precision multiplication.

In case 32 bit registers, first we take the lower half(16 bit) and multiply it with the lower half of the ...

$2.19