Skip to main content

Add contents of two memory locations

Add contents of two memory locations

  1. LXI H, 2500H    : "HL Points 2500H"  
  2. MOV A, M        : "Get first operand"  
  3. INX H           : "HL Points 2501H"  
  4. ADD M           : "Add second operand"  
  5. INX H           : "HL Points 2502H"  
  6. MOV M, A        : "Store the lower byte of result at 2502H"  
  7. MVI A, 00        : "Initialize higher byte result with 00H"  
  8. ADC A           : "Add carry in the high byte result"  
  9. INX H           : "HL Points 2503H"  
  10. MOV M, A        : "Store the higher byte of result at 2503H"  
  11. HLT             : "Terminate program execution" 

Comments