8085 Program to Divide 16-bit number by 8-bit number

In this program, we will write an 8085 Program to Divide 16-bit number by 8-bit number in the 8085 microprocessor with a program flow chart and explanation of the program.

8085 Program to Divide 16-bit number by 8-bit number

Program Statement

Divide the 16-bit number stored in memory locations D000H and D001H by the 8-bit number stored at memory location D002H. Store the quotient in memory locations E000H and E001H and the remainder in memory locations E002H and E003H.

Explanation of Program

  • Get the dividend in the HL register pair. Get the divisor in the accumulator and store in register C.
  • Initialize quotient in register pair DE as 00 H.
  • Perform the division by subtracting the divisor from the dividend, till the dividend is greater than the divisor. Increment the quotient every time the dividend is greater than the divisor when the subtraction is performed.
  • When the dividend becomes less than the divisor then this dividend is the reminder. Store the quotient and remainder.

Example: D000H = 05 H, D001H = 02 H, D002H = 04 H

Result = 0205H / 04H = 81 H (Quotient) and 01H = Remainder

E000H = 81H, E001H = 00H, E002H = 01H, E003H = 00H

Flow Chart of Program

8085 Program to Divide 16-bit number by 8-bit number

Assembly Language Program

LabelInstructionCommentOperation
LHLD D000HGet the dividendH = 02H, L = 05H
LDA D002HGet the divisor A = 04H
MOV C, AStore the divisor in CC = 04H
LXI D, 0000HInitialize Quotient = 0D = 00H, E = 00H
BACK:MOV A, LA = L
SUB CDivision = Dividend – DivisorA = A – C
MOV L, AL = A
JNC SKIP
DCR HSubtract borrow of previous subtractionH = H – 1
SKIP:INX DQuotient = Quotient + 1DE = DE + 1
MOV A, HA = H
CPI 00Check if dividend < divisor
JNZ BACK
MOV A, Lif no repeatA = L
CMP C
JNC BACK
SHLD E002HStore the remainderE002H = 01H
E003H = 04H
XCHG
SHLD E000HStore the QuotientE000H = 81H
E001H = 00H
HLTTerminate program executionStop
Sr. No.Name of the 8085 Programs
1.Write a program to load the data into the accumulator and any register.
2.Write a program to exchange the contents of memory locations.
3.Add two 8-bit numbers.
4.Subtract two 8-bit numbers.
5.Add two 16-bit numbers.
6.Subtract two 16-bit numbers
7.Find the 1’s complement of a Number
8.Find the 2’s complement of a Number
9.8085 Program To Mask The Lower Nibble
10.8085 Program To Mask The Upper Nibble
11.8085 program to pack the two unpacked BCD numbers
12.8085 program to Unpack the two packed BCD numbers
13.8085 program to find the sum of a series of 8-bit numbers
14.8085 Program to sort the numbers in ascending order
15.8085 Program to sort the numbers in Descending order
16.8085 Program to Multiply Two 8-bit Numbers
17.8085 Program to Divide 16-bit number by 8-bit number
18.8085 Program to Find the Number of Negative Numbers in Array
19.8085 Program to Find Maximum Number in Array
20.8085 Program to count the number of 1’s in a register
21.8085 Program to Calculate the sum of a series of even numbers
22.8085 Program to find the square of numbers
23.8085 Program to find the smallest number in the array

Hello friends, my name is Trupal Bhavsar, I am the Writer and Founder of this blog. I am Electronics Engineer(2014 pass out), Currently working as Junior Telecom Officer(B.S.N.L.) also I do Project Development, PCB designing and Teaching of Electronics Subjects.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

telegram logo Join Our Telegram Group!