8085 is a Microprocessor which was developed by Intel in 1970s. All the instructions in this microprocessor are encoded in a single byte. Some of the instructions are followed by one or two bytes of data, which can be a memory address, an immediate operand or a port number.
In this post, we will write a program in 8085 to divide a 16-bit number with an 8-bit number.
Start Read dividend(16 bit) Read divisor count <- 8 Left shift dividend Subtract divisor from upper 8-bits of dividend If CS != 1 go to 9 restore dividend Increment lower 8-bits of dividend count <- count - 1 If count != 0 go to 5 Store upper 8-bit dividend as remainder and lower 8-bit as quotient Stop
LHLD 2100H LDA 2102H MOV B, A MVI C, 08H BACK: DAD H MOV A, H SUB B JC NEXT MOV H, A INR L NEXT: DCR C JNZ BACK SHLD 2103H RST-5
2100H: 0C 2101H: 00 2102H: 07 2103H: 01 -> quotient 2104H: 05 -> remainder
Check out our other 8085 programs
- Program to Calculate 8-bit Sum of N 8-bit Numbers
- Program to Find the Maximum of N Numbers
- Program to Find the Minimum of N Numbers
- Program to multiply two 8-bit numbers without using shifting multiplicand
- Program to multiply two 8-bit numbers using shifting multiplicand
- Program to divide a 16-bit number with an 8-bit number
- Program to find the HCF of two numbers
- Program to find the HCF of N numbers
- Program to convert binary number to decimal
- Program to convert binary number to decimal without using DAA
- Program to convert decimal to binary
Let us know in the comments if you are having any questions regarding this microprocessor program.
And if you found this post helpful, then please help us by sharing this post with your friends. Thank You