Add 8 Bit Without Carry
Add 8 Bit Without Carry
Program 9: Add two 8-bit numbers without considering the carry. Flowchart: Start Load H-L pair with address of first operands memory location. Move the first operand from memory to accumulator.
Add B with A.
Stop
Page 1 of 2
8085 Programs
Program: Address 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 Explanation: This program adds two operands stored in memory location 3000H and 3001H, without considering the carry produced (if any). Let us assume that the operands stored at memory location 3000H is 04H and 3001H is 02H. Initially, H-L pair is loaded with the address of first memory location. The first operand is moved to accumulator from memory location 3000H and H-L pair is incremented to point to next memory location. The second operand is moved to register B from memory location 3001H. The two operands are added and the result is stored in accumulator. H-L pair is again incremented and the result is moved from accumulator to memory location 3002H. MOV INX MOV ADD INX MOV HLT A, M H B, M B H M, A Mnemonics LXI Operand H, 3000H Opcode 21 00 30 7E 23 46 80 23 77 76 Remarks Load H-L pair with address 3000H. Lower-order of 3000H. Higher-order of 3000H. Move the 1st operand from memory to reg. A. Increment H-L pair. Move the 2nd operand from memory to reg. B. Add B with A. Increment H-L pair. Move the result from reg. A to memory. Halt.
Page 2 of 2