Microprocessor 8085 Journal
Microprocessor 8085 Journal
Microprocessor 8085 Journal
MP-408
Abhay Menon A
I15PH010
M.Sc. Physics
Semester VIII
Even Semester
1
CERTIFICATE
2
Table of Contents
3
EXPERIMENT-1
• AIM: To write an 8085 program to add 10 bytes of data stored from memory location
C100H to C109H and save the answer in memory location C200H.
• COMMENTS:
1. Register D is used as a counter for 10 data bytes, and hence is initialized with the
value 0AH.
2. Registers H and L are loaded with data pointing towards the memory location that
is required.
4
• RESULTS:
– Input:
Address value
C100H 01H
C101H 02H
C102H 03H
C103H 04H
C104H 05H
C105H 06H
C106H 07H
C107H 08H
C108H 09H
C109H 0AH
– Output:
Address value
C200H 37H
• CONCLUSION:
This program successfully adds numbers and stores them in a
specified location.
5
EXPERIMENT-2
• AIM: To write an 8085 program to reverse the order of 10 bytes stored from memory
locations C000H to C009H, and to store them in the same locations.
• COMMENTS:
1. Registers B and C are used as counters for 10 data bytes, and hence are initialized
with the value 0AH.
2. Registers H and L are loaded with data pointing towards the memory location that
is required.
3. We utilize a different memory space to temporarily store the values, and then transfer
them back in reverse order.
6
• RESULTS:
– Input:
Address value
C000H 00H
C001H 01H
C002H 02H
C003H 03H
C004H 04H
C005H 05H
C006H 06H
C007H 07H
C008H 08H
C009H 09H
– Output:
Address value
C000H 09H
C001H 08H
C002H 07H
C003H 06H
C004H 05H
C005H 04H
C006H 03H
C007H 02H
C008H 01H
C009H 00H
• CONCLUSION:
This program successfully reverses the order of data bytes starting
from a particular specified location.
7
EXPERIMENT-3
• AIM: To write an 8085 program to generate 10 Fibonacci numbers and store them in
memory locations starting from C000H.
• COMMENTS:
1. Register B is taken as a counter, and is initialized with the value 09H, since the first
2 values are given already.
2. The registers H and L are loaded with the pointer to the memory location where the
numbers are to stored.
8
• RESULTS:
– Output:
Address value
C000H 00H
C001H 01H
C002H 01H
C003H 02H
C004H 03H
C005H 05H
C006H 08H
C007H 0DH
C008H 15H
C009H 22H
• CONCLUSION:
This program successfully generates Fibonacci numbers, given that
the initial values are supplied to the program.
9
EXPERIMENT-4
• COMMENTS:
1. Registers B and C were used as counters, and are initialized with the value 0AH.
2. Registers H and L were loaded with values pointing to memory location C500H.
3. We use the Compare function, and then change the locations if both carry and zero
flags are not set.
10
• RESULTS:
– Input:
Address value
C500H 09H
C501H 08H
C502H 07H
C503H 06H
C504H 05H
C505H 04H
C506H 03H
C507H 02H
C508H 01H
C509H 00H
– Output:
Address value
C500H 00H
C501H 01H
C502H 02H
C503H 03H
C504H 04H
C505H 05H
C506H 06H
C507H 07H
C508H 08H
C509H 09H
• CONCLUSION:
The above program successfully sorts the list of numbers in as-
cending order.
11
EXPERIMENT-5
• COMMENTS:
1. Registers B and C were used as counters, and are initialized with the value 0AH.
2. Registers H and L were loaded with values pointing to memory location C500H.
3. We use the Compare function, and then change the locations if carry flag is not set.
12
• RESULTS:
– Input:
Address value
C500H 00H
C501H 01H
C502H 02H
C503H 03H
C504H 04H
C505H 05H
C506H 06H
C507H 07H
C508H 08H
C509H 09H
– Output:
Address value
C500H 09H
C501H 08H
C502H 07H
C503H 06H
C504H 05H
C505H 04H
C506H 03H
C507H 02H
C508H 01H
C509H 00H
• CONCLUSION:
The above program successfully sorts the list of numbers in de-
scending order.
13
EXPERIMENT-6
• AIM: To write an 8085 program to count number of data bytes contining postive,
negative, and zero from a set of data bytes stored from C100H to C109H.
14
• COMMENTS:
• RESULTS:
– Input:
Address value
C100H 00H
C101H A8H
C102H 01H
C103h 02H
C104H 03H
C105H 04H
C106H A7H
C107H 08H
C108H 05H
C109H 09H
– Output:
Address value
C10BH 02H
C10CH 07H
C10DH 01H
• CONCLUSION:
The above program counts the number of positive, negative, and
zeros in the given list of data points.
15
EXPERIMENT-7
• AIM: To write an 8085 program to count the number of odd, even, and zeros from the
given list of data starting from memory location C100H to C109H
16
• COMMENTS:
• RESULTS:
– Input:
Address value
C100H 00H
C101H 01H
C102H 02H
C103h 03H
C104H 04H
C105H 05H
C106H 06H
C107H 07H
C108H 08H
C109H 09H
– Output:
Address value
C10BH 05H
C10CH 04H
C10DH 01H
• CONCLUSION:
The above program is able to count the number of odd, even and
zero data bytes from a given list of data.
17
EXPERIMENT-8
• AIM: To write an 8085 program to convert a BCD number stored at memory location
C500H to a hexadecimal number, and to store it in memory location C501H.
• COMMENTS:
1. We add the left most nibble ten times and the right most nibble to the result in
accumulator to obtain the hexadecimal equivalent.
18
• RESULTS:
– Input:
Address value
C500H 35
– Output:
Address value
C501H 53H
• CONCLUSION:
The above program is able to convert data from BCD to Hex.
19
EXPERIMENT-9
20
• COMMENTS:
1. We subtract 10 from the accumulator until the accumulator holds data less than 10.
2. The number of times this subtraction is carried out is recorded in the register C and
ultimately contains the left nibble of BCD number.
3. The result of the subtraction in accumulator (A) is the right nibble of the desired
BCD number.
• RESULTS:
– Input:
Address value
C500H 53H
– Output:
Address value
C501H 35
• CONCLUSION:
The above program can be used to convert Hex codes into BCD
codes.
21
EXPERIMENT-10
• AIM: Write an 8085 assembly language program to count the number of vowels (capital
and small) in a given string.
a=61, e=65, i=69, o=6F, u=75, A=41, E=45, I=49, O=4F, U=55.
22
• COMMENTS:
1. CPI is used to compare the value of the accumulator with the immediate number.
2. SUI subtracts the immediate number for the value of accumulator.
3. ANI 0FH used for masking.
• RESULTS:
– Input:
Address value
C100 H 41
C101 H 45
C102 H 65
C103 H 55
C104 H 4F
C105 H 00
– Output:
Address value
C106 H 05H
• CONCLUSION:
The above program is used to check the number of vowels in a
string. It uses the hex equivalent of ASCII codes, and checks for the appropriate code.
23
EXPERIMENT-11
• AIM: To write an 8085 program to interface 8255 with the 8085 chip, and to turn on
the LEDs.
• COMMENTS:
1. Register E is acting as a counter, and is initialized with 08H, since there are only 8
pins to each port.
2. Since we, know that the LED’s are interfaced in such a way that each nibble gets
a diode, we can initialize D as 01H and keep multiplying by 2, to get each port
accessed.
24
• RESULTS:
– Output:
• CONCLUSION:
We have interfaced the 8255 chip with the 8085 microprocessor,
and we can see that out of the 24 pins, 20 are used, while 4 are not.
25
EXPERIMENT-12
• AIM: To write an 8085 program to make a running LED pattern with a time gap of
0.77 seconds.
26
• COMMENTS:
1. Time delay = No. of T states Outside loop + ( Count * No. of T state inside loop)
- 3T
= (14 *0.33 microsec) + (FFFF *36*0.33 µs+3*0.33 µs)
Time delay = 0.77 sec
• RESULTS:
In the result we see the developed pattern of running LEDs with a time lapse of 0.77
seconds.
• CONCLUSION:
We have written a program to generate a pattern of lights with a
fixed delay.
27