Microprocessor Lab Manual
Microprocessor Lab Manual
0
VISION OF THE DEPARTMENT
Electrical Engineering Department congregates the challenges of new technological
advancements to provide comprehensively trained, career-focused, morally strong accomplished
graduates, cutting-edge researchers by experimental learning which contribute to ever-changing
global society and serve as competent engineers.
1
PROGRAM OUTCOMES (POs)
Graduates of the Electrical Engineering program at JCBUST, YMCA will be able to:
PO1. Apply knowledge of mathematics, science, engineering fundamentals, and electrical
engineering specialization to the solution of engineering problems.
PO2. Identify, formulate, review literature, and analyze electrical engineering problems to design,
conduct experiments, analyze data, and interpret data.
PO3. Design solutions for electrical engineering problems and design system components of
processes that meet the desired needs with appropriate consideration for public health and
safety and cultural, societal, and environmental considerations.
PO4. Use research-based knowledge and research methods including design of experiments,
analysis and interpretation of data, and synthesis of the information to provide valid
conclusions in electrical engineering.
PO5. Create, select, and apply appropriate techniques, resources, and modern engineering and IT
tools including prediction and modeling to electrical engineering activities with an
understanding of the limitations.
PO6. Apply reasoning informed by contextual knowledge to assess societal, health, safety, legal,
and cultural issues and the consequent responsibilities relevant to professional engineering
practice.
PO7. Understand the impact of electrical engineering solutions in societal and environmental
contexts, and demonstrate the knowledge and need for sustainable development.
PO8. Apply ethical principles and commit to professional ethics and responsibilities and norms of
the engineering practice.
PO9. Function effectively as an individual, and as a member or leader in diverse teams, and in
multidisciplinary settings.
PO10. Communicate effectively on complex engineering activities with the engineering committee
and with society at large, such as being able to comprehend and write effective reports and
design documentation, and make effective presentations in electrical engineering.
PO11. Demonstrate knowledge and understanding of the engineering principles and management
principles and apply these to one’s own work, as a member and leader in a team, to manage
projects and in multidisciplinary environments.
PO12. Recognize the need for, and the preparation and ability to engage in independent research and
lifelong learning in the broadest context of technological changes in electrical engineering.
2
PROGRAM SPECIFIC OUTCOMES (PSOs)
PSO1. To apply state-of-the-art knowledge in analysis design and complex problem solving with
effective implementation in the multidisciplinary area of Electrical Engineering with due
regard to environmental and social concerns.
PSO2. To prepare graduates for continuous self-learning to apply technical knowledge and
pursue research in advanced areas in the field of Electrical Engineering for a successful
professional career to serve society ethically.
PEO1. To produce competent electrical engineering graduates with a strong foundation design,
analytics and problem-solving skills for successful professional careers in industry,
research and public service.
PEO2. To provide a stimulating research environment so as to motivate the students for higher
studies and innovation in the specific and allied domains of electrical engineering.
PEO3. To encourage the graduates to practice the profession following ethical codes, social
responsibility and accountability.
PEO4. To train students to communicate effectively in multidisciplinary environment.
PEO5. To imbibe an attitude in the graduates for life-long learning process.
3
Syllabus
Microprocessors Lab (ELPC553)
L-T-P Internal Marks – 15
0-0-2 External Marks-15
Total-50
List of Experiments
1. To study the architecture of microprocessor 8085 & 8086 and familiarization with their
hardware, commands & operation of microprocessor kit.
2. Write a program using 8085 & verify for addition of two 8-bit numbers (with and
without carry)
3. Write a program using 8085 & verify for:
i) subtraction of two 8-bit numbers.
ii) subtraction of two 16-bit numbers.
4. Write a program using using 8085 for multiplication of two 8-bit numbers by
bit- rotation method.
5. Write a program using using 8085 for division of two 8-bit numbers by repeated
subtraction method
6. Write a program using 8085 for finding square- root of a number & verify.
7. Write a program using 8085 to find out largest number in an array.
8. Write a program using 8085 to find out smallest number in an array
9. Write a program using 8085 to arrange the given numbers in ascending order.
10. Write a program using 8085 to find the sum of 8-bit numbers in series and display the result.
11. Write a program to interface ADC & DAC with 8085 & demonstrate generation of square
wave.
12. Write a program using 8086 for arranging an array of numbers indescending order & verify.
13. Write a program using 8086 for copying 12 bytes of data fromsource to destination & verify.
14. Write a program using 8086 for division of a defineddouble word by another word & verify.
15. Write a program to generate a square wave of 1 khz frequency on out 1 pin of 8253/54.
assume clock frequency is 1Mhz and address for control register = 0BH, counter1 = 09H and
counter 2 = 0AH.
4
VISION OF THE DEPARTMENT
To commit excellence in imparting knowledge through incubation and execution of high quality
innovative educational programs.
To develop the Research oriented culture to build national capabilities for excellent power
management.
To inculcate and harvest the moral values and ethical behaviour in the students through exposure of
self -discipline and personal integrity.
To develop a Centre of Research and Education generating knowledge and technologies which lay
ground work in shaping the future in the field of electrical engineering.
5
COURSE OBJECTIVES & OUTCOMES
Course objectives:
1. Enhance analytical skills to assess and study the basic architecture of 8085 and 8086
microprocessor.
2. Gain practical expertise in hardware, commands & operation of microprocessor kit.
3. Develop an in-depth understanding of assembly language programs in 8085 and 8086
to perform a given task.
4. Obtain hands-on experience in interfacing memory and I/O devices to 8085 using
peripheral devices.
Course Outcomes:
CO1. Students will be able to explain the basic architecture of 8085 and 8086
microprocessor.
CO2. Students will be able to demonstrate knowledge in hardware, commands & operation
of microprocessor kit.
CO3. Students will be able to write assembly language programs in 8085 and 8086 to
perform
a given task
CO4. Students will be able to perform interfacing of memory and I/O devices to 8085 using
peripheral devices
CO1 3 2 3 3 3 2 3 3 2 2 2 2 3 2
CO2 3 3 2 3 3 3 2 3 2 2 2 2 3 2
CO3 3 3 2 3 2 3 2 3 2 2 2 2 3 2
CO4 3 3 2 2 3 3 3 3 2 2 2 2 3 2
6
General Instructions
1. Be punctual and maintain discipline and silence in the lab.
2. Enter Laboratory with shoes
3. Handle instruments with utmost care and follow the procedure that has been instructed.
4. Strictly follow the written and verbal instructions given by the teacher / Lab Instructor. If
you do not understand the instructions, the handouts and the procedures, ask the
instructor or teacher.
5. Mobile phones should be switched off in the lab. Keep bags in the bag rack.
6. Keep the labs clean at all times, no food and drinks allowed inside the lab.
7. Do not insert connectors forcefully into the sockets.
8. Immediately report dangerous or exceptional conditions to the Lab instructor / teacher:
Equipment that is not working as expected, wires or connectors are broken, the
equipment that smells or “smokes”. If you are not sure what the problem is or what's
going on, switch off the Emergency shutdown.
9. Never use damaged instruments, wires or connectors. Hand over these parts to the Lab
instructor/Teacher.
10. Be sure of location of fire extinguishers and first aid kits in the laboratory.
11. After verification of program output, turn off power supply to the trainer kit. Do not take
any item from the lab without permission.
12. Observation book and lab record should be carried to each lab. Programs of current lab
session are to be written in Observation book and of previous lab session should be
written in Lab record book. Both the books should be corrected by the faculty in each lab.
13. Handle the electronic devices as indicated by the handout, the specifications in the data
sheet or other documentation.
14. Shut down the power supply after the experiment.
7
Microprocessors Lab
ELPC-553
Index
Exp. No Experiment/Program Page
No.
1. To study the architecture of microprocessor 8085 & 8086 and familiarization 9-11
with their hardware, commands & operation of microprocessor kit.
2. Write a program using 8085 & verify for addition of two 8-bit numbers (with 12-14
and without carry)
3. Write a program using 8085 & verify for: 15-17
a) subtraction of two 8-bit numbers
b) subtraction of two 16-bit numbers
4. Write a program using using 8085 for multiplication of two 8-bit numbers by18-19
bit-rotation method.
5. Write a program using using 8085 for division of two 8-bit numbers by 20-21
repeated subtraction method
6. Write a program using 8085 for finding square- root of a number & verify. 22-23
7. Write a program using 8085 to find out largest number in an array. 24-25
8. Write a program using 8085 to find out smallest number in an array 26-27
9. Write a program using 8085 to arrange the given numbers in ascending order. 28-29
10. Write a program using 8085 to find the sum of 8-bit numbers in series and 30-31
display the result.
11. Write a program to interface ADC & DAC with 8085 & demonstrate 32-33
generation of square wave.
12. Write a program using 8086 for arranging an array of numbers indescending 34-36
order & verify.
13. Write a program using 8086 for copying 12 bytes of data from source to 37-38
destination & verify.
14. Write a program using 8086 for division of a defineddouble word by 39-40
another word & verify.
15. Write a program to generate a square wave of 1 khz frequency on out 1 pin 41
of 8253/54. assume clock frequency is 1Mhz and address for control
register = 0BH, counter1 = 09H and counter 2 = 0AH.
8
EXPERIMENT NO.1
Aim: Study the architecture of microprocessor 8085 & 8086 and familiarization with their
hardware, commands & operation of microprocessor kit.
3. Registers: -
These are used for temporary storage of data and instruction. INTEL 8085 has following registers:
a) One 8 bit accumulator
b) Six 8 bit registers (B, C, D, E, H, L)
c) One 16 bit stack pointer, SP
d) One 16 bit program counter, PC
e) Instruction register
f) Status register
a. Temporary registers
PC contains the address of next [Link] holds the instruction until it is decoded. SP holds the
address of the stack top.
Accumulator is used during execution of program for temporary storage of data.
10
Fig 1. Pin Diagram of Intel 8085
ET-8085 has 28 keys and six-seven segment displays to communicate with the outside world. As
ET-8085 is switched on, a message – EL 85 is displayed on the display and all keys are in
command mode. The key board is as shown below:
Fig 2. Keyboard
11
The keyboard description is given below.
All commands are followed by a set of numeric parameters separated by PREV, NEXT & ‘ . ‘
(Execute) to work as delimiters.
A ‘-‘on the MSD of address display indicates the system is waiting for a command. If, instead of
a valid command, the user gives a data, the system display ’-Err’. A dot on the LSD of address
field indicates that the system expects an address. Whenever the data of any memory location is
changed, a dot is displayed on the LSD of DATA Field.
12
EXPERIMENT NO. 2(A)
Aim: Write a program using 8085 & verify for addition of two 8-bit numbers (without carry)
Theory (Program)
Memory Machine code Mnemonics Operands Commands
address
2000 21,01,25 LXI H,2501 Get address of 1st
no. in HL pair
2003 7E MOV A,M Move Ist no. in
accumulator
2004 23 INX H HL points the
address 2502H
2005 86 ADD M Add the 2nd no.
2006 23 INX H HL points 2503H
2007 77 MOV M,A Store result in
2503H.
2008 CF RST 1 Terminate the
program
Flow Chart:
Precautions:
Make sure that all the machine codes should be as per specified in the program.
13
EXPERIMENT NO. 2(B)
Aim: Write a program using 8085 & verify for addition of two 8-bit numbers (with carry)
Theory (Program)
14
Flow Chart:
Input Data
2601:13H
2602:31H
2603:12H
2604:10H
Output Data
2500: 25H
2501: 41H
2502: 00H
Precautions:-
Make sure that all the machine codes should be as per specified in the program.
15
EXPERIMENT NO. 3(A)
Aim: Write a program using 8085 & verify for subtraction of two 8-bit numbers. (display of
borrow).
Apparatus : 8085 microprocessor kit, 5V power supply, Keyboard.
Theory(program) :
Memory Opcode Mnemonics Operands Comments
address
2000 21,01,25 LXI H, 2501 Get address of 1st no. in HL pair
2003 7E MOV A, M Move 1st no. in accumulator
2004 23 INX H HL points 2502H.
2005 96 SUB M Subtract 2nd no. from 1st no.
2006 23 INX H HL points 2503 H.
2007 77 MOV M, A Move contents of acc. to memory
2008 76 HLT Terminate the program
Flowchart:-
Input data
2501: 20H
2502: 10H
Output data
:
2503: 10H
Precautions :
Make sure that all the machine codes should be as per specified in the program.
16
EXPERIMENT NO. 3(B)
Aim: Write a program using 8085 & verify for subtraction of two 16-bit numbers (display
of borrow)
Apparatus : 8085 microprocessor kit, 5V power supply, Keyboard.
Theory (Program) :
17
Input data
2501: 30H
2502: 40H
2503: 10H
2504: 20H
Output Data
2505: 20H
2506: 20H
Precautions:-
Make sure that all the machine codes should be as per specified in the program.
18
EXPERIMENT NO. 4
Aim: Write a program using 8085 for multiplication of two 8-bit numbersby bit rotation
method & verify.
Theory(program)
19
Flowchart :-
Input Data
2501 : 43
2502 : 07
Output Data
2503 : 05
2504 : 01
20
EXPERIMENT NO. 5
Aim: Write a program using 8085 for division of two 8-bit numbers byrepeated subtraction
method & test for typical data.
Theory (Program) :
Flow Chart:
21
Input Data
2501- Divisor
2502- Dividend
Output Data
2503- Remainder
2504- Quotient
Precautions:
Make sure that all the machine codes should be as per specified in the program.
22
EXPERIMENT No.6
Aim: Write a program using 8085 for finding square-root of a number & verify.
Apparatus : 8085 microprocessor kit, 5V power supply, Keyboard.
Theory(program):
Flow Chart:
23
Fig 8. Flowchart for finding square-root of a number
Input Data :
2500-10H
2501- 00H
Output Data :
2550- 04H
Precautions:
Make sure that all the machine codes should be as per specified in the program.
24
EXPERIMENT NO. 7
Aim : Write a program using 8085 to find out largest number in an array.
Theory(program)
25
Fig 9. Flow Chart for finding largest number in an array.
26
EXPERIMENT NO. 8
Aim : Write a program using 8085 to find out the smallest number in an array.
Theory(program)
27
Fig 10. Flow Chart for finding smallest number in an array.
28
EXPERIMENT NO. 9
Aim : Write a program using 8085 to arrange the given numbers in ascending order.
Theory(program)
29
Flow Chart :
Fig 11. Flow Chart for arranging a series of numbers in ascending order.
30
EXPERIMENT NO. 10
Aim : Write a program using 8085 to find the sum of given 8-bit nos. in a series and display
the result.
Theory(program)
31
Flow Chart :
32
EXPERIMENT NO. 11
Aim : Write a program to interface ADC & DAC with 8085 & demonstrategeneration of
square wave.
Description: A D/A converter chip DAC 0800 has been provided on the board of M85-07 to
enable the user to have analog output. This can be used for generating various waveforms or
for any closed loop applications. The chip has been used in I/O mapped mode and has an
address of (A0-A7), i.e. any of A0 to A7 can be used as an address. This chip has been
designed to give an output of 0 to 8 Volts. The output of DAC 0800 is coming at Pin No.13
of connector CN11.
Theory(Program)
33
Fig 13. Flowchart for interfacing ADC & DAC with 8085
PRECAUTIONS:-
Make sure that all the machine codes should be as per specified in the program.
34
EXPERIMENT NO.12
Aim : Write a program using 8086 for arranging an array of numbers indescending order
& verify.
Theory(Program)
35
Fig 14. Flow chart for arranging an array of numbers in descending order
35
INPUT DATA
0300 : 05
0301 : 00
0302 : 20
0303 : 25
0304 : 28
0305 : 15
0306 : 07
OUTPUT DATA
0302 : 28
0303 : 25
0304 : 20
0305 : 15
0306 : 07
PRECAUTIONS:-
Make sure that all the machine codes should be as per specified in the program.
36
EXPERIMENT NO. 13
Aim : Write a program using 8086 for copying 12 bytes of data from source to destination &
verify.
Theory(Program)
Flow Chart:-
Fig 15. Flow Chart for copying data bytes from source to destination.
37
INPUT DATA OUTPUT DATA
0300 : 0B
0301 : 00
0302 : 03 0202 : 03
0303 : 04 0203 : 04
0304 : 05 0204 : 05
0305 : 06 0205 : 06
0306 : 15 0206 : 15
0307 : 07 0207 : 07
0308 : 12 0208 : 12
0309 : 08 0209 : 08
030B : 0A 020B : 0A
030C : 0B 020C : 0B
030D : 0E 020D : 0E
Precautions:-
Make sure that all the machine codes should be as per specified in the program.
38
EXPERIMENT NO.14
Aim : Write a program using 8086 for division of a defined double wordby another word
& verify.
Theory(Program)
Flowchart:-
Fig 16. Flowchart for division of a defined double wordby another word
Input data
AX : 5678H
DX : 1234H
CX : 2525H
39
Output data
AX : 7D77(Quotient)
DX :
Precautions:- 0145(Remainder)
Make sure that all the machine codes should be as per specified in the program.
40
EXPERIMENT NO. 15
Aim: Write a program to generate a square wave of 1KHz frequency on OUT 1 pin of 8253/54.
Assume CLK1frequency is 1MHz and address for control register =0BH, counter 1 = 09H and
counter 2 = 0AH.
Control Word:
D7 D6 D5 D4 D3 D2 D1 D0
SC1 SC2 RW1 RW0 M2 M1 M0 BCD
0 1 1 1 0 1 1 1
Instructions Comment
MOV AL,77H Comment
OUT 0BH,AL Loads control word (77H) in; the control register.
MOV AL,00H ; loads lower byte (00) of the count
OUT 09H,AL
MOV AL,10 ; Loads higher byte (10) of the count
OUT 09H,AL
HLT
Precautions:-
Make sure that all the machine codes should be as per specified in the program.
41