0% found this document useful (0 votes)
245 views10 pages

Experiment 2: To Perform Addition & Subtraction of Two 8 Bit Numbers Using Microprocessor 8085A and 8051

It is a experiment of microprocessor which aims of finding sum and subtraction of two 8-bit numbers using 8085 and 8051

Uploaded by

Swapnita Goyal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
245 views10 pages

Experiment 2: To Perform Addition & Subtraction of Two 8 Bit Numbers Using Microprocessor 8085A and 8051

It is a experiment of microprocessor which aims of finding sum and subtraction of two 8-bit numbers using 8085 and 8051

Uploaded by

Swapnita Goyal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Experiment 2

To perform addition & subtraction of two 8 bit numbers using microprocessor


8085A and 8051.

AIM 2a: To perform addition of two 8 bit numbers using microprocessor 8085A and 8051.

Instruments Required:
1. Online Simulator 8085, Keil Software for 8051

ALGORITHM:
1) Start the program by loading the first data into Accumulator.

2) Move the data to a register (B register).

3) Get the second data and load into Accumulator.

4) Add the two register contents.

5) Check for carry.

6) Store the value of sum and carry in memory location.

7) Terminate the program.

FLOW CHART:
Program:

8085
Code:
LDA 0000
//Move content of 0000 memory location to accumulator

MOV H,A

//copy accumulator content to register H

LDA 0001

//Move content of 0001 memory location to accumulator

ADD H

//Add content of A(accumulator) and H

MOV L,A

//copies content of accumulator to register L

MVI A,00

// move data (00) to A

ADC A

//add A(00) and carry(1)

MOV H,A

//copies content to register H

SHLD 0010

//move content of register L to 0010 and H to 0011

HLT

//stops the execution of program


Observation:

Input Data Output Data


Memory Location Data Memory Location Data
0000 41 0010 49

0001 08 0011 00

8051
Code:
ORG 0000H

MOV A, #45H

MOV B, #86H

ADD A, B
END

Conclusion:
The addition Of two 8-bit numbers is performed using 8085 and 8051 microprocessor Where sum is in 8-
bit.

Precautions(for hardware):
1. Properly connect the 8085 microprocessor kit with power supply terminals.

2. Switch on the power supply after checking connections

3. Handle the Trainer kit carefully.

AIM 2b: To perform the subtraction of two 8 bit numbers using 8085 ans 8051.

Software requirement: Online Simulator 8085, Keil Software for 8051


ALGORITHM:
Start the program by loading the first data into Accumulator.

2. Move the data to a register (B register).

3. Get the second data and load into Accumulator.

4. Subtract the two register contents.

5. Check for carry.

6. If carry is present take 2's complement of Accumulator.

7. Store the value of borrow in memory location.

8. Store the difference value (present in Accumulator) to a memory

9. location and terminate the program.

PROGRAM:

8085
CODE:
MVI C,00

LHLD 0000

MOV A,H

SUB L

JNC LOOP

INR C

LOOP: STA 0010

MOV A,C

STA 0011

HLT
OBSERVATION:

Input Data Output Data


Memory Location Data Memory Location Data
0000 11 0010 F0

0001 01 0011 01

8051
Code:
ORG 000H

MOV R1, #40H

MOV R2, #30H

MOV A, R1

SUBB A, R2
END

Conclusion:
Thus the program to subtract two 8-bit numbers was executed.

Precautions(for hardware):
1. Properly connect the SOSS microprocessor kit with power supply terminals.

2. Switch on the power supply after checking connections

3. Handle the Trainer kit carefully.

You might also like