In the previous program, we saw how we can add two 8-bit hexadecimal numbers which output a 16-bit hexadecimal number.
In this program, we are going to use the same logic but instead of using a hexadecimal number, we are going to use decimal numbers.
The whole program is going to remain the same but there will be two added instructions. Moving on, in this program, we are going to use immediate addressing mode.
The first thing that we’ll do is use two successive memory locations to store the values that we are going to use, and we will require more two memory locations to store the result.
So, like the previous program, we are going to use 2000H – 2003H memory location.
Let the first 8-bit decimal number be 82D, and the second 8-bit decimal number be 97D, we are going to store these two numbers in memory location 2000H and 2001H.
And then we are going to store the result in 2002H and 2003H.
Label STA 2002
|Memory Location||OPCODE||Operand||Label||Hex Code|