Up until now, we have seen programs which included 8-bit hexadecimal numbers, but for this 8085 program, we are going to use two 8-bit decimal numbers.

Now, if you are not familiar with the number system then I’m gonna urge you go through the basics of the number system including conversions.

Nonetheless, if you are familiar with number system then you don’t need to worry.

Anyways, let us now talk about this 8085 program. The first thing which we are going to do is store two 8-bit data in two successive memory location, then using HL register we are going to point the memory location.

After pointing the HL register pair, we are going to perform the add operation by using ADD instruction. And then finally we are going to adjust the result by using DAA instruction. Now unlike the previous programs in which we store the result in a register, this time we are going to store the result in a memory location.

Hence, we will need to three memory location. For this program, we are going to use 2000H, 2001H and 2002H memory location.

Input:

Let 2000H memory address hold 24D, 2001H hold 65D, after adding them we get the result 89D, which we will store in a 2002H memory location.

Instruction:

LXI H,2000H

MOV A,M

INX H

ADD M

DAA

INX H

MOV M,A

HLT

Programming Details
Memory Location OPCODE Operand Label Hex Code
2003 LXI H, 2000H 21H
2004 00H
2005 21H
2006 MOV A,M 7EH
2007 INX H 23H
2008 ADD M 86H
2009 DAA 27H
200A INX H 23H
200B MOV M,A 77H
200C HLT 76H