Write an 8085 program to add two 8-bit hexadecimal numbers sum equals to 16-bit
In this posts, we are going to learn how we can add two 8-bit hexadecimal numbers which will produce an output of a 16-bit number. Now in order to so, we are going to take two 8-bit hexadecimal numbers which will produce a carry.
Unless and until a carry will produce, we won’t be able to use the concept of LSB and MSB in this program.
Now, as per as memory location is concerned, we will require two memory location to store the value and two memory location to store the result.
As mentioned, we are going to need 4 consecutive memory locations; so we are going to use 2000H to 2003H memory location.
In the first two memory locations i.e. 2000H and 2001H, we are going to store 8-bit data EAH and D8H, which after addition will produce an output C2H with carry 1.
And then we are going to store C2H in 2002H and carry 1 in 2003H location.
MOV A, M
Label STA 2002H
STA 2003 H
|Memory Location||OPCODE||Operand||Label||Hex Code|