Addition of two 8-bit numbers in 8085 microprocessor

Aim:
        To write an assembly language for adding two 8 bit numbers by using microprocessor kit.
Apparatus required:
        8085 micro processor kit
        (0-5V) DC battery
Algorithm:
        Step 1 : Start the microprocessor
        Step 2 : Initialize the carry as ‘Zero’
        Step 3 : Load the first 8 bit data into the accumulator
        Step 4 : Copy the contents of accumulator into the register ‘B’
        Step 5 : Load the second 8 bit data into the accumulator.
        Step 6 : Add the two 8-bit data and check for carry.
        Step 7 : Jump on if no carry
        Step 8 : Increment carry if there is
        Step 9 : Store the added request in accumulator
        Step 10 : More the carry value to accumulator
        Step 11 : Store the carry value in accumulator
        Step 12 : Stop the program execution.

Flow chart for addition of two 8-bit numbers

AddressLabelMnemonicsHex CodeComments
4100MVI C,000E, 00Initialize the carry as zero
4102LDA 43003A, 00, 43Load the first 8 bit data
4105MOV B,A47Copy the value of 8 bit data into register B
4106LDA 43013A, 01, 43Load the second 8 bit data into the accumulator
4109ADD B80Add the two values
410AJNCD2, 0E, 41Jump on if no carry
410DINR C0CIf carry is there increment it by one
410ELoopSTA 430232, 02, 43Store the added value in the accumulator
4111Move the value of carry to the accumulator from register C
4112STA 430332, 03, 43Store the value of carry in the accumulator
4115HLT76Stop the program execution

Input without carry
Input AddressValue
430004
430102

Output
Output AddressValue
430206
430300 (carry)

Input with carry
Input AddressValue
4300FF
4301FF

Output
Output AddressValue
4302FE
430301 (carry)

Calculation:         1111   1111
                              1111   1111
                              --------------
                   (1)      1111   1110
                              ========
                                F        E
Result:
        The assembly language program for 8 bit addition of two numbers was executed successfully by using 8085 micro processing kit.