Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Experiment 1

Write a program for addition of two 8 bit numbers.


Aim: To perform addition of two 8 bit numbers using 8085.
A) Addition using registers and storing result in registers.
ALGORITHM:
1) Move the data to a register (Say B Register).
2) Move the data to a register (Say C Register).
3) Get the first data and load into accumulator.
4) Add the two register content.
5) Move the accumulator data to a register(Say D Register).
6) Terminate the program.

PROGRAM:

Memory
Address Opcode Operand Hexcode Comments
Initialize Register B by
3000 MVI B,05 06 5
3001 05

3002 MVI C,02 0E Initialize Register C by


02
3003 02

3004 MOV A,B 78 Move data from


register B to
accumulator.
3005 ADD C 81 Add data from
register C to
accumulator.
3006 MOV D,A 57 Move data from
accumulator to D
3007 HLT End the program
Table:

OBSERVATION:
B C A D
Input: 05 04 Output: 07 07

Result:
Thus, the program for addition of two 8-bit numbers is executed.
Experiment 1
Write a program for addition of two 8 bit numbers taking input from memory and
display result also in memory.
Aim: To perform addition of two 8 bit numbers using 8085.
B) Addition using registers and storing result in registers.
ALGORITHM:
1) Move the data to a register pair HL.
2) Move the data to accumulator from memory.
3) Increment value stored in HL Pair
4) Add memory to accumulator
5) Store in accumulator.
6) Terminate the program.

PROGRAM:

Memory
Address Opcode Operand Hexcode Comments
Initialize Register Pair
3000 LXI H 3010 21 HL by 3010
3001 10

3002 30

3003 MOV A,M 7E Move data from


register pair from
memory to
accumulator
3004 INX H 23 Increment value
stored in HL pair by 1
3005 ADD M 86 Add memory i.e HL
pair value to
accumulator
3006 STA 3012 32 Store to accumulator

3007 12

3008 30

3009 HLT End the program


Table:

OBSERVATION:
H L A H L M
Input: 30 10 Output: 05 30 11 03

Result:
Thus, the program for addition of two 8-bit numbers is executed where input is also from
memory and output is also to memory.
First Class

MICROPROCESSOR VS MICROCONTROLLER

DIFFERENCE=> Microcontroller is based on chip and microprocessor is not.

MACHINE LANGUAGE- The language that machine understand/binary language.

ASSEMBLY LANGUAGE- The language in which instructions are given but specifically for a program
like 8085 microprocessor.

HIGH LEVEL LANGUAGE- The language which humans can understand directly. Eg- C/C++.

USE OF CLOCK- Synchronization

TIMER- Instructions per cycle.

MEMORY OF 8085- 64Kb, It is internal memory.Depend on adress bus and not on data bus.2^16.

RECTIFIER- Analog to Digital { constant Amplitude}


Analog ex-AC current.
Digital ex- mi band.

You might also like