Monday, September 21, 2026

8 bit data addition | 8085 Lab Program

 Section: Arithmetic & Logic Operations

Aim: To add two 8-bit numbers stored at consecutive memory locations and also to verify the result.

Apparatus Required: 8085 microprocessor kit, keyboard.

Algorithm:

  1. Initialize memory pointer to data location.
  2. Get the first number from memory into accumulator.
  3. Get the second number and add it to the accumulator.
  4. Store the answer at another memory location.

Program:

AddressLabelMnemonicsOperandComment
4100STARTMVIC, 00Clear C reg.
4102LXIH, 4200Initialize HL reg. to 4200
4105MOVA, MTransfer first data to accumulator
4106INXHIncrement HL reg. to point next memory location
4107ADDMAdd first number to acc. content
4108JNCL1Jump to location if result does not yield carry
410BINRCIncrement C reg.
410CL1INXHIncrement HL reg. to point next memory location
410DMOVM, ATransfer the result from acc. to memory
410EINXHIncrement HL reg. to point next memory location
410FMOVM, CMove carry to memory
4110HLTStop the program

Observation:

  • Input:
    • Memory location 4200: 40
    • Memory location 4201: 20
  • Output:
    • Memory location 4202: 60 (Sum)
    • Memory location 4203: 00 (Carry)

Result: Thus the two 8-bit numbers stored at 4200 & 4201 are added and the result is stored at 4202 & 4203.

Flow Chart: 

  +-------------------+

               |       START       |

               +---------+---------+

                         |

                         v

               +-------------------+

               |    [C] <- 00H     |

               +---------+---------+

                         |

                         v

               +-------------------+

               |   [HL] <- 4200H   |

               +---------+---------+

                         |

                         v

               +-------------------+

               |    [A] <- [M]     |

               +---------+---------+

                         |

                         v

               +-------------------+

               |  [HL] <- [HL] + 1 |

               +---------+---------+

                         |

                         v

               +-------------------+

               |  [A] <- [A] + [M] |

               +---------+---------+

                         |

                         v

                       /   \

                     /  Is   \

                   /  there a  \

                  <   Carry?   >

                   \          /

                     \      /

                       \  /

                        |

            +-----------+-----------+

            |                       |

           YES                      NO

            |                       |

            v                       |

  +-------------------+             |

  |   [C] <- [C] + 1  |             |

  +---------+---------+             |

            |                       |

            +-----------+-----------+

                        |

                        v

              +-------------------+

              |  [HL] <- [HL] + 1 |

              +---------+---------+

                        |

                        v

              +-------------------+

              |    [M] <- [A]     |

              +---------+---------+

                        |

                        v

              +-------------------+

              |  [HL] <- [HL] + 1 |

              +---------+---------+

                        |

                        v

              +-------------------+

              |    [M] <- [C]     |

              +---------+---------+

                        |

                        v

              +-------------------+

              |       STOP        |

              +-------------------+ 

Viva Questions:

  1. What is the function of LXI H, 4000 H instruction?
  2. How can you store data in a memory location?
  3. What is the meaning of INX?
  4. How can you read data from a memory location?
  5. What are the flags available in 8085?
  6. What is the function of the RESET key of an 8085 microprocessor kit?
  7. What is the function of JNC instruction?
  8. What is the difference between conditional and unconditional jump instructions?
  9. What is multibyte addition/subtraction?


For all 2026 published articles list: click here

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