Multiply Two 8 Bit BCD Numbers - Multiply Two 8 Bit BCD Numbers

Multiply Two 8 Bit BCD Numbers

Posted on

Objective

In this post we will see how to write assembly program to Multiply Two 8 Bit BCD Numbers. Both the numbers will be provided as input to the program which in the end will calculate product. After calculation it will be adjusted before printing it to screen.

Multiple two 8 bit BCD numbers Algorithm

Step I      :    Initialize the data segment.

Step II     :    Get the first unpacked BCD number.

Step III    :    Get the second unpacked BCD number.

Step IV    :    Multiply the two numbers.

Step V     :    Adjust result to valid unpacked BCD number in AX.

Step VI    :    Display the result.

Step VII   :    Stop.

 

Multiply Two 8 Bit BCD Numbers - Multiply Two 8 Bit BCD Numbers

Program Code

We need to declare two number and load the first number in AL and then second number in BL. Do the multiplication of these numbers and adjust based on unpacked BCD number which is must before printing the result.

 

 

You can find more assembly language codes on this link. You can run this program using TASM which need to be installed on windows machine. Program running steps are :

C:\programs>tasm mult8bit.asm

Turbo Assembler  Version 3.0  Copyright (c) 1988, 1991 Borland International

Assembling file:  mult8bit.ASM

Error messages:    None

Warning messages:  None

Passes:            1

Remaining memory:  437k

Please leave a comment if you like this post.

Source projectgeek.com