Home »
Embedded Systems
Division of two 8 bits numbers using 8085 Microprocessor
Here, we are going to learn how to find Division of two 8 bits numbers using 8085 Microprocessor?
Submitted by Akash Kumar, on October 21, 2018
Problem statement:
To perform division operation between two 8 bits numbers using 8085 Microprocessor.
Algorithm:
- Load the HL pair registers with address of memory location.
- Move the first data to register B.
- Move the second data to the accumulator.
- Then compare two numbers for carry.
- Subtract the content of Register B to the content of accumulator.
- Then increment the value of carry.
- Then check whether the repeated subtraction is over.
- If the repeated subtraction is over then store the value of quotient and remainder in the given memory location.
Program:
LXI H, 3050
MOV B, M
MVI D, 00
INX H
MOV A, M
*** CMP B
JC **
SUB B
INR C
JMP ***
** STA 3052
MOV A, C
STA 3053
HLT
Observation:
INPUT:
3050:04
3051:02
OUTPUT:
3052:02
3053:00
Hence we successfully divided two 8 bits numbers.