Microprocessor 8085 Manual
Microprocessor 8085 Manual
THEORY:-
Let:-
(2040 H) = 14 H
(2050 H) = 89 H
Result = 14 H + 89 H = 9DH.
(2040 H) →A
A →B
(2050 H) → A
A+B → A
A → (2060 H)
PROCEDURE:-
Start
st
Get the 1 no.
nd
Get the 2 no.
End
Program:-
Memory Hex code Label Mnemonics Remarks
location
EXPERIMENT NO.-1(b)
AIM:- Addition of two 8-bit numbers (with carry).
► Write a program to add data bytes FFH & FFH. The result is greater than 8 bits.
THEORY:- In this program we will study the carry on addition of two 8-bit no’s.
microprocessor gets the carry bit status to accumulator .
FFH → A
FFH →C
A+C→A
A → E (result)
A = OOH
A+CY =A
A → D (carry)
PROCEDURE:-
Start
A+C=A
A=C
A=OOH
D=OOH
A+CY=A
A→D
End
Program:-
►Write a program to subtract the contents of memory location 2040H from contents
of memory location 2050H and store the result in memory location 2060H.
Let:-
(2040H) = 51H
(2041H) = 19H
PROCEDURE:-
Start
End
Program:-
]
EXPERIMENT NO.-2(b)
THEORY:- 16-bit subtraction cannot be performed directly. 1st subtract lower byte
of 2nd number from lower byte of 1st number then, subtract higher byte of 2nd number
and borrow from the previous subtraction.
( C200H ) – ( C2002H ) = ( C204H )
( C201H ) – ( C203H ) = ( C205H ).
PROCEDURE:-
Start
End
Program:-
A7 A6 A5 A4 A3 A2 A1 A0 CY B3 B2 B1 B0
0 0 0 0 0 0 0 0 0 0 1 0 1 Initial stage.
Step 1 0 0 0 0 0 0 0 0 0 1 0 1 0 Shift left by 1
0 0 0 0 0 0 0 0 0 1 0 1 0 Don’t add since cy=0
Step 2 0 0 0 0 0 0 0 0 1 0 1 0 0 Shift
0 0 0 0 1 1 0 0 1 0 1 0 0 Add multiplicand
since cy=1
PROCEDURE:-
Start
No.1→ DE
0000H = HL
No.2 → B
C= Counter
B→A
Shift left by one bit
A→B
N
Is
CY = 1
Yes
HL + DE = HL
C–1=C
N
Is
C=0
?
Y
End
Program:-
Memory location Hex code Label Mnemonics Remarks
EXPERIMENT NO.- 4
AIM:- Division of two 8-bit numbers.
► Write a program to divide No.1 by No.2 store the result in B register and
reminder in C register. (Draw flow charts)
► Write a program to perform 8-bit division, store the result in H & L registers.
Use shift and subtract method.
Start
No.1→A
00→B
No.2→C
A–C=A
B+ 1=B
Compare C whit A
NO IS
CY=1
Yes
A→C
End
Program:-
Memory location Hex code Level Mnemonics Remarks
EXPERIMENT NO.- 5
AIM:- Finding the largest number from an array.
THEORY:- To find largest of given no. of a given string we compare all given no.
one by one. Suppose given no. is 2, 4, 3, 1, 0 1st we compare 2 & 4 (2 is in register
A & 4 is in Register B).
A < B so put B into (A) & Compare with next number i.e. 3 Here A > B so directly
compare 4 with 1 then 0.
PROCEDURE:-
Start
M=B
Compare B with A
N IS
CY = 1
B=A
HL = HL + 1
C–1=C
IS N
Z=0
Y
A = ( 9210H)
End
Program:-
EXPERIMENT NO.- 6
AIM:- Finding the smallest number from an array.
THEORY:- Same as largest no. we compare two number one by one but comparison
process is reverse.
]
PROCEDURE:-
Start
M=B
Compare B with A
Y IS
CY = 1
B=A
HL = HL + 1
C–1=C
IS N
Z=0
Y
A = ( 9210H)
Program:- End
EXPERIMENT NO.- 7
AIM:- Interfacing of LED’s with 8085 MPU through 8255.
► Interface two LED’s using common anode & common cathode technique.
Design the circuit and draw the interface. Write a program to blink them,
alternatively, assume port address in I/O mapped I/O.
► For flashing two LEDs connect both LEDs to part A one at PA0 & other
to PA1.
► Connect anode of one LED to VCC & other to ground. i.e. known as
common anode & common cathode method.
PROCEDURE:-
Start
SP = FFFFH
A =80H
OUT CWR
A ← 03H
OUT port A
A = 00H
Out port A
Wait for some time
Program:-
PRECAUSTIONS:- Take starting address, port address and control word address
according to model of kit.
EXPERIMENT NO.-8
AIM:- Using 8086 write a well documented program for copying 12 bytes from
source to destination.
THEORY:- Let, Block 1 data is available from memory location block1, and
destination memory location be block 2. The number of bytes in block 1 is 10 i.e.
OAH. To start initialize counter CX register. Block 1 address be in SI register and
Block 2 address in DI register. Clear the direction flag. By using string Instruction
move the date from the memory pointed by SI register to memory pointed by DI
register. It is assumed that the data is to be moved within the same segment
therefore DS & ES are initialized to the same segment value.
PROCEDURE:-
Start
CX = count
DF = 0
Program:-
Memory location Hex code Label Mnemonics Remarks
EXPERIMENT NO.- 9
AIM:- Using 8086 write a program to find the sum of given ten numbers.
PROCEURE:-
Start
Sum = pointer +1
Count = count - 1
No Is
Count
=0
?
Yes
“Result” = Sum.
End
Program:-
EXPERIMENT NO.- 10
AIM:- Interfacing of seven segment display with 8085 through 8255 (PPI).
THEORY:- Take port A as output part. Connect PA0 – PA6 to different segment of
display. Output data 1 to PA0 – PA6 according to digit you want to
display. Take delay of 0.1 seconds call delay after one digit display.
PROCEDURE:-
Start
Initialize CW
Out port A
Call delay
Output port A
Call delay.
End
Program:-
Memory location Hex code Label Mnemonics Remarks