0% found this document useful (0 votes)
321 views2 pages

Add 8 Bit Without Carry

This program adds two 8-bit numbers stored in memory without considering carry. It loads the H-L register pair with the address of the first operand, moves it to the accumulator, increments H-L to the second operand address, moves that operand to register B, adds the operands in A and B, increments H-L and stores the result back in memory. The program adds the numbers 04H and 02H stored at addresses 3000H and 3001H, storing the result 06H at address 3002H.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
321 views2 pages

Add 8 Bit Without Carry

This program adds two 8-bit numbers stored in memory without considering carry. It loads the H-L register pair with the address of the first operand, moves it to the accumulator, increments H-L to the second operand address, moves that operand to register B, adds the operands in A and B, increments H-L and stores the result back in memory. The program adds the numbers 04H and 02H stored at addresses 3000H and 3001H, storing the result 06H at address 3002H.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

8085 Programs

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.

Increment H-L pair to point to next memory location.

Move the second operand from memory to register B.

Add B with A.

Increment H-L pair.

Move the result from accumulator to memory.

Stop

Gursharan Singh Tatla

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.

Output: Before Execution: 3000H: 3001H: 04H 02H

After Execution: 3002H: 06H

Gursharan Singh Tatla

Page 2 of 2

You might also like