75% found this document useful (4 votes)
4K views2 pages

Division of Two 8 Bit Numbers

The document describes a program to divide two 8-bit numbers using an 8085 microprocessor. It involves loading the dividend into the B register, clearing the C register for the quotient, loading the divisor into the A register, using subtraction and incrementing C to repeatedly calculate the quotient until the division is complete, and finally storing the remainder and quotient in memory. The example input of F and FF for the numbers results in an output remainder of 1 and quotient of FE, demonstrating the program works as intended to divide two 8-bit numbers.

Uploaded by

animesh_14
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
75% found this document useful (4 votes)
4K views2 pages

Division of Two 8 Bit Numbers

The document describes a program to divide two 8-bit numbers using an 8085 microprocessor. It involves loading the dividend into the B register, clearing the C register for the quotient, loading the divisor into the A register, using subtraction and incrementing C to repeatedly calculate the quotient until the division is complete, and finally storing the remainder and quotient in memory. The example input of F and FF for the numbers results in an output remainder of 1 and quotient of FE, demonstrating the program works as intended to divide two 8-bit numbers.

Uploaded by

animesh_14
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

DIVISION OF TWO 8 BIT NUMBERS

AIM:
To perform the division of two 8 bit numbers using 8085.
THEORY:
1) Start the program by loading HL register pair with address of memory location.
2) Move the data to a register(B register).
3) Get the second data and load into Accumulator.
4) Compare the two numbers to check for carry.
5) Subtract the two numbers.
6) Increment the value of carry .
7) Check whether repeated subtraction is over and store the value of product and
carry in memory location.
8) Terminate the program.

PROGRAM:
LXI H, 4150
MOV B,M
MVI C,00
INX H
MOV A,M
NEXT: CMP B
JC LOOP
SUB B
INR C

Get the dividend in B reg.


Clear C reg for qoutient
Get the divisor in A reg.
Compare A - reg with register B.
Jump on carry to LOOP
Subtract A reg from B- reg.
Increment content of register C.

JMP NEXT
LOOP: STA 4152
MOV A,C
STA 4153
HLT

Jump to NEXT
Store the remainder in Memory
Store the quotient in memory
Terminate the program.

OBSERVATION:
Input:
F (4150)
FF (4251)
Output:
01 (4152) ---- Remainder
FE (4153) ---- Quotient
RESULT:
Thus the program to divide two 8-bit numbers was executed.

You might also like