Skip to content
Related Articles

Related Articles

Improve Article
8085 program to sum of two 8 bit numbers without carry
  • Difficulty Level : Easy
  • Last Updated : 30 Jan, 2019

Problem – Write an assembly language program to sum two 8 bit numbers without using carry operation in 8085 microprocessor.

Assumption:

  1. The starting address of the program is 2000.
  2. Memory address of the first number is 2050.
  3. Memory address of the second number is 2051.
  4. Memory address of result is 2052.

Example:

Input: 2050: 03
     : 2-51: 04
Output: 2052: 07 

Algorithm:

  1. Load the first number to the accumulator through memory address 2050.
  2. Move the content of accumulator to the register B.
  3. Load the second number to the accumulator through memory address 2051.
  4. Add the content of accumulator and register B and result will be stored at the accumulator.
  5. Store the result from the accumulator to the memory address 2052.
  6. Terminate the program.

Program:



Memory AddressMNEMONICSComment
2000LDA 2050A<-[2050]
2003MOV B, AB<-A
2004LDA 2051A<-[2051]
2007ADD BA<-A+B
2008STA 2052[2052]<-A
200BHLTTerminate

Explanation:

  1. LDA 2050: This instruction will load the number from memory to the accumulator.
  2. MOV B, A: This instruction will move the content of accumulator to the register B.
  3. LDA 2051: This instruction will load the number from memory to the accumulator.
  4. ADD B: This instruction will sum the content of the accumulator with the content of the register B.
  5. STA 2052: This instruction will store the content of accumulator to the memory address 2052.
  6. HLT: This instruction will terminate the program.

Hence we successfully sum the two 8 bit numbers without carry using 8085 microprocessor.

Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.

 

My Personal Notes arrow_drop_up
Recommended Articles
Page :