Sei sulla pagina 1di 2

EXPERIMENT 2( b)

OBJECTIVE: Write a program for addition of two 8 Bit numbers( with the
Provision of carry)

DESCRIPTION: The program takes the content of memory location 2050, adds it
to the content of 2051 and stores the result back at 2052.

APPARATUS: 8085 Microprocessor kit, Power Supply (+5v)

PROCEDURE:
1. Draw the flow chart.
2. Write the op-codes for the Mnemonics instructions.
3. Feed the op-codes in the Microprocessor 8085 kit.
4. Execute the entered program.

ALGORITHM:
1. Load 2050 in H-L reg. pair.
2. Initialize register C for storing the final carry of the result.
3. Move 1st number to accumulator from memory location 2050
4. Increment H-L register pair data.
5. Add the numbers of memory and accumulator (Result is stored in Accumulator)
6. Jump to 200C if not carry.
7. Increment register C.
8. Store the result in 2052and carry in 2053.

PRECAUTIONS:
1. Check for proper connections of power supply.
2. Enter the codes in the Microprocessor kit properly.
3. Always remember the exact address location where you had started.

RESULT :
Two 8 bit numbers have been added & the result can be verified at 2052 & 2053.

QUESTIONS:
1. Write single instruction for clearing the carry flag and the accumulator.
2. We are using LXI H,2050 . Can we use LXI B , 2050 or LXI D, 2050 and why.
3. Add two 8-bits numbers with provision of carry and show the status of all the
flags.
PROGRAM

ADDRESS MNEMONICS REMARKS


2000 LXI H,2050
2003 MVI C,00
2005 MOV A,M
2006 INX H
2007 ADD M
2008 JNC 200C
200B INR C
200C STA 2052
200F MOV A,C
2010 STA 2053
2013 RST 5
2014 END

Potrebbero piacerti anche