Thursday, September 24, 2026

8 bit data division | 8085 Lab Program

 Section: Arithmetic & Logic Operations

Aim: To divide two 8-bit numbers stored in memory and also to verify the result.

Apparatus Required: 8085 microprocessor kit, key board.

Algorithm:

  1. Load Divisor and Dividend.
  2. Subtract divisor from dividend.
  3. Count the number of times of subtraction, which equals the quotient.
  4. Stop subtraction when the dividend is less than the divisor. The dividend now becomes the remainder. Otherwise, go to step 2.
  5. Stop the program execution.

Program:

AddressLabelMnemonicsOperandComment
4100MVIB,00Clear B reg for quotient
4102LXIH,4200Initialize HL reg. to 4200H
4105MOVA,MTransfer dividend to acc.
4106INXHIncrement HL reg. to point next mem. Location.
4107LOOPSUBMSubtract divisor from dividend
4108INRBIncrement B reg
4109JNCLOOPJump to LOOP if result does not yield borrow
410CADDMAdd divisor to acc.
410DDCRBDecrement B reg
410EINXHIncrement HL reg. to point next mem. Location.
410FMOVM,ATransfer the remainder from acc. to memory.
4110INXHIncrement HL reg. to point next mem. Location.
4111MOVM,BTransfer the quotient from B reg. to memory.
4112HLTStop the program

Observation:

  • Input:
    • Address 4200: 06
    • Address 4201: 02
  • Output:
    • Address 4202: 00 (Remainder)
    • Address 4203: 03 (Quotient)

Result: Thus an ALP was written for 8-bit division and also the result is verified.

Flowchart:

               +-------------------+
               |       START       |
               +---------+---------+
                         |
                         v
               +-------------------+
               |    [B] <- 00H     |
               +---------+---------+
                         |
                         v
               +-------------------+
               |   [HL] <- 4200H   |
               +---------+---------+
                         |
                         v
               +-------------------+
               |    [A] <- [M]     |
               +---------+---------+
                         |
                         v
               +-------------------+
               |  [HL] <- [HL] + 1 |
               +---------+---------+
                         |
                         v <------------------+
               +-------------------+          |
               |  [A] <- [A] - [M] |          |
               +---------+---------+          |
                         |                    |
                         v                    |
               +-------------------+          |
               |   [B] <- [B] + 1  |          |
               +---------+---------+          |
                         |                    |
                         v                    |
                       /   \                  |
                     /  Is   \                |
                   /  there a  \              |
                  <   Borrow?  >              |
                   \  (CY = 1) /              |
                     \      /                 |
                       \  /                   |
                        |                     |
            +-----------+-----------+         |
            |                       |         |
           YES                      NO        |
            |                       +---------+
            v
  +-------------------+
  |  [A] <- [A] + [M] |
  +---------+---------+
            |
            v
  +-------------------+
  |   [B] <- [B] - 1  |
  +---------+---------+
            |
            v
  +-------------------+
  |  [HL] <- [HL] + 1 |
  +---------+---------+
            |
            v
  +-------------------+
  |    [M] <- [A]     |
  |    (Remainder)    |
  +---------+---------+
            |
            v
  +-------------------+
  |  [HL] <- [HL] + 1 |
  +---------+---------+
            |
            v
  +-------------------+
  |    [M] <- [B]     |
  |     (Quotient)    |
  +---------+---------+
            |
            v
  +-------------------+
  |       STOP        |
  +-------------------+

Viva Questions:

  1. What SUB M instruction will do?
  2. Describe SBB M instruction.
  3. Express the use of SUI with an example.
  4. Where SBI can be used?
  5. Give the purpose of the instruction LDAX D.
  6. How will you perform Division using ADD instruction?
  7. What is the need of ALE signal in 8085?
  8. What are the addressing modes of 8085?
  9. List the interrupt signals of 8085?


For all 2026 published articles list: click here

…till the next post, bye-bye & take care