Home »
Embedded Systems
Multiply Two 8-bit Numbers with Carry in 8085 Microprocessor
In this tutorial, we will learn how to find the multiplication of two 8-bit numbers with carry in 8085 Microprocessor?
By Raju Singh Bhati Last updated : May 13, 2023
Multiplication of Two 8-bit Numbers with Carry in 8085 Microprocessor
Given two 8-bit numbers, we have to multiply them with carry in 8085 Microprocessor.
Algorithm
- Load HL pair with initial data using LHLD command.
- Exchange the data of HL and DE pair using XCHG command.
- Copy the data of register D into Register C.
- Now initialize register D with 0.
- Also initialize HL pair with 0 using LXI command.
- Use the DAD command to add the data of DE pair into the data of HL pair and store in HL Pair.
- Decrease the value of C by one.
- Check if the result from previous instruction resets the zero flag and if true, jump to address XXX.
- Store the content of the HL pair into desired location.
- Stop.
Program
LHLD 2050
XCHG
MOV C, D
MVI D 00
LXI H 0000
xxx DAD D
DCR C
JNZ 200A
SHLD 3050
HLT
Observation
INPUT:
2050:43
2051:07
OUTPUT:
3050:D5
3051:01
Hence successfully multiplied two 8 bits numbers with carry using 8085 microprocessor..