- Related Questions & Answers
- 8085 program to add two 16 bit numbers
- 8085 Program to Divide two 8 Bit numbers
- 8085 Program to multiply two 16-bit binary numbers
- Program to Divide two 8 Bit numbers in 8085 Microprocessor
- Program to multiply two 16-bit binary numbers in 8085 Microprocessor
- 8085 Program to Divide a 16-bit number by an 8-bit number
- 8085 program to swap two 16-bit numbers using Direct addressing mode
- 8086 program to multiply two 16-bit numbers
- 8051 Program to Divide two 8 Bit numbers
- 8086 program to subtract two 16 bit BCD numbers
- 8085 program to reverse 16 bit number
- 8085 program to add three 16 bit numbers stored in registers
- 8085 Program to Add two 8 Bit numbers
- 8085 Program to Subtract two 8 Bit numbers
- 8085 program to multiply two 8 bit numbers

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

Here we will see how to divide two 16 bit numbers using 8085.

Write 8085 Assembly language program to divide two 16-bit numbers.

8085 has no division operation. To perform division, we have to use repetitive subtraction. To perform 16-bit division, we have to do the same but for the register pairs. As the register pairs are used to hold 16-bit data.

The Divisor is stored at location FC00 and FC01, the dividend is stored at FC02 and FC03. After division, the quotient will be stored at FC04 and FC05, and the remainder will be stored at FC06 and FC07.

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

FC00 | 8A |

FC01 | 5C |

FC02 | 5A |

FC03 | 1D |

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

F000 | 01, 00, 00 | | LXI B,0000H | Clear BC register pair |

F003 | 2A, 02, FC | | LHLD FC02H | Take the Divisor into HL first |

F006 | EB | | XCHG | Exchange DE and HL |

F007 | 2A, 00, FC | | LHLD FC00H | Take the dividend |

F00A | 7D | LOOP | MOV A,L | Load L into A |

F00B | 93 | | SUB E | Subtract E from A |

F00C | 6F | | MOV L,A | Store A into L |

F00D | 7C | | MOV A,H | Load H into A |

F00E | 9A | | SBB D | Subtract B from A with Borrow |

F00F | 67 | | MOV H,A | Store A into H again |

F010 | DA, 17, F0 | | JC SKIP | If CY is 1, Skip |

F013 | 03 | | INX B | Increase B by 1 |

F014 | C3, 0A, F0 | | JMP LOOP | Jump to Loop |

F017 | 19 | SKIP | DAD D | Add HL and DE |

F018 | 22, 06, F0 | | SHLD FC06H | Store remainder into FC06 and FC07 |

F01B | 69 | | MOV L,C | Load C into L |

F01C | 60 | | MOV H,B | Load B into H |

F01D | 22, 04, FC | | SHLD FC04H | Store quotient into FC04 and FC05 |

F020 | 76 | | HLT | Terminate the program |

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

FC04 | 03 |

FC05 | 00 |

FC06 | 7C |

FC07 | 04 |

Advertisements