8085 program to sum of two 8 bit numbers without carry
Problem – Write an assembly language program to sum two 8 bit numbers without using carry operation in 8085 microprocessor.
- The starting address of the program is 2000.
- Memory address of the first number is 2050.
- Memory address of the second number is 2051.
- Memory address of result is 2052.
Input: 2050: 03 : 2-51: 04 Output: 2052: 07
- Load the first number to the accumulator through memory address 2050.
- Move the content of accumulator to the register B.
- Load the second number to the accumulator through memory address 2051.
- Add the content of accumulator and register B and result will be stored at the accumulator.
- Store the result from the accumulator to the memory address 2052.
- Terminate the program.
|2003||MOV B, A||B<-A|
- LDA 2050: This instruction will load the number from memory to the accumulator.
- MOV B, A: This instruction will move the content of accumulator to the register B.
- LDA 2051: This instruction will load the number from memory to the accumulator.
- ADD B: This instruction will sum the content of the accumulator with the content of the register B.
- STA 2052: This instruction will store the content of accumulator to the memory address 2052.
- 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.