- Related Questions & Answers
- Program to Divide two 8 Bit numbers in 8085 Microprocessor
- 8051 Program to Divide two 8 Bit numbers
- 8085 program to divide two 16 bit numbers
- 8085 Program to Add two 8 Bit numbers
- 8085 Program to Subtract two 8 Bit numbers
- 8085 program to multiply two 8 bit numbers
- 8085 program to swap two 8-bit numbers
- Program to Divide two 8 Bit numbers in 8051 Microprocessor
- 8085 program to find larger of two 8 bit numbers
- 8085 program to find maximum of two 8 bit numbers
- Program to Add two 8 Bit numbers in 8085 Microprocessor
- Program to Subtract two 8 Bit numbers in 8085 Microprocessor
- 8085 program to multiply two 8 bit numbers using logical instructions
- 8085 program to sum of two 8 bit numbers without carry
- 8085 Program to Divide a 16-bit number by an 8-bit number

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

In this program, we will see how to divide two 8-bit numbers using 8085 microprocessor.

Write 8085 Assembly language program to divide two 8-bit numbers and store the result at locations **8020H** and **8021H**.

The 8085 has no division operation. To get the result of the division, we should use the repetitive subtraction method.

By using this program, we will get the quotient and the remainder. 8020H will hold the quotient, and 8021H will hold the remainder.

We are saving the data at location 8000H and 8001H. The result is storing at location 8050H and 8051H.

The Dividend: 0EH

The Divisor 04H

The Quotient will be 3, and the remainder will be 2

Address | HEX Codes | Labels | Mnemonics | Comments |
---|---|---|---|---|

F000 | 21,0E, 00 | START | LXIH,0CH | Load 8-bit dividend in HL register pair |

F003 | 06,04 | MVIB,04H | Load divisor in B to perform num1 / num2 | |

F005 | 0E,08 | MVIC, 08 | Initialize the counter | |

F007 | 29 | UP | DADH | Shifting left by 1 bit HL = HL + HL |

F008 | 7C | MOVA, H | Load H in A | |

F009 | 90 | SUB B | perform A = A – B | |

F00A | DA,0F, F0 | JC DOWN | If MSB < divisor then shift to left | |

F00D | 67 | MOVH, A | If MSB > divisor, store the current value of A in H | |

F00E | 2C | INR L | Tracking quotient | |

F00F | 0D | DOWN | DCRC | Decrement the counter |

F010 | C2,07, F0 | JNZ UP | If not exhausted then go again | |

F013 | 22,20, 80 | SHLD 8020 | Store the result at 8020 H | |

F016 | 76 | HLT | Stop |

Address | Data |
---|---|

. . . | . . . |

8020 | 03 |

8021 | 02 |

. . . | . . . |

Advertisements