Category Archives: 8-BIT ADDITION OF TWO NUMBERS

8-BIT ADDITION OF TWO NUMBERS

To write an 8085 assembly language program to add two 8 bit numbers and to store the result in the memory location 8100H & 8101H.
ALGORITHM:
STEP 1: Load the 8 bit data in the accumulator.
STEP 2: Add the other 8 bit data present in the accumulator.
STEP 3: Store the result from the accumulator in the memory location
8100H.
STEP 4: If carry occurs then store 01H in the memory location through
Accumulator.
STEP 5: If there is no carry then store 00H in the memory location
through accumulator.
STEP 6: Stop the execution.
________________________________________________________________________________________________
MEMORY ADDRESS HEXA- CODE LABEL MNEMONICS COMMENTS
8000 3E MVIA, DATA 1 Load the accumulator with 8-bit data
8001 Data 1
8002 C6 ADI, DATA 2 Add other 8-bit data with accumulator contents
8003 Data 2
8004 32 STA 8100H Store the contents of A in memory location 8100H
8005 00
8006 81
8007 D2 JNC 800FH(L1) Move to location 8101H. If there is necessary.
8008 OF
8009 80
800A 3E MVFA, 01H A is loaded with 01H. If no carry occurs.
800B 01
800C C3 JMP 8011H(L2) After loading A move to memory location 8010H.
800D 11
800E 80
800F 3E L1 MVIA, 00H If carry occurs load 00H in the accumulator.
8010 00
8011 32 L2 STA 8101H Store the contents of A in memory location 8101H
8012 01
8013 81
8014 76 HLT Stop the execution.
__________________________________________________________________________________________________
8085(10)