So far in this series, we have just copied the content of accumulator to a memory location or either in any register.
But from now onwards, we will start using various arithmetic instructions which are supported by 8085 microprocessor such as ADD, ADI, SUB, etc.
Moving on, for this 8085 program we will need two 8-bit data, and then we need to store the result in any given General Purpose Register.
Now in order to begin our program, the first we’ll need to is take two 8-bit numbers. In order to make the program shorter, we will use Accumulator and another GPR to store the two 8-bit data.
Let the first 8-bit data be A9H, and the second 8-bit data be 2DH.
After doing their addition, we get D6H. So, at the end of the program, the selected register holds the 8-bit data D6H.
MVI A, A9H //using move immediate instruction we move the first 8-bit data in accumulator
MVI C, 2DH//similar to the above instruction, we now move the second 8-bit data in C register
ADD C //after moving the content we now add the content of accumulator and the content of C register
MOV C,A // after addition, we now move the result stored in accumulator in C register
HLT //finally we halt the program using HLT
|Memory Location||OPCODE||Operand||Label||Hex Code|