Download Anna University B-Tech ECE 5th Sem Microprocessor and Microcontroller MM Lab Manual Question Paper

Download Anna University B.Tech (Bachelor of Technology) ECE (Electronics And Communications Engineering) 5th Sem Microprocessor and Microcontroller MM Lab Manual Question Paper.

1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING


EC6513 ? MICROPROCESSOR AND MICROCONTROLLERLABORATORY


V SEMESTER - R 2013










Name : _______________________________________
Register No. : _______________________________________
Section : _______________________________________



LABORATORY MANUAL
FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING


EC6513 ? MICROPROCESSOR AND MICROCONTROLLERLABORATORY


V SEMESTER - R 2013










Name : _______________________________________
Register No. : _______________________________________
Section : _______________________________________



LABORATORY MANUAL
2 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY


C01 - To learn the working of ARM processor
C02 - To introduce ALP concepts and features
C03 - To write ALP for arithmetic and logical operations in 8086 and 8051
C04 - To differentiate Serial and Parallel Interface
C05 - To interface different I/Os with Microprocessors
C06 - To be familiar with MASM
.




1. Write programs in ARM for a specific Application
2. Write ALP Programs for fixed and Floating Point and Arithmetic
3. Interface different I/Os with processor and Generate waveforms using Microprocessors
4. Execute Programs in 8051
5. Assess the performance of optical devices: light sources, fibers and detectors from both physical and system
point of view

INTRODUCTION
This course illustrates the concepts covered in course CS6412 and provides students with hands-on
experience in Assembly language programs.
PREREQUISITE:
1. Digital Electronics
EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
Lecture
No./Session No.
Name of the Experiment
Course
objectives
Proposed
date

1,2,3
Introduction to lab
CO1

CYCLE I - 8086 PROGRAMS USING KITS AND MASM
4,5,6 Basic arithmetic and Logical operations CO2
COURSE OBJECTIVES
COURSE OUTCOMES
FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING


EC6513 ? MICROPROCESSOR AND MICROCONTROLLERLABORATORY


V SEMESTER - R 2013










Name : _______________________________________
Register No. : _______________________________________
Section : _______________________________________



LABORATORY MANUAL
2 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY


C01 - To learn the working of ARM processor
C02 - To introduce ALP concepts and features
C03 - To write ALP for arithmetic and logical operations in 8086 and 8051
C04 - To differentiate Serial and Parallel Interface
C05 - To interface different I/Os with Microprocessors
C06 - To be familiar with MASM
.




1. Write programs in ARM for a specific Application
2. Write ALP Programs for fixed and Floating Point and Arithmetic
3. Interface different I/Os with processor and Generate waveforms using Microprocessors
4. Execute Programs in 8051
5. Assess the performance of optical devices: light sources, fibers and detectors from both physical and system
point of view

INTRODUCTION
This course illustrates the concepts covered in course CS6412 and provides students with hands-on
experience in Assembly language programs.
PREREQUISITE:
1. Digital Electronics
EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
Lecture
No./Session No.
Name of the Experiment
Course
objectives
Proposed
date

1,2,3
Introduction to lab
CO1

CYCLE I - 8086 PROGRAMS USING KITS AND MASM
4,5,6 Basic arithmetic and Logical operations CO2
COURSE OBJECTIVES
COURSE OUTCOMES
3 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00













7,8,9 Decimal arithmetic and Code conversion CO3
10,11,12
Move a data block without overlap
CO3
Matrix operations
13,14,15 Searching and Sorting a sting in a given array CO2
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
16,17,18 D/A interface and Waveform Generation CO4
19,20,21 A/D interface CO5
22,23,24 Key board and Display CO5
25,26,27
Stepper motor control CO2
Traffic light control CO5
28,29,30
Digital clock CO6
Serial interface and Parallel interface CO4
CYCLE III - 8051 PROGRAMS USING KITS AND MASM
31,32,33 Basic arithmetic and Logical operations CO1
34,35,36
Square and Cube program, Find 2?s complement of a number
CO5
Unpacked BCD to ASCII
37,38,39
Password checking and Print RAM size with system date
CO6
Counters and Time Delay
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
40,41,42 Sorting of an array using 8051 CO2
43,44,45
Separate odd and even numbers using 8086


CO3
Sum of N consecutive numbers using 8086
FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING


EC6513 ? MICROPROCESSOR AND MICROCONTROLLERLABORATORY


V SEMESTER - R 2013










Name : _______________________________________
Register No. : _______________________________________
Section : _______________________________________



LABORATORY MANUAL
2 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY


C01 - To learn the working of ARM processor
C02 - To introduce ALP concepts and features
C03 - To write ALP for arithmetic and logical operations in 8086 and 8051
C04 - To differentiate Serial and Parallel Interface
C05 - To interface different I/Os with Microprocessors
C06 - To be familiar with MASM
.




1. Write programs in ARM for a specific Application
2. Write ALP Programs for fixed and Floating Point and Arithmetic
3. Interface different I/Os with processor and Generate waveforms using Microprocessors
4. Execute Programs in 8051
5. Assess the performance of optical devices: light sources, fibers and detectors from both physical and system
point of view

INTRODUCTION
This course illustrates the concepts covered in course CS6412 and provides students with hands-on
experience in Assembly language programs.
PREREQUISITE:
1. Digital Electronics
EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
Lecture
No./Session No.
Name of the Experiment
Course
objectives
Proposed
date

1,2,3
Introduction to lab
CO1

CYCLE I - 8086 PROGRAMS USING KITS AND MASM
4,5,6 Basic arithmetic and Logical operations CO2
COURSE OBJECTIVES
COURSE OUTCOMES
3 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00













7,8,9 Decimal arithmetic and Code conversion CO3
10,11,12
Move a data block without overlap
CO3
Matrix operations
13,14,15 Searching and Sorting a sting in a given array CO2
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
16,17,18 D/A interface and Waveform Generation CO4
19,20,21 A/D interface CO5
22,23,24 Key board and Display CO5
25,26,27
Stepper motor control CO2
Traffic light control CO5
28,29,30
Digital clock CO6
Serial interface and Parallel interface CO4
CYCLE III - 8051 PROGRAMS USING KITS AND MASM
31,32,33 Basic arithmetic and Logical operations CO1
34,35,36
Square and Cube program, Find 2?s complement of a number
CO5
Unpacked BCD to ASCII
37,38,39
Password checking and Print RAM size with system date
CO6
Counters and Time Delay
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
40,41,42 Sorting of an array using 8051 CO2
43,44,45
Separate odd and even numbers using 8086


CO3
Sum of N consecutive numbers using 8086
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00




College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING




To impart professional education integrated with human values to the younger generation, so as to shape
them as proficient and dedicated engineers, capable of providing comprehensive solutions to the challenges in
deploying technology for the service of humanity



? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices


VISION
MISSION
VISION
MISSION
FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING


EC6513 ? MICROPROCESSOR AND MICROCONTROLLERLABORATORY


V SEMESTER - R 2013










Name : _______________________________________
Register No. : _______________________________________
Section : _______________________________________



LABORATORY MANUAL
2 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY


C01 - To learn the working of ARM processor
C02 - To introduce ALP concepts and features
C03 - To write ALP for arithmetic and logical operations in 8086 and 8051
C04 - To differentiate Serial and Parallel Interface
C05 - To interface different I/Os with Microprocessors
C06 - To be familiar with MASM
.




1. Write programs in ARM for a specific Application
2. Write ALP Programs for fixed and Floating Point and Arithmetic
3. Interface different I/Os with processor and Generate waveforms using Microprocessors
4. Execute Programs in 8051
5. Assess the performance of optical devices: light sources, fibers and detectors from both physical and system
point of view

INTRODUCTION
This course illustrates the concepts covered in course CS6412 and provides students with hands-on
experience in Assembly language programs.
PREREQUISITE:
1. Digital Electronics
EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
Lecture
No./Session No.
Name of the Experiment
Course
objectives
Proposed
date

1,2,3
Introduction to lab
CO1

CYCLE I - 8086 PROGRAMS USING KITS AND MASM
4,5,6 Basic arithmetic and Logical operations CO2
COURSE OBJECTIVES
COURSE OUTCOMES
3 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00













7,8,9 Decimal arithmetic and Code conversion CO3
10,11,12
Move a data block without overlap
CO3
Matrix operations
13,14,15 Searching and Sorting a sting in a given array CO2
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
16,17,18 D/A interface and Waveform Generation CO4
19,20,21 A/D interface CO5
22,23,24 Key board and Display CO5
25,26,27
Stepper motor control CO2
Traffic light control CO5
28,29,30
Digital clock CO6
Serial interface and Parallel interface CO4
CYCLE III - 8051 PROGRAMS USING KITS AND MASM
31,32,33 Basic arithmetic and Logical operations CO1
34,35,36
Square and Cube program, Find 2?s complement of a number
CO5
Unpacked BCD to ASCII
37,38,39
Password checking and Print RAM size with system date
CO6
Counters and Time Delay
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
40,41,42 Sorting of an array using 8051 CO2
43,44,45
Separate odd and even numbers using 8086


CO3
Sum of N consecutive numbers using 8086
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00




College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING




To impart professional education integrated with human values to the younger generation, so as to shape
them as proficient and dedicated engineers, capable of providing comprehensive solutions to the challenges in
deploying technology for the service of humanity



? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices


VISION
MISSION
VISION
MISSION
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of
engineering that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this
enables to find solutions for real time problem in industry and organization and to design products
requiring interdisciplinary skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up
their communication skills, individual leadership and supportive qualities and to develop them to adapt and
work in ever changing technologies
5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees











FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING


EC6513 ? MICROPROCESSOR AND MICROCONTROLLERLABORATORY


V SEMESTER - R 2013










Name : _______________________________________
Register No. : _______________________________________
Section : _______________________________________



LABORATORY MANUAL
2 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY


C01 - To learn the working of ARM processor
C02 - To introduce ALP concepts and features
C03 - To write ALP for arithmetic and logical operations in 8086 and 8051
C04 - To differentiate Serial and Parallel Interface
C05 - To interface different I/Os with Microprocessors
C06 - To be familiar with MASM
.




1. Write programs in ARM for a specific Application
2. Write ALP Programs for fixed and Floating Point and Arithmetic
3. Interface different I/Os with processor and Generate waveforms using Microprocessors
4. Execute Programs in 8051
5. Assess the performance of optical devices: light sources, fibers and detectors from both physical and system
point of view

INTRODUCTION
This course illustrates the concepts covered in course CS6412 and provides students with hands-on
experience in Assembly language programs.
PREREQUISITE:
1. Digital Electronics
EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
Lecture
No./Session No.
Name of the Experiment
Course
objectives
Proposed
date

1,2,3
Introduction to lab
CO1

CYCLE I - 8086 PROGRAMS USING KITS AND MASM
4,5,6 Basic arithmetic and Logical operations CO2
COURSE OBJECTIVES
COURSE OUTCOMES
3 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00













7,8,9 Decimal arithmetic and Code conversion CO3
10,11,12
Move a data block without overlap
CO3
Matrix operations
13,14,15 Searching and Sorting a sting in a given array CO2
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
16,17,18 D/A interface and Waveform Generation CO4
19,20,21 A/D interface CO5
22,23,24 Key board and Display CO5
25,26,27
Stepper motor control CO2
Traffic light control CO5
28,29,30
Digital clock CO6
Serial interface and Parallel interface CO4
CYCLE III - 8051 PROGRAMS USING KITS AND MASM
31,32,33 Basic arithmetic and Logical operations CO1
34,35,36
Square and Cube program, Find 2?s complement of a number
CO5
Unpacked BCD to ASCII
37,38,39
Password checking and Print RAM size with system date
CO6
Counters and Time Delay
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
40,41,42 Sorting of an array using 8051 CO2
43,44,45
Separate odd and even numbers using 8086


CO3
Sum of N consecutive numbers using 8086
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00




College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING




To impart professional education integrated with human values to the younger generation, so as to shape
them as proficient and dedicated engineers, capable of providing comprehensive solutions to the challenges in
deploying technology for the service of humanity



? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices


VISION
MISSION
VISION
MISSION
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of
engineering that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this
enables to find solutions for real time problem in industry and organization and to design products
requiring interdisciplinary skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up
their communication skills, individual leadership and supportive qualities and to develop them to adapt and
work in ever changing technologies
5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees











6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer
Science and Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the
career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both
verbal and written forms
i) To work in a team as team member or a leader and make unique contributions and work with
coordination
j) To engage lifelong learning and exhibit their technical skills
k) To develop and manage projects in multidisciplinary environments










FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING


EC6513 ? MICROPROCESSOR AND MICROCONTROLLERLABORATORY


V SEMESTER - R 2013










Name : _______________________________________
Register No. : _______________________________________
Section : _______________________________________



LABORATORY MANUAL
2 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY


C01 - To learn the working of ARM processor
C02 - To introduce ALP concepts and features
C03 - To write ALP for arithmetic and logical operations in 8086 and 8051
C04 - To differentiate Serial and Parallel Interface
C05 - To interface different I/Os with Microprocessors
C06 - To be familiar with MASM
.




1. Write programs in ARM for a specific Application
2. Write ALP Programs for fixed and Floating Point and Arithmetic
3. Interface different I/Os with processor and Generate waveforms using Microprocessors
4. Execute Programs in 8051
5. Assess the performance of optical devices: light sources, fibers and detectors from both physical and system
point of view

INTRODUCTION
This course illustrates the concepts covered in course CS6412 and provides students with hands-on
experience in Assembly language programs.
PREREQUISITE:
1. Digital Electronics
EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
Lecture
No./Session No.
Name of the Experiment
Course
objectives
Proposed
date

1,2,3
Introduction to lab
CO1

CYCLE I - 8086 PROGRAMS USING KITS AND MASM
4,5,6 Basic arithmetic and Logical operations CO2
COURSE OBJECTIVES
COURSE OUTCOMES
3 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00













7,8,9 Decimal arithmetic and Code conversion CO3
10,11,12
Move a data block without overlap
CO3
Matrix operations
13,14,15 Searching and Sorting a sting in a given array CO2
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
16,17,18 D/A interface and Waveform Generation CO4
19,20,21 A/D interface CO5
22,23,24 Key board and Display CO5
25,26,27
Stepper motor control CO2
Traffic light control CO5
28,29,30
Digital clock CO6
Serial interface and Parallel interface CO4
CYCLE III - 8051 PROGRAMS USING KITS AND MASM
31,32,33 Basic arithmetic and Logical operations CO1
34,35,36
Square and Cube program, Find 2?s complement of a number
CO5
Unpacked BCD to ASCII
37,38,39
Password checking and Print RAM size with system date
CO6
Counters and Time Delay
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
40,41,42 Sorting of an array using 8051 CO2
43,44,45
Separate odd and even numbers using 8086


CO3
Sum of N consecutive numbers using 8086
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00




College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING




To impart professional education integrated with human values to the younger generation, so as to shape
them as proficient and dedicated engineers, capable of providing comprehensive solutions to the challenges in
deploying technology for the service of humanity



? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices


VISION
MISSION
VISION
MISSION
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of
engineering that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this
enables to find solutions for real time problem in industry and organization and to design products
requiring interdisciplinary skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up
their communication skills, individual leadership and supportive qualities and to develop them to adapt and
work in ever changing technologies
5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees











6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer
Science and Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the
career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both
verbal and written forms
i) To work in a team as team member or a leader and make unique contributions and work with
coordination
j) To engage lifelong learning and exhibit their technical skills
k) To develop and manage projects in multidisciplinary environments










7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER
LABORATORY
SYLLABUS

? To learn the working of ARM processor
? To introduce ALP concepts and features
? To write ALP for arithmetic and logical operations in 8086 and 8051
? To differentiate Serial and Parallel Interface
? To interface different I/Os with Microprocessors
? To be familiar with MASM
LIST OF EXPERIMENTS:
8086 Programs using kits and MASM
1. Basic arithmetic and Logical operations
2. Move a data block without overlap
3. Code conversion, decimal arithmetic and Matrix operations.
4. Floating point operations, string manipulations, sorting and searching
5. Password checking, Print RAM size and system date
6. Counters and Time Delay
Peripherals and Interfacing Experiments
7. Traffic light control
8. Stepper motor control
9. Digital clock
10. Key board and Display
11. Printer status
12. Serial interface and Parallel interface
13. A/D and D/A interface and Waveform Generation 8051
Experiments using kits and MASM
14. Basic arithmetic and Logical operations
15. Square and Cube program, Find 2 ?s complement of a number
16. Unpacked BCD to ASCII

? Write programs in ARM for a specific Application
? Write ALP Programs for fixed and Floating Point and Arithmetic
? Interface different I/Os with processor and Generate waveforms using Microprocessors
? Execute Programs in 8051
? Assess the performance of optical devices: light sources, fibers and detectors from both physical and
system point of view


COURSE OUTCOMES
COURSE OBJECTIVES
FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING


EC6513 ? MICROPROCESSOR AND MICROCONTROLLERLABORATORY


V SEMESTER - R 2013










Name : _______________________________________
Register No. : _______________________________________
Section : _______________________________________



LABORATORY MANUAL
2 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY


C01 - To learn the working of ARM processor
C02 - To introduce ALP concepts and features
C03 - To write ALP for arithmetic and logical operations in 8086 and 8051
C04 - To differentiate Serial and Parallel Interface
C05 - To interface different I/Os with Microprocessors
C06 - To be familiar with MASM
.




1. Write programs in ARM for a specific Application
2. Write ALP Programs for fixed and Floating Point and Arithmetic
3. Interface different I/Os with processor and Generate waveforms using Microprocessors
4. Execute Programs in 8051
5. Assess the performance of optical devices: light sources, fibers and detectors from both physical and system
point of view

INTRODUCTION
This course illustrates the concepts covered in course CS6412 and provides students with hands-on
experience in Assembly language programs.
PREREQUISITE:
1. Digital Electronics
EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
Lecture
No./Session No.
Name of the Experiment
Course
objectives
Proposed
date

1,2,3
Introduction to lab
CO1

CYCLE I - 8086 PROGRAMS USING KITS AND MASM
4,5,6 Basic arithmetic and Logical operations CO2
COURSE OBJECTIVES
COURSE OUTCOMES
3 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00













7,8,9 Decimal arithmetic and Code conversion CO3
10,11,12
Move a data block without overlap
CO3
Matrix operations
13,14,15 Searching and Sorting a sting in a given array CO2
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
16,17,18 D/A interface and Waveform Generation CO4
19,20,21 A/D interface CO5
22,23,24 Key board and Display CO5
25,26,27
Stepper motor control CO2
Traffic light control CO5
28,29,30
Digital clock CO6
Serial interface and Parallel interface CO4
CYCLE III - 8051 PROGRAMS USING KITS AND MASM
31,32,33 Basic arithmetic and Logical operations CO1
34,35,36
Square and Cube program, Find 2?s complement of a number
CO5
Unpacked BCD to ASCII
37,38,39
Password checking and Print RAM size with system date
CO6
Counters and Time Delay
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
40,41,42 Sorting of an array using 8051 CO2
43,44,45
Separate odd and even numbers using 8086


CO3
Sum of N consecutive numbers using 8086
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00




College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING




To impart professional education integrated with human values to the younger generation, so as to shape
them as proficient and dedicated engineers, capable of providing comprehensive solutions to the challenges in
deploying technology for the service of humanity



? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices


VISION
MISSION
VISION
MISSION
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of
engineering that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this
enables to find solutions for real time problem in industry and organization and to design products
requiring interdisciplinary skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up
their communication skills, individual leadership and supportive qualities and to develop them to adapt and
work in ever changing technologies
5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees











6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer
Science and Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the
career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both
verbal and written forms
i) To work in a team as team member or a leader and make unique contributions and work with
coordination
j) To engage lifelong learning and exhibit their technical skills
k) To develop and manage projects in multidisciplinary environments










7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER
LABORATORY
SYLLABUS

? To learn the working of ARM processor
? To introduce ALP concepts and features
? To write ALP for arithmetic and logical operations in 8086 and 8051
? To differentiate Serial and Parallel Interface
? To interface different I/Os with Microprocessors
? To be familiar with MASM
LIST OF EXPERIMENTS:
8086 Programs using kits and MASM
1. Basic arithmetic and Logical operations
2. Move a data block without overlap
3. Code conversion, decimal arithmetic and Matrix operations.
4. Floating point operations, string manipulations, sorting and searching
5. Password checking, Print RAM size and system date
6. Counters and Time Delay
Peripherals and Interfacing Experiments
7. Traffic light control
8. Stepper motor control
9. Digital clock
10. Key board and Display
11. Printer status
12. Serial interface and Parallel interface
13. A/D and D/A interface and Waveform Generation 8051
Experiments using kits and MASM
14. Basic arithmetic and Logical operations
15. Square and Cube program, Find 2 ?s complement of a number
16. Unpacked BCD to ASCII

? Write programs in ARM for a specific Application
? Write ALP Programs for fixed and Floating Point and Arithmetic
? Interface different I/Os with processor and Generate waveforms using Microprocessors
? Execute Programs in 8051
? Assess the performance of optical devices: light sources, fibers and detectors from both physical and
system point of view


COURSE OUTCOMES
COURSE OBJECTIVES
8 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 - 8086 PROGRAMS USING KITS AND MASM
1 Basic arithmetic and Logical operations 10
2 Decimal arithmetic and Code conversion 15
3 Move a data block without overlap 21
4 Matrix operations 24
5 Searching and Sorting a sting in a given array 27
6 Password checking and Print RAM size with system date 33
7 Counters and Time Delay 36
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
8 Stepper motor control 39
9 Traffic light control 42
10 Digital clock 47
11 Serial interface and Parallel interface 50
12 A/D interface 54
13 Key board and Display 57
14 D/A interface and Waveform Generation 60
CYCLE 3 - 8051 PROGRAMS USING KITS AND MASM
15 Basic arithmetic and Logical operations 64
16 Square and Cube program, Find 2?s complement of a number 69
17 Unpacked BCD to ASCII 71
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
18 Sorting of an array using 8051 74
19 Separate odd and even numbers using 8086 77
20 Sum of N consecutive numbers using 8086 80

FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING


EC6513 ? MICROPROCESSOR AND MICROCONTROLLERLABORATORY


V SEMESTER - R 2013










Name : _______________________________________
Register No. : _______________________________________
Section : _______________________________________



LABORATORY MANUAL
2 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY


C01 - To learn the working of ARM processor
C02 - To introduce ALP concepts and features
C03 - To write ALP for arithmetic and logical operations in 8086 and 8051
C04 - To differentiate Serial and Parallel Interface
C05 - To interface different I/Os with Microprocessors
C06 - To be familiar with MASM
.




1. Write programs in ARM for a specific Application
2. Write ALP Programs for fixed and Floating Point and Arithmetic
3. Interface different I/Os with processor and Generate waveforms using Microprocessors
4. Execute Programs in 8051
5. Assess the performance of optical devices: light sources, fibers and detectors from both physical and system
point of view

INTRODUCTION
This course illustrates the concepts covered in course CS6412 and provides students with hands-on
experience in Assembly language programs.
PREREQUISITE:
1. Digital Electronics
EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
Lecture
No./Session No.
Name of the Experiment
Course
objectives
Proposed
date

1,2,3
Introduction to lab
CO1

CYCLE I - 8086 PROGRAMS USING KITS AND MASM
4,5,6 Basic arithmetic and Logical operations CO2
COURSE OBJECTIVES
COURSE OUTCOMES
3 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00













7,8,9 Decimal arithmetic and Code conversion CO3
10,11,12
Move a data block without overlap
CO3
Matrix operations
13,14,15 Searching and Sorting a sting in a given array CO2
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
16,17,18 D/A interface and Waveform Generation CO4
19,20,21 A/D interface CO5
22,23,24 Key board and Display CO5
25,26,27
Stepper motor control CO2
Traffic light control CO5
28,29,30
Digital clock CO6
Serial interface and Parallel interface CO4
CYCLE III - 8051 PROGRAMS USING KITS AND MASM
31,32,33 Basic arithmetic and Logical operations CO1
34,35,36
Square and Cube program, Find 2?s complement of a number
CO5
Unpacked BCD to ASCII
37,38,39
Password checking and Print RAM size with system date
CO6
Counters and Time Delay
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
40,41,42 Sorting of an array using 8051 CO2
43,44,45
Separate odd and even numbers using 8086


CO3
Sum of N consecutive numbers using 8086
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00




College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING




To impart professional education integrated with human values to the younger generation, so as to shape
them as proficient and dedicated engineers, capable of providing comprehensive solutions to the challenges in
deploying technology for the service of humanity



? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices


VISION
MISSION
VISION
MISSION
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of
engineering that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this
enables to find solutions for real time problem in industry and organization and to design products
requiring interdisciplinary skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up
their communication skills, individual leadership and supportive qualities and to develop them to adapt and
work in ever changing technologies
5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees











6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer
Science and Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the
career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both
verbal and written forms
i) To work in a team as team member or a leader and make unique contributions and work with
coordination
j) To engage lifelong learning and exhibit their technical skills
k) To develop and manage projects in multidisciplinary environments










7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER
LABORATORY
SYLLABUS

? To learn the working of ARM processor
? To introduce ALP concepts and features
? To write ALP for arithmetic and logical operations in 8086 and 8051
? To differentiate Serial and Parallel Interface
? To interface different I/Os with Microprocessors
? To be familiar with MASM
LIST OF EXPERIMENTS:
8086 Programs using kits and MASM
1. Basic arithmetic and Logical operations
2. Move a data block without overlap
3. Code conversion, decimal arithmetic and Matrix operations.
4. Floating point operations, string manipulations, sorting and searching
5. Password checking, Print RAM size and system date
6. Counters and Time Delay
Peripherals and Interfacing Experiments
7. Traffic light control
8. Stepper motor control
9. Digital clock
10. Key board and Display
11. Printer status
12. Serial interface and Parallel interface
13. A/D and D/A interface and Waveform Generation 8051
Experiments using kits and MASM
14. Basic arithmetic and Logical operations
15. Square and Cube program, Find 2 ?s complement of a number
16. Unpacked BCD to ASCII

? Write programs in ARM for a specific Application
? Write ALP Programs for fixed and Floating Point and Arithmetic
? Interface different I/Os with processor and Generate waveforms using Microprocessors
? Execute Programs in 8051
? Assess the performance of optical devices: light sources, fibers and detectors from both physical and
system point of view


COURSE OUTCOMES
COURSE OBJECTIVES
8 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 - 8086 PROGRAMS USING KITS AND MASM
1 Basic arithmetic and Logical operations 10
2 Decimal arithmetic and Code conversion 15
3 Move a data block without overlap 21
4 Matrix operations 24
5 Searching and Sorting a sting in a given array 27
6 Password checking and Print RAM size with system date 33
7 Counters and Time Delay 36
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
8 Stepper motor control 39
9 Traffic light control 42
10 Digital clock 47
11 Serial interface and Parallel interface 50
12 A/D interface 54
13 Key board and Display 57
14 D/A interface and Waveform Generation 60
CYCLE 3 - 8051 PROGRAMS USING KITS AND MASM
15 Basic arithmetic and Logical operations 64
16 Square and Cube program, Find 2?s complement of a number 69
17 Unpacked BCD to ASCII 71
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
18 Sorting of an array using 8051 74
19 Separate odd and even numbers using 8086 77
20 Sum of N consecutive numbers using 8086 80

9 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING


EC6513 ? MICROPROCESSOR AND MICROCONTROLLERLABORATORY


V SEMESTER - R 2013










Name : _______________________________________
Register No. : _______________________________________
Section : _______________________________________



LABORATORY MANUAL
2 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY


C01 - To learn the working of ARM processor
C02 - To introduce ALP concepts and features
C03 - To write ALP for arithmetic and logical operations in 8086 and 8051
C04 - To differentiate Serial and Parallel Interface
C05 - To interface different I/Os with Microprocessors
C06 - To be familiar with MASM
.




1. Write programs in ARM for a specific Application
2. Write ALP Programs for fixed and Floating Point and Arithmetic
3. Interface different I/Os with processor and Generate waveforms using Microprocessors
4. Execute Programs in 8051
5. Assess the performance of optical devices: light sources, fibers and detectors from both physical and system
point of view

INTRODUCTION
This course illustrates the concepts covered in course CS6412 and provides students with hands-on
experience in Assembly language programs.
PREREQUISITE:
1. Digital Electronics
EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
Lecture
No./Session No.
Name of the Experiment
Course
objectives
Proposed
date

1,2,3
Introduction to lab
CO1

CYCLE I - 8086 PROGRAMS USING KITS AND MASM
4,5,6 Basic arithmetic and Logical operations CO2
COURSE OBJECTIVES
COURSE OUTCOMES
3 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00













7,8,9 Decimal arithmetic and Code conversion CO3
10,11,12
Move a data block without overlap
CO3
Matrix operations
13,14,15 Searching and Sorting a sting in a given array CO2
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
16,17,18 D/A interface and Waveform Generation CO4
19,20,21 A/D interface CO5
22,23,24 Key board and Display CO5
25,26,27
Stepper motor control CO2
Traffic light control CO5
28,29,30
Digital clock CO6
Serial interface and Parallel interface CO4
CYCLE III - 8051 PROGRAMS USING KITS AND MASM
31,32,33 Basic arithmetic and Logical operations CO1
34,35,36
Square and Cube program, Find 2?s complement of a number
CO5
Unpacked BCD to ASCII
37,38,39
Password checking and Print RAM size with system date
CO6
Counters and Time Delay
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
40,41,42 Sorting of an array using 8051 CO2
43,44,45
Separate odd and even numbers using 8086


CO3
Sum of N consecutive numbers using 8086
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00




College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING




To impart professional education integrated with human values to the younger generation, so as to shape
them as proficient and dedicated engineers, capable of providing comprehensive solutions to the challenges in
deploying technology for the service of humanity



? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices


VISION
MISSION
VISION
MISSION
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of
engineering that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this
enables to find solutions for real time problem in industry and organization and to design products
requiring interdisciplinary skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up
their communication skills, individual leadership and supportive qualities and to develop them to adapt and
work in ever changing technologies
5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees











6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer
Science and Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the
career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both
verbal and written forms
i) To work in a team as team member or a leader and make unique contributions and work with
coordination
j) To engage lifelong learning and exhibit their technical skills
k) To develop and manage projects in multidisciplinary environments










7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER
LABORATORY
SYLLABUS

? To learn the working of ARM processor
? To introduce ALP concepts and features
? To write ALP for arithmetic and logical operations in 8086 and 8051
? To differentiate Serial and Parallel Interface
? To interface different I/Os with Microprocessors
? To be familiar with MASM
LIST OF EXPERIMENTS:
8086 Programs using kits and MASM
1. Basic arithmetic and Logical operations
2. Move a data block without overlap
3. Code conversion, decimal arithmetic and Matrix operations.
4. Floating point operations, string manipulations, sorting and searching
5. Password checking, Print RAM size and system date
6. Counters and Time Delay
Peripherals and Interfacing Experiments
7. Traffic light control
8. Stepper motor control
9. Digital clock
10. Key board and Display
11. Printer status
12. Serial interface and Parallel interface
13. A/D and D/A interface and Waveform Generation 8051
Experiments using kits and MASM
14. Basic arithmetic and Logical operations
15. Square and Cube program, Find 2 ?s complement of a number
16. Unpacked BCD to ASCII

? Write programs in ARM for a specific Application
? Write ALP Programs for fixed and Floating Point and Arithmetic
? Interface different I/Os with processor and Generate waveforms using Microprocessors
? Execute Programs in 8051
? Assess the performance of optical devices: light sources, fibers and detectors from both physical and
system point of view


COURSE OUTCOMES
COURSE OBJECTIVES
8 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 - 8086 PROGRAMS USING KITS AND MASM
1 Basic arithmetic and Logical operations 10
2 Decimal arithmetic and Code conversion 15
3 Move a data block without overlap 21
4 Matrix operations 24
5 Searching and Sorting a sting in a given array 27
6 Password checking and Print RAM size with system date 33
7 Counters and Time Delay 36
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
8 Stepper motor control 39
9 Traffic light control 42
10 Digital clock 47
11 Serial interface and Parallel interface 50
12 A/D interface 54
13 Key board and Display 57
14 D/A interface and Waveform Generation 60
CYCLE 3 - 8051 PROGRAMS USING KITS AND MASM
15 Basic arithmetic and Logical operations 64
16 Square and Cube program, Find 2?s complement of a number 69
17 Unpacked BCD to ASCII 71
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
18 Sorting of an array using 8051 74
19 Separate odd and even numbers using 8086 77
20 Sum of N consecutive numbers using 8086 80

9 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.1 BASIC ARITHMETIC AND LOGICAL OPERATIONS

Aim:
To write an Assembly Language Program to perform Arithmetic operation and to execute using 8086
microprocessor
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
Arithmetic Operation:
1. Addition:
Algorithm:
1. Clear BL register to store carry
2. Get the addend in AX register pair
3. Get the Augend in CX register pair
4. Add Augend and addend
5. Check for carry, If it is one go to step 6 else go to step 7
FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING


EC6513 ? MICROPROCESSOR AND MICROCONTROLLERLABORATORY


V SEMESTER - R 2013










Name : _______________________________________
Register No. : _______________________________________
Section : _______________________________________



LABORATORY MANUAL
2 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY


C01 - To learn the working of ARM processor
C02 - To introduce ALP concepts and features
C03 - To write ALP for arithmetic and logical operations in 8086 and 8051
C04 - To differentiate Serial and Parallel Interface
C05 - To interface different I/Os with Microprocessors
C06 - To be familiar with MASM
.




1. Write programs in ARM for a specific Application
2. Write ALP Programs for fixed and Floating Point and Arithmetic
3. Interface different I/Os with processor and Generate waveforms using Microprocessors
4. Execute Programs in 8051
5. Assess the performance of optical devices: light sources, fibers and detectors from both physical and system
point of view

INTRODUCTION
This course illustrates the concepts covered in course CS6412 and provides students with hands-on
experience in Assembly language programs.
PREREQUISITE:
1. Digital Electronics
EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
Lecture
No./Session No.
Name of the Experiment
Course
objectives
Proposed
date

1,2,3
Introduction to lab
CO1

CYCLE I - 8086 PROGRAMS USING KITS AND MASM
4,5,6 Basic arithmetic and Logical operations CO2
COURSE OBJECTIVES
COURSE OUTCOMES
3 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00













7,8,9 Decimal arithmetic and Code conversion CO3
10,11,12
Move a data block without overlap
CO3
Matrix operations
13,14,15 Searching and Sorting a sting in a given array CO2
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
16,17,18 D/A interface and Waveform Generation CO4
19,20,21 A/D interface CO5
22,23,24 Key board and Display CO5
25,26,27
Stepper motor control CO2
Traffic light control CO5
28,29,30
Digital clock CO6
Serial interface and Parallel interface CO4
CYCLE III - 8051 PROGRAMS USING KITS AND MASM
31,32,33 Basic arithmetic and Logical operations CO1
34,35,36
Square and Cube program, Find 2?s complement of a number
CO5
Unpacked BCD to ASCII
37,38,39
Password checking and Print RAM size with system date
CO6
Counters and Time Delay
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
40,41,42 Sorting of an array using 8051 CO2
43,44,45
Separate odd and even numbers using 8086


CO3
Sum of N consecutive numbers using 8086
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00




College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING




To impart professional education integrated with human values to the younger generation, so as to shape
them as proficient and dedicated engineers, capable of providing comprehensive solutions to the challenges in
deploying technology for the service of humanity



? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices


VISION
MISSION
VISION
MISSION
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of
engineering that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this
enables to find solutions for real time problem in industry and organization and to design products
requiring interdisciplinary skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up
their communication skills, individual leadership and supportive qualities and to develop them to adapt and
work in ever changing technologies
5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees











6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer
Science and Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the
career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both
verbal and written forms
i) To work in a team as team member or a leader and make unique contributions and work with
coordination
j) To engage lifelong learning and exhibit their technical skills
k) To develop and manage projects in multidisciplinary environments










7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER
LABORATORY
SYLLABUS

? To learn the working of ARM processor
? To introduce ALP concepts and features
? To write ALP for arithmetic and logical operations in 8086 and 8051
? To differentiate Serial and Parallel Interface
? To interface different I/Os with Microprocessors
? To be familiar with MASM
LIST OF EXPERIMENTS:
8086 Programs using kits and MASM
1. Basic arithmetic and Logical operations
2. Move a data block without overlap
3. Code conversion, decimal arithmetic and Matrix operations.
4. Floating point operations, string manipulations, sorting and searching
5. Password checking, Print RAM size and system date
6. Counters and Time Delay
Peripherals and Interfacing Experiments
7. Traffic light control
8. Stepper motor control
9. Digital clock
10. Key board and Display
11. Printer status
12. Serial interface and Parallel interface
13. A/D and D/A interface and Waveform Generation 8051
Experiments using kits and MASM
14. Basic arithmetic and Logical operations
15. Square and Cube program, Find 2 ?s complement of a number
16. Unpacked BCD to ASCII

? Write programs in ARM for a specific Application
? Write ALP Programs for fixed and Floating Point and Arithmetic
? Interface different I/Os with processor and Generate waveforms using Microprocessors
? Execute Programs in 8051
? Assess the performance of optical devices: light sources, fibers and detectors from both physical and
system point of view


COURSE OUTCOMES
COURSE OBJECTIVES
8 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 - 8086 PROGRAMS USING KITS AND MASM
1 Basic arithmetic and Logical operations 10
2 Decimal arithmetic and Code conversion 15
3 Move a data block without overlap 21
4 Matrix operations 24
5 Searching and Sorting a sting in a given array 27
6 Password checking and Print RAM size with system date 33
7 Counters and Time Delay 36
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
8 Stepper motor control 39
9 Traffic light control 42
10 Digital clock 47
11 Serial interface and Parallel interface 50
12 A/D interface 54
13 Key board and Display 57
14 D/A interface and Waveform Generation 60
CYCLE 3 - 8051 PROGRAMS USING KITS AND MASM
15 Basic arithmetic and Logical operations 64
16 Square and Cube program, Find 2?s complement of a number 69
17 Unpacked BCD to ASCII 71
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
18 Sorting of an array using 8051 74
19 Separate odd and even numbers using 8086 77
20 Sum of N consecutive numbers using 8086 80

9 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.1 BASIC ARITHMETIC AND LOGICAL OPERATIONS

Aim:
To write an Assembly Language Program to perform Arithmetic operation and to execute using 8086
microprocessor
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
Arithmetic Operation:
1. Addition:
Algorithm:
1. Clear BL register to store carry
2. Get the addend in AX register pair
3. Get the Augend in CX register pair
4. Add Augend and addend
5. Check for carry, If it is one go to step 6 else go to step 7
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

6. Increments carry (BL register by 1)
7. Store the sum in memory from AX register pair
8. Store the carry in memory from BL register
9. Stop
Program:
Address
Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 1010H
1007 MOV CX, 2020H
100B CLC
100C ADD AX, CX
100E JNC Label1
1010 INC BL
1012 Label 1 MOV [1200], AX
1016 MOV [1202], BL
101A HLT
Precaution:
Make sure that all the machine codes should be as per the specified in the program.
Tabulation:
Input Output
Address Data Address Data








2. Subtraction:
Algorithm:
1. Clear BL register for storing borrow
2. Get the minuend in AX register pair
3. Get the subtrahend in CX register pair
4. Subtract minuend and subtrahend
5. Check borrow, if borrow is one go to step 6 else go to step 8
6. Increment borrow (BL register by 1)
FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING


EC6513 ? MICROPROCESSOR AND MICROCONTROLLERLABORATORY


V SEMESTER - R 2013










Name : _______________________________________
Register No. : _______________________________________
Section : _______________________________________



LABORATORY MANUAL
2 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY


C01 - To learn the working of ARM processor
C02 - To introduce ALP concepts and features
C03 - To write ALP for arithmetic and logical operations in 8086 and 8051
C04 - To differentiate Serial and Parallel Interface
C05 - To interface different I/Os with Microprocessors
C06 - To be familiar with MASM
.




1. Write programs in ARM for a specific Application
2. Write ALP Programs for fixed and Floating Point and Arithmetic
3. Interface different I/Os with processor and Generate waveforms using Microprocessors
4. Execute Programs in 8051
5. Assess the performance of optical devices: light sources, fibers and detectors from both physical and system
point of view

INTRODUCTION
This course illustrates the concepts covered in course CS6412 and provides students with hands-on
experience in Assembly language programs.
PREREQUISITE:
1. Digital Electronics
EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
Lecture
No./Session No.
Name of the Experiment
Course
objectives
Proposed
date

1,2,3
Introduction to lab
CO1

CYCLE I - 8086 PROGRAMS USING KITS AND MASM
4,5,6 Basic arithmetic and Logical operations CO2
COURSE OBJECTIVES
COURSE OUTCOMES
3 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00













7,8,9 Decimal arithmetic and Code conversion CO3
10,11,12
Move a data block without overlap
CO3
Matrix operations
13,14,15 Searching and Sorting a sting in a given array CO2
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
16,17,18 D/A interface and Waveform Generation CO4
19,20,21 A/D interface CO5
22,23,24 Key board and Display CO5
25,26,27
Stepper motor control CO2
Traffic light control CO5
28,29,30
Digital clock CO6
Serial interface and Parallel interface CO4
CYCLE III - 8051 PROGRAMS USING KITS AND MASM
31,32,33 Basic arithmetic and Logical operations CO1
34,35,36
Square and Cube program, Find 2?s complement of a number
CO5
Unpacked BCD to ASCII
37,38,39
Password checking and Print RAM size with system date
CO6
Counters and Time Delay
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
40,41,42 Sorting of an array using 8051 CO2
43,44,45
Separate odd and even numbers using 8086


CO3
Sum of N consecutive numbers using 8086
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00




College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING




To impart professional education integrated with human values to the younger generation, so as to shape
them as proficient and dedicated engineers, capable of providing comprehensive solutions to the challenges in
deploying technology for the service of humanity



? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices


VISION
MISSION
VISION
MISSION
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of
engineering that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this
enables to find solutions for real time problem in industry and organization and to design products
requiring interdisciplinary skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up
their communication skills, individual leadership and supportive qualities and to develop them to adapt and
work in ever changing technologies
5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees











6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer
Science and Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the
career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both
verbal and written forms
i) To work in a team as team member or a leader and make unique contributions and work with
coordination
j) To engage lifelong learning and exhibit their technical skills
k) To develop and manage projects in multidisciplinary environments










7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER
LABORATORY
SYLLABUS

? To learn the working of ARM processor
? To introduce ALP concepts and features
? To write ALP for arithmetic and logical operations in 8086 and 8051
? To differentiate Serial and Parallel Interface
? To interface different I/Os with Microprocessors
? To be familiar with MASM
LIST OF EXPERIMENTS:
8086 Programs using kits and MASM
1. Basic arithmetic and Logical operations
2. Move a data block without overlap
3. Code conversion, decimal arithmetic and Matrix operations.
4. Floating point operations, string manipulations, sorting and searching
5. Password checking, Print RAM size and system date
6. Counters and Time Delay
Peripherals and Interfacing Experiments
7. Traffic light control
8. Stepper motor control
9. Digital clock
10. Key board and Display
11. Printer status
12. Serial interface and Parallel interface
13. A/D and D/A interface and Waveform Generation 8051
Experiments using kits and MASM
14. Basic arithmetic and Logical operations
15. Square and Cube program, Find 2 ?s complement of a number
16. Unpacked BCD to ASCII

? Write programs in ARM for a specific Application
? Write ALP Programs for fixed and Floating Point and Arithmetic
? Interface different I/Os with processor and Generate waveforms using Microprocessors
? Execute Programs in 8051
? Assess the performance of optical devices: light sources, fibers and detectors from both physical and
system point of view


COURSE OUTCOMES
COURSE OBJECTIVES
8 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 - 8086 PROGRAMS USING KITS AND MASM
1 Basic arithmetic and Logical operations 10
2 Decimal arithmetic and Code conversion 15
3 Move a data block without overlap 21
4 Matrix operations 24
5 Searching and Sorting a sting in a given array 27
6 Password checking and Print RAM size with system date 33
7 Counters and Time Delay 36
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
8 Stepper motor control 39
9 Traffic light control 42
10 Digital clock 47
11 Serial interface and Parallel interface 50
12 A/D interface 54
13 Key board and Display 57
14 D/A interface and Waveform Generation 60
CYCLE 3 - 8051 PROGRAMS USING KITS AND MASM
15 Basic arithmetic and Logical operations 64
16 Square and Cube program, Find 2?s complement of a number 69
17 Unpacked BCD to ASCII 71
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
18 Sorting of an array using 8051 74
19 Separate odd and even numbers using 8086 77
20 Sum of N consecutive numbers using 8086 80

9 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.1 BASIC ARITHMETIC AND LOGICAL OPERATIONS

Aim:
To write an Assembly Language Program to perform Arithmetic operation and to execute using 8086
microprocessor
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
Arithmetic Operation:
1. Addition:
Algorithm:
1. Clear BL register to store carry
2. Get the addend in AX register pair
3. Get the Augend in CX register pair
4. Add Augend and addend
5. Check for carry, If it is one go to step 6 else go to step 7
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

6. Increments carry (BL register by 1)
7. Store the sum in memory from AX register pair
8. Store the carry in memory from BL register
9. Stop
Program:
Address
Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 1010H
1007 MOV CX, 2020H
100B CLC
100C ADD AX, CX
100E JNC Label1
1010 INC BL
1012 Label 1 MOV [1200], AX
1016 MOV [1202], BL
101A HLT
Precaution:
Make sure that all the machine codes should be as per the specified in the program.
Tabulation:
Input Output
Address Data Address Data








2. Subtraction:
Algorithm:
1. Clear BL register for storing borrow
2. Get the minuend in AX register pair
3. Get the subtrahend in CX register pair
4. Subtract minuend and subtrahend
5. Check borrow, if borrow is one go to step 6 else go to step 8
6. Increment borrow (BL register by 1)
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

7. Negate AX register
8. Store the difference from AX in memory
9. Story the borrow from BL in memory
10. Stop
Program:
Address Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 2024H
1007 MOV CX, 1010H
100B SUB AX, CX
100D JNC Label1
100F INC BL
1011 NEG AX
1013 Label 1 MOV [1200], AX
1017 MOV [1202], BL
101B HLT

Tabulation:
Input Output
Address Data Address Data






3. Multiplication
Algorithm:
1. Clear DX register
2. Load the AX register pair with multiplicand
3. Load the CX register pair with multiplier
4. Multiply multiplicand and multiplier
5. Store the higher byte of product(from DX register pair) in memory specified
6. Store the lower byte of product(from AX register pair) in memory specified
7. Stop
8.
FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING


EC6513 ? MICROPROCESSOR AND MICROCONTROLLERLABORATORY


V SEMESTER - R 2013










Name : _______________________________________
Register No. : _______________________________________
Section : _______________________________________



LABORATORY MANUAL
2 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY


C01 - To learn the working of ARM processor
C02 - To introduce ALP concepts and features
C03 - To write ALP for arithmetic and logical operations in 8086 and 8051
C04 - To differentiate Serial and Parallel Interface
C05 - To interface different I/Os with Microprocessors
C06 - To be familiar with MASM
.




1. Write programs in ARM for a specific Application
2. Write ALP Programs for fixed and Floating Point and Arithmetic
3. Interface different I/Os with processor and Generate waveforms using Microprocessors
4. Execute Programs in 8051
5. Assess the performance of optical devices: light sources, fibers and detectors from both physical and system
point of view

INTRODUCTION
This course illustrates the concepts covered in course CS6412 and provides students with hands-on
experience in Assembly language programs.
PREREQUISITE:
1. Digital Electronics
EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
Lecture
No./Session No.
Name of the Experiment
Course
objectives
Proposed
date

1,2,3
Introduction to lab
CO1

CYCLE I - 8086 PROGRAMS USING KITS AND MASM
4,5,6 Basic arithmetic and Logical operations CO2
COURSE OBJECTIVES
COURSE OUTCOMES
3 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00













7,8,9 Decimal arithmetic and Code conversion CO3
10,11,12
Move a data block without overlap
CO3
Matrix operations
13,14,15 Searching and Sorting a sting in a given array CO2
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
16,17,18 D/A interface and Waveform Generation CO4
19,20,21 A/D interface CO5
22,23,24 Key board and Display CO5
25,26,27
Stepper motor control CO2
Traffic light control CO5
28,29,30
Digital clock CO6
Serial interface and Parallel interface CO4
CYCLE III - 8051 PROGRAMS USING KITS AND MASM
31,32,33 Basic arithmetic and Logical operations CO1
34,35,36
Square and Cube program, Find 2?s complement of a number
CO5
Unpacked BCD to ASCII
37,38,39
Password checking and Print RAM size with system date
CO6
Counters and Time Delay
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
40,41,42 Sorting of an array using 8051 CO2
43,44,45
Separate odd and even numbers using 8086


CO3
Sum of N consecutive numbers using 8086
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00




College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING




To impart professional education integrated with human values to the younger generation, so as to shape
them as proficient and dedicated engineers, capable of providing comprehensive solutions to the challenges in
deploying technology for the service of humanity



? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices


VISION
MISSION
VISION
MISSION
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of
engineering that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this
enables to find solutions for real time problem in industry and organization and to design products
requiring interdisciplinary skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up
their communication skills, individual leadership and supportive qualities and to develop them to adapt and
work in ever changing technologies
5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees











6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer
Science and Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the
career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both
verbal and written forms
i) To work in a team as team member or a leader and make unique contributions and work with
coordination
j) To engage lifelong learning and exhibit their technical skills
k) To develop and manage projects in multidisciplinary environments










7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER
LABORATORY
SYLLABUS

? To learn the working of ARM processor
? To introduce ALP concepts and features
? To write ALP for arithmetic and logical operations in 8086 and 8051
? To differentiate Serial and Parallel Interface
? To interface different I/Os with Microprocessors
? To be familiar with MASM
LIST OF EXPERIMENTS:
8086 Programs using kits and MASM
1. Basic arithmetic and Logical operations
2. Move a data block without overlap
3. Code conversion, decimal arithmetic and Matrix operations.
4. Floating point operations, string manipulations, sorting and searching
5. Password checking, Print RAM size and system date
6. Counters and Time Delay
Peripherals and Interfacing Experiments
7. Traffic light control
8. Stepper motor control
9. Digital clock
10. Key board and Display
11. Printer status
12. Serial interface and Parallel interface
13. A/D and D/A interface and Waveform Generation 8051
Experiments using kits and MASM
14. Basic arithmetic and Logical operations
15. Square and Cube program, Find 2 ?s complement of a number
16. Unpacked BCD to ASCII

? Write programs in ARM for a specific Application
? Write ALP Programs for fixed and Floating Point and Arithmetic
? Interface different I/Os with processor and Generate waveforms using Microprocessors
? Execute Programs in 8051
? Assess the performance of optical devices: light sources, fibers and detectors from both physical and
system point of view


COURSE OUTCOMES
COURSE OBJECTIVES
8 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 - 8086 PROGRAMS USING KITS AND MASM
1 Basic arithmetic and Logical operations 10
2 Decimal arithmetic and Code conversion 15
3 Move a data block without overlap 21
4 Matrix operations 24
5 Searching and Sorting a sting in a given array 27
6 Password checking and Print RAM size with system date 33
7 Counters and Time Delay 36
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
8 Stepper motor control 39
9 Traffic light control 42
10 Digital clock 47
11 Serial interface and Parallel interface 50
12 A/D interface 54
13 Key board and Display 57
14 D/A interface and Waveform Generation 60
CYCLE 3 - 8051 PROGRAMS USING KITS AND MASM
15 Basic arithmetic and Logical operations 64
16 Square and Cube program, Find 2?s complement of a number 69
17 Unpacked BCD to ASCII 71
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
18 Sorting of an array using 8051 74
19 Separate odd and even numbers using 8086 77
20 Sum of N consecutive numbers using 8086 80

9 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.1 BASIC ARITHMETIC AND LOGICAL OPERATIONS

Aim:
To write an Assembly Language Program to perform Arithmetic operation and to execute using 8086
microprocessor
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
Arithmetic Operation:
1. Addition:
Algorithm:
1. Clear BL register to store carry
2. Get the addend in AX register pair
3. Get the Augend in CX register pair
4. Add Augend and addend
5. Check for carry, If it is one go to step 6 else go to step 7
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

6. Increments carry (BL register by 1)
7. Store the sum in memory from AX register pair
8. Store the carry in memory from BL register
9. Stop
Program:
Address
Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 1010H
1007 MOV CX, 2020H
100B CLC
100C ADD AX, CX
100E JNC Label1
1010 INC BL
1012 Label 1 MOV [1200], AX
1016 MOV [1202], BL
101A HLT
Precaution:
Make sure that all the machine codes should be as per the specified in the program.
Tabulation:
Input Output
Address Data Address Data








2. Subtraction:
Algorithm:
1. Clear BL register for storing borrow
2. Get the minuend in AX register pair
3. Get the subtrahend in CX register pair
4. Subtract minuend and subtrahend
5. Check borrow, if borrow is one go to step 6 else go to step 8
6. Increment borrow (BL register by 1)
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

7. Negate AX register
8. Store the difference from AX in memory
9. Story the borrow from BL in memory
10. Stop
Program:
Address Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 2024H
1007 MOV CX, 1010H
100B SUB AX, CX
100D JNC Label1
100F INC BL
1011 NEG AX
1013 Label 1 MOV [1200], AX
1017 MOV [1202], BL
101B HLT

Tabulation:
Input Output
Address Data Address Data






3. Multiplication
Algorithm:
1. Clear DX register
2. Load the AX register pair with multiplicand
3. Load the CX register pair with multiplier
4. Multiply multiplicand and multiplier
5. Store the higher byte of product(from DX register pair) in memory specified
6. Store the lower byte of product(from AX register pair) in memory specified
7. Stop
8.
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV DX, 0000H
1004 MOV AX, 00FFH
1008 MOV CX, 0002H
100C MUL CX
100E MOV [1200], AX
1012 MOV [1202], DX
1016 HLT
Tabulation:
Input Output
Address Data Address Data






4. Division:
Algorithm
1. Clear DX register
2. Load the AX register pair with dividend
3. Load the CX register pair with divisor
4. Dividend divided by divisor
5. Store the quotient (from AX register pair) in memory specified
6. Store the remainder (from DX register pair) in memory specified
7. Stop
Program:
Address Label Mnemonics
1000 MOV DX, 0000H
1004 MOV AX, 0008H
1008 MOV CX, 0004H
100C DIV CX
100E MOV [1200], AX
1012 MOV [1202], DX
1016 HLT

FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING


EC6513 ? MICROPROCESSOR AND MICROCONTROLLERLABORATORY


V SEMESTER - R 2013










Name : _______________________________________
Register No. : _______________________________________
Section : _______________________________________



LABORATORY MANUAL
2 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY


C01 - To learn the working of ARM processor
C02 - To introduce ALP concepts and features
C03 - To write ALP for arithmetic and logical operations in 8086 and 8051
C04 - To differentiate Serial and Parallel Interface
C05 - To interface different I/Os with Microprocessors
C06 - To be familiar with MASM
.




1. Write programs in ARM for a specific Application
2. Write ALP Programs for fixed and Floating Point and Arithmetic
3. Interface different I/Os with processor and Generate waveforms using Microprocessors
4. Execute Programs in 8051
5. Assess the performance of optical devices: light sources, fibers and detectors from both physical and system
point of view

INTRODUCTION
This course illustrates the concepts covered in course CS6412 and provides students with hands-on
experience in Assembly language programs.
PREREQUISITE:
1. Digital Electronics
EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
Lecture
No./Session No.
Name of the Experiment
Course
objectives
Proposed
date

1,2,3
Introduction to lab
CO1

CYCLE I - 8086 PROGRAMS USING KITS AND MASM
4,5,6 Basic arithmetic and Logical operations CO2
COURSE OBJECTIVES
COURSE OUTCOMES
3 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00













7,8,9 Decimal arithmetic and Code conversion CO3
10,11,12
Move a data block without overlap
CO3
Matrix operations
13,14,15 Searching and Sorting a sting in a given array CO2
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
16,17,18 D/A interface and Waveform Generation CO4
19,20,21 A/D interface CO5
22,23,24 Key board and Display CO5
25,26,27
Stepper motor control CO2
Traffic light control CO5
28,29,30
Digital clock CO6
Serial interface and Parallel interface CO4
CYCLE III - 8051 PROGRAMS USING KITS AND MASM
31,32,33 Basic arithmetic and Logical operations CO1
34,35,36
Square and Cube program, Find 2?s complement of a number
CO5
Unpacked BCD to ASCII
37,38,39
Password checking and Print RAM size with system date
CO6
Counters and Time Delay
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
40,41,42 Sorting of an array using 8051 CO2
43,44,45
Separate odd and even numbers using 8086


CO3
Sum of N consecutive numbers using 8086
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00




College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING




To impart professional education integrated with human values to the younger generation, so as to shape
them as proficient and dedicated engineers, capable of providing comprehensive solutions to the challenges in
deploying technology for the service of humanity



? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices


VISION
MISSION
VISION
MISSION
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of
engineering that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this
enables to find solutions for real time problem in industry and organization and to design products
requiring interdisciplinary skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up
their communication skills, individual leadership and supportive qualities and to develop them to adapt and
work in ever changing technologies
5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees











6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer
Science and Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the
career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both
verbal and written forms
i) To work in a team as team member or a leader and make unique contributions and work with
coordination
j) To engage lifelong learning and exhibit their technical skills
k) To develop and manage projects in multidisciplinary environments










7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER
LABORATORY
SYLLABUS

? To learn the working of ARM processor
? To introduce ALP concepts and features
? To write ALP for arithmetic and logical operations in 8086 and 8051
? To differentiate Serial and Parallel Interface
? To interface different I/Os with Microprocessors
? To be familiar with MASM
LIST OF EXPERIMENTS:
8086 Programs using kits and MASM
1. Basic arithmetic and Logical operations
2. Move a data block without overlap
3. Code conversion, decimal arithmetic and Matrix operations.
4. Floating point operations, string manipulations, sorting and searching
5. Password checking, Print RAM size and system date
6. Counters and Time Delay
Peripherals and Interfacing Experiments
7. Traffic light control
8. Stepper motor control
9. Digital clock
10. Key board and Display
11. Printer status
12. Serial interface and Parallel interface
13. A/D and D/A interface and Waveform Generation 8051
Experiments using kits and MASM
14. Basic arithmetic and Logical operations
15. Square and Cube program, Find 2 ?s complement of a number
16. Unpacked BCD to ASCII

? Write programs in ARM for a specific Application
? Write ALP Programs for fixed and Floating Point and Arithmetic
? Interface different I/Os with processor and Generate waveforms using Microprocessors
? Execute Programs in 8051
? Assess the performance of optical devices: light sources, fibers and detectors from both physical and
system point of view


COURSE OUTCOMES
COURSE OBJECTIVES
8 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 - 8086 PROGRAMS USING KITS AND MASM
1 Basic arithmetic and Logical operations 10
2 Decimal arithmetic and Code conversion 15
3 Move a data block without overlap 21
4 Matrix operations 24
5 Searching and Sorting a sting in a given array 27
6 Password checking and Print RAM size with system date 33
7 Counters and Time Delay 36
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
8 Stepper motor control 39
9 Traffic light control 42
10 Digital clock 47
11 Serial interface and Parallel interface 50
12 A/D interface 54
13 Key board and Display 57
14 D/A interface and Waveform Generation 60
CYCLE 3 - 8051 PROGRAMS USING KITS AND MASM
15 Basic arithmetic and Logical operations 64
16 Square and Cube program, Find 2?s complement of a number 69
17 Unpacked BCD to ASCII 71
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
18 Sorting of an array using 8051 74
19 Separate odd and even numbers using 8086 77
20 Sum of N consecutive numbers using 8086 80

9 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.1 BASIC ARITHMETIC AND LOGICAL OPERATIONS

Aim:
To write an Assembly Language Program to perform Arithmetic operation and to execute using 8086
microprocessor
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
Arithmetic Operation:
1. Addition:
Algorithm:
1. Clear BL register to store carry
2. Get the addend in AX register pair
3. Get the Augend in CX register pair
4. Add Augend and addend
5. Check for carry, If it is one go to step 6 else go to step 7
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

6. Increments carry (BL register by 1)
7. Store the sum in memory from AX register pair
8. Store the carry in memory from BL register
9. Stop
Program:
Address
Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 1010H
1007 MOV CX, 2020H
100B CLC
100C ADD AX, CX
100E JNC Label1
1010 INC BL
1012 Label 1 MOV [1200], AX
1016 MOV [1202], BL
101A HLT
Precaution:
Make sure that all the machine codes should be as per the specified in the program.
Tabulation:
Input Output
Address Data Address Data








2. Subtraction:
Algorithm:
1. Clear BL register for storing borrow
2. Get the minuend in AX register pair
3. Get the subtrahend in CX register pair
4. Subtract minuend and subtrahend
5. Check borrow, if borrow is one go to step 6 else go to step 8
6. Increment borrow (BL register by 1)
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

7. Negate AX register
8. Store the difference from AX in memory
9. Story the borrow from BL in memory
10. Stop
Program:
Address Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 2024H
1007 MOV CX, 1010H
100B SUB AX, CX
100D JNC Label1
100F INC BL
1011 NEG AX
1013 Label 1 MOV [1200], AX
1017 MOV [1202], BL
101B HLT

Tabulation:
Input Output
Address Data Address Data






3. Multiplication
Algorithm:
1. Clear DX register
2. Load the AX register pair with multiplicand
3. Load the CX register pair with multiplier
4. Multiply multiplicand and multiplier
5. Store the higher byte of product(from DX register pair) in memory specified
6. Store the lower byte of product(from AX register pair) in memory specified
7. Stop
8.
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV DX, 0000H
1004 MOV AX, 00FFH
1008 MOV CX, 0002H
100C MUL CX
100E MOV [1200], AX
1012 MOV [1202], DX
1016 HLT
Tabulation:
Input Output
Address Data Address Data






4. Division:
Algorithm
1. Clear DX register
2. Load the AX register pair with dividend
3. Load the CX register pair with divisor
4. Dividend divided by divisor
5. Store the quotient (from AX register pair) in memory specified
6. Store the remainder (from DX register pair) in memory specified
7. Stop
Program:
Address Label Mnemonics
1000 MOV DX, 0000H
1004 MOV AX, 0008H
1008 MOV CX, 0004H
100C DIV CX
100E MOV [1200], AX
1012 MOV [1202], DX
1016 HLT

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


Result:
Thus Assembly language program are written to perform arithmetic operation using 8086 microprocessor.
They are executed using 8086 processor and the outputs are verified.
Outcome:
At the end of this experiment the students able to write ALP programs for Arithmetic and Logical operations.

1. Write the size of the data bus of 8086.
2. Write the size of the address bus of 8086.
3. What is meant by physical addressing in 8086?
4. What is meant by an Opcode?
5. What is meant by an Operand?
6. What is meant by a Mnemonics?
7. What are the other possibilities of writing ADD, SUB and MUL instructions in other addressing modes?
8. What is the difference between microprocessor and microcontroller?
9. What is meant by LATCH?
10. What is the difference between primary & secondary storage device?
11. What is the difference between static and dynamic RAM?
12. What is an interrupt?
13. Differentiate between RAM and ROM?
14. Define ? Compiler
15. Define ? Flag
16. Define ? Stack
17. How clock signal is generated in 8086 microprocessor?
18. State the functions of queue status line QS0 and QS1 in 8086 microprocessor.
19. What is the purpose of BIU& EU?
20. List out the two examples of assembler directives.

Viva ? voce
FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING


EC6513 ? MICROPROCESSOR AND MICROCONTROLLERLABORATORY


V SEMESTER - R 2013










Name : _______________________________________
Register No. : _______________________________________
Section : _______________________________________



LABORATORY MANUAL
2 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY


C01 - To learn the working of ARM processor
C02 - To introduce ALP concepts and features
C03 - To write ALP for arithmetic and logical operations in 8086 and 8051
C04 - To differentiate Serial and Parallel Interface
C05 - To interface different I/Os with Microprocessors
C06 - To be familiar with MASM
.




1. Write programs in ARM for a specific Application
2. Write ALP Programs for fixed and Floating Point and Arithmetic
3. Interface different I/Os with processor and Generate waveforms using Microprocessors
4. Execute Programs in 8051
5. Assess the performance of optical devices: light sources, fibers and detectors from both physical and system
point of view

INTRODUCTION
This course illustrates the concepts covered in course CS6412 and provides students with hands-on
experience in Assembly language programs.
PREREQUISITE:
1. Digital Electronics
EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
Lecture
No./Session No.
Name of the Experiment
Course
objectives
Proposed
date

1,2,3
Introduction to lab
CO1

CYCLE I - 8086 PROGRAMS USING KITS AND MASM
4,5,6 Basic arithmetic and Logical operations CO2
COURSE OBJECTIVES
COURSE OUTCOMES
3 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00













7,8,9 Decimal arithmetic and Code conversion CO3
10,11,12
Move a data block without overlap
CO3
Matrix operations
13,14,15 Searching and Sorting a sting in a given array CO2
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
16,17,18 D/A interface and Waveform Generation CO4
19,20,21 A/D interface CO5
22,23,24 Key board and Display CO5
25,26,27
Stepper motor control CO2
Traffic light control CO5
28,29,30
Digital clock CO6
Serial interface and Parallel interface CO4
CYCLE III - 8051 PROGRAMS USING KITS AND MASM
31,32,33 Basic arithmetic and Logical operations CO1
34,35,36
Square and Cube program, Find 2?s complement of a number
CO5
Unpacked BCD to ASCII
37,38,39
Password checking and Print RAM size with system date
CO6
Counters and Time Delay
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
40,41,42 Sorting of an array using 8051 CO2
43,44,45
Separate odd and even numbers using 8086


CO3
Sum of N consecutive numbers using 8086
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00




College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING




To impart professional education integrated with human values to the younger generation, so as to shape
them as proficient and dedicated engineers, capable of providing comprehensive solutions to the challenges in
deploying technology for the service of humanity



? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices


VISION
MISSION
VISION
MISSION
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of
engineering that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this
enables to find solutions for real time problem in industry and organization and to design products
requiring interdisciplinary skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up
their communication skills, individual leadership and supportive qualities and to develop them to adapt and
work in ever changing technologies
5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees











6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer
Science and Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the
career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both
verbal and written forms
i) To work in a team as team member or a leader and make unique contributions and work with
coordination
j) To engage lifelong learning and exhibit their technical skills
k) To develop and manage projects in multidisciplinary environments










7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER
LABORATORY
SYLLABUS

? To learn the working of ARM processor
? To introduce ALP concepts and features
? To write ALP for arithmetic and logical operations in 8086 and 8051
? To differentiate Serial and Parallel Interface
? To interface different I/Os with Microprocessors
? To be familiar with MASM
LIST OF EXPERIMENTS:
8086 Programs using kits and MASM
1. Basic arithmetic and Logical operations
2. Move a data block without overlap
3. Code conversion, decimal arithmetic and Matrix operations.
4. Floating point operations, string manipulations, sorting and searching
5. Password checking, Print RAM size and system date
6. Counters and Time Delay
Peripherals and Interfacing Experiments
7. Traffic light control
8. Stepper motor control
9. Digital clock
10. Key board and Display
11. Printer status
12. Serial interface and Parallel interface
13. A/D and D/A interface and Waveform Generation 8051
Experiments using kits and MASM
14. Basic arithmetic and Logical operations
15. Square and Cube program, Find 2 ?s complement of a number
16. Unpacked BCD to ASCII

? Write programs in ARM for a specific Application
? Write ALP Programs for fixed and Floating Point and Arithmetic
? Interface different I/Os with processor and Generate waveforms using Microprocessors
? Execute Programs in 8051
? Assess the performance of optical devices: light sources, fibers and detectors from both physical and
system point of view


COURSE OUTCOMES
COURSE OBJECTIVES
8 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 - 8086 PROGRAMS USING KITS AND MASM
1 Basic arithmetic and Logical operations 10
2 Decimal arithmetic and Code conversion 15
3 Move a data block without overlap 21
4 Matrix operations 24
5 Searching and Sorting a sting in a given array 27
6 Password checking and Print RAM size with system date 33
7 Counters and Time Delay 36
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
8 Stepper motor control 39
9 Traffic light control 42
10 Digital clock 47
11 Serial interface and Parallel interface 50
12 A/D interface 54
13 Key board and Display 57
14 D/A interface and Waveform Generation 60
CYCLE 3 - 8051 PROGRAMS USING KITS AND MASM
15 Basic arithmetic and Logical operations 64
16 Square and Cube program, Find 2?s complement of a number 69
17 Unpacked BCD to ASCII 71
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
18 Sorting of an array using 8051 74
19 Separate odd and even numbers using 8086 77
20 Sum of N consecutive numbers using 8086 80

9 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.1 BASIC ARITHMETIC AND LOGICAL OPERATIONS

Aim:
To write an Assembly Language Program to perform Arithmetic operation and to execute using 8086
microprocessor
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
Arithmetic Operation:
1. Addition:
Algorithm:
1. Clear BL register to store carry
2. Get the addend in AX register pair
3. Get the Augend in CX register pair
4. Add Augend and addend
5. Check for carry, If it is one go to step 6 else go to step 7
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

6. Increments carry (BL register by 1)
7. Store the sum in memory from AX register pair
8. Store the carry in memory from BL register
9. Stop
Program:
Address
Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 1010H
1007 MOV CX, 2020H
100B CLC
100C ADD AX, CX
100E JNC Label1
1010 INC BL
1012 Label 1 MOV [1200], AX
1016 MOV [1202], BL
101A HLT
Precaution:
Make sure that all the machine codes should be as per the specified in the program.
Tabulation:
Input Output
Address Data Address Data








2. Subtraction:
Algorithm:
1. Clear BL register for storing borrow
2. Get the minuend in AX register pair
3. Get the subtrahend in CX register pair
4. Subtract minuend and subtrahend
5. Check borrow, if borrow is one go to step 6 else go to step 8
6. Increment borrow (BL register by 1)
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

7. Negate AX register
8. Store the difference from AX in memory
9. Story the borrow from BL in memory
10. Stop
Program:
Address Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 2024H
1007 MOV CX, 1010H
100B SUB AX, CX
100D JNC Label1
100F INC BL
1011 NEG AX
1013 Label 1 MOV [1200], AX
1017 MOV [1202], BL
101B HLT

Tabulation:
Input Output
Address Data Address Data






3. Multiplication
Algorithm:
1. Clear DX register
2. Load the AX register pair with multiplicand
3. Load the CX register pair with multiplier
4. Multiply multiplicand and multiplier
5. Store the higher byte of product(from DX register pair) in memory specified
6. Store the lower byte of product(from AX register pair) in memory specified
7. Stop
8.
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV DX, 0000H
1004 MOV AX, 00FFH
1008 MOV CX, 0002H
100C MUL CX
100E MOV [1200], AX
1012 MOV [1202], DX
1016 HLT
Tabulation:
Input Output
Address Data Address Data






4. Division:
Algorithm
1. Clear DX register
2. Load the AX register pair with dividend
3. Load the CX register pair with divisor
4. Dividend divided by divisor
5. Store the quotient (from AX register pair) in memory specified
6. Store the remainder (from DX register pair) in memory specified
7. Stop
Program:
Address Label Mnemonics
1000 MOV DX, 0000H
1004 MOV AX, 0008H
1008 MOV CX, 0004H
100C DIV CX
100E MOV [1200], AX
1012 MOV [1202], DX
1016 HLT

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


Result:
Thus Assembly language program are written to perform arithmetic operation using 8086 microprocessor.
They are executed using 8086 processor and the outputs are verified.
Outcome:
At the end of this experiment the students able to write ALP programs for Arithmetic and Logical operations.

1. Write the size of the data bus of 8086.
2. Write the size of the address bus of 8086.
3. What is meant by physical addressing in 8086?
4. What is meant by an Opcode?
5. What is meant by an Operand?
6. What is meant by a Mnemonics?
7. What are the other possibilities of writing ADD, SUB and MUL instructions in other addressing modes?
8. What is the difference between microprocessor and microcontroller?
9. What is meant by LATCH?
10. What is the difference between primary & secondary storage device?
11. What is the difference between static and dynamic RAM?
12. What is an interrupt?
13. Differentiate between RAM and ROM?
14. Define ? Compiler
15. Define ? Flag
16. Define ? Stack
17. How clock signal is generated in 8086 microprocessor?
18. State the functions of queue status line QS0 and QS1 in 8086 microprocessor.
19. What is the purpose of BIU& EU?
20. List out the two examples of assembler directives.

Viva ? voce
15 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Applications:
1. barrel shifters
2. Multiple-precision arithmetic
3. Calculation pipeline
4. binary multipliers
5. Calculation in a single clock

FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING


EC6513 ? MICROPROCESSOR AND MICROCONTROLLERLABORATORY


V SEMESTER - R 2013










Name : _______________________________________
Register No. : _______________________________________
Section : _______________________________________



LABORATORY MANUAL
2 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY


C01 - To learn the working of ARM processor
C02 - To introduce ALP concepts and features
C03 - To write ALP for arithmetic and logical operations in 8086 and 8051
C04 - To differentiate Serial and Parallel Interface
C05 - To interface different I/Os with Microprocessors
C06 - To be familiar with MASM
.




1. Write programs in ARM for a specific Application
2. Write ALP Programs for fixed and Floating Point and Arithmetic
3. Interface different I/Os with processor and Generate waveforms using Microprocessors
4. Execute Programs in 8051
5. Assess the performance of optical devices: light sources, fibers and detectors from both physical and system
point of view

INTRODUCTION
This course illustrates the concepts covered in course CS6412 and provides students with hands-on
experience in Assembly language programs.
PREREQUISITE:
1. Digital Electronics
EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
Lecture
No./Session No.
Name of the Experiment
Course
objectives
Proposed
date

1,2,3
Introduction to lab
CO1

CYCLE I - 8086 PROGRAMS USING KITS AND MASM
4,5,6 Basic arithmetic and Logical operations CO2
COURSE OBJECTIVES
COURSE OUTCOMES
3 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00













7,8,9 Decimal arithmetic and Code conversion CO3
10,11,12
Move a data block without overlap
CO3
Matrix operations
13,14,15 Searching and Sorting a sting in a given array CO2
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
16,17,18 D/A interface and Waveform Generation CO4
19,20,21 A/D interface CO5
22,23,24 Key board and Display CO5
25,26,27
Stepper motor control CO2
Traffic light control CO5
28,29,30
Digital clock CO6
Serial interface and Parallel interface CO4
CYCLE III - 8051 PROGRAMS USING KITS AND MASM
31,32,33 Basic arithmetic and Logical operations CO1
34,35,36
Square and Cube program, Find 2?s complement of a number
CO5
Unpacked BCD to ASCII
37,38,39
Password checking and Print RAM size with system date
CO6
Counters and Time Delay
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
40,41,42 Sorting of an array using 8051 CO2
43,44,45
Separate odd and even numbers using 8086


CO3
Sum of N consecutive numbers using 8086
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00




College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING




To impart professional education integrated with human values to the younger generation, so as to shape
them as proficient and dedicated engineers, capable of providing comprehensive solutions to the challenges in
deploying technology for the service of humanity



? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices


VISION
MISSION
VISION
MISSION
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of
engineering that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this
enables to find solutions for real time problem in industry and organization and to design products
requiring interdisciplinary skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up
their communication skills, individual leadership and supportive qualities and to develop them to adapt and
work in ever changing technologies
5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees











6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer
Science and Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the
career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both
verbal and written forms
i) To work in a team as team member or a leader and make unique contributions and work with
coordination
j) To engage lifelong learning and exhibit their technical skills
k) To develop and manage projects in multidisciplinary environments










7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER
LABORATORY
SYLLABUS

? To learn the working of ARM processor
? To introduce ALP concepts and features
? To write ALP for arithmetic and logical operations in 8086 and 8051
? To differentiate Serial and Parallel Interface
? To interface different I/Os with Microprocessors
? To be familiar with MASM
LIST OF EXPERIMENTS:
8086 Programs using kits and MASM
1. Basic arithmetic and Logical operations
2. Move a data block without overlap
3. Code conversion, decimal arithmetic and Matrix operations.
4. Floating point operations, string manipulations, sorting and searching
5. Password checking, Print RAM size and system date
6. Counters and Time Delay
Peripherals and Interfacing Experiments
7. Traffic light control
8. Stepper motor control
9. Digital clock
10. Key board and Display
11. Printer status
12. Serial interface and Parallel interface
13. A/D and D/A interface and Waveform Generation 8051
Experiments using kits and MASM
14. Basic arithmetic and Logical operations
15. Square and Cube program, Find 2 ?s complement of a number
16. Unpacked BCD to ASCII

? Write programs in ARM for a specific Application
? Write ALP Programs for fixed and Floating Point and Arithmetic
? Interface different I/Os with processor and Generate waveforms using Microprocessors
? Execute Programs in 8051
? Assess the performance of optical devices: light sources, fibers and detectors from both physical and
system point of view


COURSE OUTCOMES
COURSE OBJECTIVES
8 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 - 8086 PROGRAMS USING KITS AND MASM
1 Basic arithmetic and Logical operations 10
2 Decimal arithmetic and Code conversion 15
3 Move a data block without overlap 21
4 Matrix operations 24
5 Searching and Sorting a sting in a given array 27
6 Password checking and Print RAM size with system date 33
7 Counters and Time Delay 36
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
8 Stepper motor control 39
9 Traffic light control 42
10 Digital clock 47
11 Serial interface and Parallel interface 50
12 A/D interface 54
13 Key board and Display 57
14 D/A interface and Waveform Generation 60
CYCLE 3 - 8051 PROGRAMS USING KITS AND MASM
15 Basic arithmetic and Logical operations 64
16 Square and Cube program, Find 2?s complement of a number 69
17 Unpacked BCD to ASCII 71
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
18 Sorting of an array using 8051 74
19 Separate odd and even numbers using 8086 77
20 Sum of N consecutive numbers using 8086 80

9 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.1 BASIC ARITHMETIC AND LOGICAL OPERATIONS

Aim:
To write an Assembly Language Program to perform Arithmetic operation and to execute using 8086
microprocessor
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
Arithmetic Operation:
1. Addition:
Algorithm:
1. Clear BL register to store carry
2. Get the addend in AX register pair
3. Get the Augend in CX register pair
4. Add Augend and addend
5. Check for carry, If it is one go to step 6 else go to step 7
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

6. Increments carry (BL register by 1)
7. Store the sum in memory from AX register pair
8. Store the carry in memory from BL register
9. Stop
Program:
Address
Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 1010H
1007 MOV CX, 2020H
100B CLC
100C ADD AX, CX
100E JNC Label1
1010 INC BL
1012 Label 1 MOV [1200], AX
1016 MOV [1202], BL
101A HLT
Precaution:
Make sure that all the machine codes should be as per the specified in the program.
Tabulation:
Input Output
Address Data Address Data








2. Subtraction:
Algorithm:
1. Clear BL register for storing borrow
2. Get the minuend in AX register pair
3. Get the subtrahend in CX register pair
4. Subtract minuend and subtrahend
5. Check borrow, if borrow is one go to step 6 else go to step 8
6. Increment borrow (BL register by 1)
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

7. Negate AX register
8. Store the difference from AX in memory
9. Story the borrow from BL in memory
10. Stop
Program:
Address Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 2024H
1007 MOV CX, 1010H
100B SUB AX, CX
100D JNC Label1
100F INC BL
1011 NEG AX
1013 Label 1 MOV [1200], AX
1017 MOV [1202], BL
101B HLT

Tabulation:
Input Output
Address Data Address Data






3. Multiplication
Algorithm:
1. Clear DX register
2. Load the AX register pair with multiplicand
3. Load the CX register pair with multiplier
4. Multiply multiplicand and multiplier
5. Store the higher byte of product(from DX register pair) in memory specified
6. Store the lower byte of product(from AX register pair) in memory specified
7. Stop
8.
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV DX, 0000H
1004 MOV AX, 00FFH
1008 MOV CX, 0002H
100C MUL CX
100E MOV [1200], AX
1012 MOV [1202], DX
1016 HLT
Tabulation:
Input Output
Address Data Address Data






4. Division:
Algorithm
1. Clear DX register
2. Load the AX register pair with dividend
3. Load the CX register pair with divisor
4. Dividend divided by divisor
5. Store the quotient (from AX register pair) in memory specified
6. Store the remainder (from DX register pair) in memory specified
7. Stop
Program:
Address Label Mnemonics
1000 MOV DX, 0000H
1004 MOV AX, 0008H
1008 MOV CX, 0004H
100C DIV CX
100E MOV [1200], AX
1012 MOV [1202], DX
1016 HLT

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


Result:
Thus Assembly language program are written to perform arithmetic operation using 8086 microprocessor.
They are executed using 8086 processor and the outputs are verified.
Outcome:
At the end of this experiment the students able to write ALP programs for Arithmetic and Logical operations.

1. Write the size of the data bus of 8086.
2. Write the size of the address bus of 8086.
3. What is meant by physical addressing in 8086?
4. What is meant by an Opcode?
5. What is meant by an Operand?
6. What is meant by a Mnemonics?
7. What are the other possibilities of writing ADD, SUB and MUL instructions in other addressing modes?
8. What is the difference between microprocessor and microcontroller?
9. What is meant by LATCH?
10. What is the difference between primary & secondary storage device?
11. What is the difference between static and dynamic RAM?
12. What is an interrupt?
13. Differentiate between RAM and ROM?
14. Define ? Compiler
15. Define ? Flag
16. Define ? Stack
17. How clock signal is generated in 8086 microprocessor?
18. State the functions of queue status line QS0 and QS1 in 8086 microprocessor.
19. What is the purpose of BIU& EU?
20. List out the two examples of assembler directives.

Viva ? voce
15 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Applications:
1. barrel shifters
2. Multiple-precision arithmetic
3. Calculation pipeline
4. binary multipliers
5. Calculation in a single clock

16 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.2 DECIMAL ARITHMETIC AND CODE CONVERSION
Aim:
To write an Assembly Language Program to perform Code conversion and Decimal Arithmetic operations
and to execute using 8086 microprocessor
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
Decimal Arithmetic:
1. Using DAA
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Clear the CL reg.
4. Add the contents of AL and BL.
5. Adjust decimal accumulator after addition.
6. Store the result.
FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING


EC6513 ? MICROPROCESSOR AND MICROCONTROLLERLABORATORY


V SEMESTER - R 2013










Name : _______________________________________
Register No. : _______________________________________
Section : _______________________________________



LABORATORY MANUAL
2 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY


C01 - To learn the working of ARM processor
C02 - To introduce ALP concepts and features
C03 - To write ALP for arithmetic and logical operations in 8086 and 8051
C04 - To differentiate Serial and Parallel Interface
C05 - To interface different I/Os with Microprocessors
C06 - To be familiar with MASM
.




1. Write programs in ARM for a specific Application
2. Write ALP Programs for fixed and Floating Point and Arithmetic
3. Interface different I/Os with processor and Generate waveforms using Microprocessors
4. Execute Programs in 8051
5. Assess the performance of optical devices: light sources, fibers and detectors from both physical and system
point of view

INTRODUCTION
This course illustrates the concepts covered in course CS6412 and provides students with hands-on
experience in Assembly language programs.
PREREQUISITE:
1. Digital Electronics
EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
Lecture
No./Session No.
Name of the Experiment
Course
objectives
Proposed
date

1,2,3
Introduction to lab
CO1

CYCLE I - 8086 PROGRAMS USING KITS AND MASM
4,5,6 Basic arithmetic and Logical operations CO2
COURSE OBJECTIVES
COURSE OUTCOMES
3 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00













7,8,9 Decimal arithmetic and Code conversion CO3
10,11,12
Move a data block without overlap
CO3
Matrix operations
13,14,15 Searching and Sorting a sting in a given array CO2
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
16,17,18 D/A interface and Waveform Generation CO4
19,20,21 A/D interface CO5
22,23,24 Key board and Display CO5
25,26,27
Stepper motor control CO2
Traffic light control CO5
28,29,30
Digital clock CO6
Serial interface and Parallel interface CO4
CYCLE III - 8051 PROGRAMS USING KITS AND MASM
31,32,33 Basic arithmetic and Logical operations CO1
34,35,36
Square and Cube program, Find 2?s complement of a number
CO5
Unpacked BCD to ASCII
37,38,39
Password checking and Print RAM size with system date
CO6
Counters and Time Delay
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
40,41,42 Sorting of an array using 8051 CO2
43,44,45
Separate odd and even numbers using 8086


CO3
Sum of N consecutive numbers using 8086
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00




College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING




To impart professional education integrated with human values to the younger generation, so as to shape
them as proficient and dedicated engineers, capable of providing comprehensive solutions to the challenges in
deploying technology for the service of humanity



? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices


VISION
MISSION
VISION
MISSION
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of
engineering that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this
enables to find solutions for real time problem in industry and organization and to design products
requiring interdisciplinary skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up
their communication skills, individual leadership and supportive qualities and to develop them to adapt and
work in ever changing technologies
5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees











6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer
Science and Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the
career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both
verbal and written forms
i) To work in a team as team member or a leader and make unique contributions and work with
coordination
j) To engage lifelong learning and exhibit their technical skills
k) To develop and manage projects in multidisciplinary environments










7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER
LABORATORY
SYLLABUS

? To learn the working of ARM processor
? To introduce ALP concepts and features
? To write ALP for arithmetic and logical operations in 8086 and 8051
? To differentiate Serial and Parallel Interface
? To interface different I/Os with Microprocessors
? To be familiar with MASM
LIST OF EXPERIMENTS:
8086 Programs using kits and MASM
1. Basic arithmetic and Logical operations
2. Move a data block without overlap
3. Code conversion, decimal arithmetic and Matrix operations.
4. Floating point operations, string manipulations, sorting and searching
5. Password checking, Print RAM size and system date
6. Counters and Time Delay
Peripherals and Interfacing Experiments
7. Traffic light control
8. Stepper motor control
9. Digital clock
10. Key board and Display
11. Printer status
12. Serial interface and Parallel interface
13. A/D and D/A interface and Waveform Generation 8051
Experiments using kits and MASM
14. Basic arithmetic and Logical operations
15. Square and Cube program, Find 2 ?s complement of a number
16. Unpacked BCD to ASCII

? Write programs in ARM for a specific Application
? Write ALP Programs for fixed and Floating Point and Arithmetic
? Interface different I/Os with processor and Generate waveforms using Microprocessors
? Execute Programs in 8051
? Assess the performance of optical devices: light sources, fibers and detectors from both physical and
system point of view


COURSE OUTCOMES
COURSE OBJECTIVES
8 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 - 8086 PROGRAMS USING KITS AND MASM
1 Basic arithmetic and Logical operations 10
2 Decimal arithmetic and Code conversion 15
3 Move a data block without overlap 21
4 Matrix operations 24
5 Searching and Sorting a sting in a given array 27
6 Password checking and Print RAM size with system date 33
7 Counters and Time Delay 36
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
8 Stepper motor control 39
9 Traffic light control 42
10 Digital clock 47
11 Serial interface and Parallel interface 50
12 A/D interface 54
13 Key board and Display 57
14 D/A interface and Waveform Generation 60
CYCLE 3 - 8051 PROGRAMS USING KITS AND MASM
15 Basic arithmetic and Logical operations 64
16 Square and Cube program, Find 2?s complement of a number 69
17 Unpacked BCD to ASCII 71
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
18 Sorting of an array using 8051 74
19 Separate odd and even numbers using 8086 77
20 Sum of N consecutive numbers using 8086 80

9 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.1 BASIC ARITHMETIC AND LOGICAL OPERATIONS

Aim:
To write an Assembly Language Program to perform Arithmetic operation and to execute using 8086
microprocessor
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
Arithmetic Operation:
1. Addition:
Algorithm:
1. Clear BL register to store carry
2. Get the addend in AX register pair
3. Get the Augend in CX register pair
4. Add Augend and addend
5. Check for carry, If it is one go to step 6 else go to step 7
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

6. Increments carry (BL register by 1)
7. Store the sum in memory from AX register pair
8. Store the carry in memory from BL register
9. Stop
Program:
Address
Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 1010H
1007 MOV CX, 2020H
100B CLC
100C ADD AX, CX
100E JNC Label1
1010 INC BL
1012 Label 1 MOV [1200], AX
1016 MOV [1202], BL
101A HLT
Precaution:
Make sure that all the machine codes should be as per the specified in the program.
Tabulation:
Input Output
Address Data Address Data








2. Subtraction:
Algorithm:
1. Clear BL register for storing borrow
2. Get the minuend in AX register pair
3. Get the subtrahend in CX register pair
4. Subtract minuend and subtrahend
5. Check borrow, if borrow is one go to step 6 else go to step 8
6. Increment borrow (BL register by 1)
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

7. Negate AX register
8. Store the difference from AX in memory
9. Story the borrow from BL in memory
10. Stop
Program:
Address Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 2024H
1007 MOV CX, 1010H
100B SUB AX, CX
100D JNC Label1
100F INC BL
1011 NEG AX
1013 Label 1 MOV [1200], AX
1017 MOV [1202], BL
101B HLT

Tabulation:
Input Output
Address Data Address Data






3. Multiplication
Algorithm:
1. Clear DX register
2. Load the AX register pair with multiplicand
3. Load the CX register pair with multiplier
4. Multiply multiplicand and multiplier
5. Store the higher byte of product(from DX register pair) in memory specified
6. Store the lower byte of product(from AX register pair) in memory specified
7. Stop
8.
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV DX, 0000H
1004 MOV AX, 00FFH
1008 MOV CX, 0002H
100C MUL CX
100E MOV [1200], AX
1012 MOV [1202], DX
1016 HLT
Tabulation:
Input Output
Address Data Address Data






4. Division:
Algorithm
1. Clear DX register
2. Load the AX register pair with dividend
3. Load the CX register pair with divisor
4. Dividend divided by divisor
5. Store the quotient (from AX register pair) in memory specified
6. Store the remainder (from DX register pair) in memory specified
7. Stop
Program:
Address Label Mnemonics
1000 MOV DX, 0000H
1004 MOV AX, 0008H
1008 MOV CX, 0004H
100C DIV CX
100E MOV [1200], AX
1012 MOV [1202], DX
1016 HLT

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


Result:
Thus Assembly language program are written to perform arithmetic operation using 8086 microprocessor.
They are executed using 8086 processor and the outputs are verified.
Outcome:
At the end of this experiment the students able to write ALP programs for Arithmetic and Logical operations.

1. Write the size of the data bus of 8086.
2. Write the size of the address bus of 8086.
3. What is meant by physical addressing in 8086?
4. What is meant by an Opcode?
5. What is meant by an Operand?
6. What is meant by a Mnemonics?
7. What are the other possibilities of writing ADD, SUB and MUL instructions in other addressing modes?
8. What is the difference between microprocessor and microcontroller?
9. What is meant by LATCH?
10. What is the difference between primary & secondary storage device?
11. What is the difference between static and dynamic RAM?
12. What is an interrupt?
13. Differentiate between RAM and ROM?
14. Define ? Compiler
15. Define ? Flag
16. Define ? Stack
17. How clock signal is generated in 8086 microprocessor?
18. State the functions of queue status line QS0 and QS1 in 8086 microprocessor.
19. What is the purpose of BIU& EU?
20. List out the two examples of assembler directives.

Viva ? voce
15 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Applications:
1. barrel shifters
2. Multiple-precision arithmetic
3. Calculation pipeline
4. binary multipliers
5. Calculation in a single clock

16 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.2 DECIMAL ARITHMETIC AND CODE CONVERSION
Aim:
To write an Assembly Language Program to perform Code conversion and Decimal Arithmetic operations
and to execute using 8086 microprocessor
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
Decimal Arithmetic:
1. Using DAA
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Clear the CL reg.
4. Add the contents of AL and BL.
5. Adjust decimal accumulator after addition.
6. Store the result.
17 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 MOV CL, 00
100B ADD AL,BL
100D DAA
100E JNC L1
1010 INC CL
1012 L1 MOV [1150], AL
1016 MOV [1151], CL
101A HLT

Tabulation:
Input Output
Address Data Address Data


2. Using AAM
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Multiply the contents of AL and BL.
4. Adjust decimal accumulator after multiplication.
5. Store the result.
Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 MUL BL
100A AAM
100C MOV [1150], AH
1010 MOV [1151], AL
1014 HLT

FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING


EC6513 ? MICROPROCESSOR AND MICROCONTROLLERLABORATORY


V SEMESTER - R 2013










Name : _______________________________________
Register No. : _______________________________________
Section : _______________________________________



LABORATORY MANUAL
2 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY


C01 - To learn the working of ARM processor
C02 - To introduce ALP concepts and features
C03 - To write ALP for arithmetic and logical operations in 8086 and 8051
C04 - To differentiate Serial and Parallel Interface
C05 - To interface different I/Os with Microprocessors
C06 - To be familiar with MASM
.




1. Write programs in ARM for a specific Application
2. Write ALP Programs for fixed and Floating Point and Arithmetic
3. Interface different I/Os with processor and Generate waveforms using Microprocessors
4. Execute Programs in 8051
5. Assess the performance of optical devices: light sources, fibers and detectors from both physical and system
point of view

INTRODUCTION
This course illustrates the concepts covered in course CS6412 and provides students with hands-on
experience in Assembly language programs.
PREREQUISITE:
1. Digital Electronics
EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
Lecture
No./Session No.
Name of the Experiment
Course
objectives
Proposed
date

1,2,3
Introduction to lab
CO1

CYCLE I - 8086 PROGRAMS USING KITS AND MASM
4,5,6 Basic arithmetic and Logical operations CO2
COURSE OBJECTIVES
COURSE OUTCOMES
3 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00













7,8,9 Decimal arithmetic and Code conversion CO3
10,11,12
Move a data block without overlap
CO3
Matrix operations
13,14,15 Searching and Sorting a sting in a given array CO2
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
16,17,18 D/A interface and Waveform Generation CO4
19,20,21 A/D interface CO5
22,23,24 Key board and Display CO5
25,26,27
Stepper motor control CO2
Traffic light control CO5
28,29,30
Digital clock CO6
Serial interface and Parallel interface CO4
CYCLE III - 8051 PROGRAMS USING KITS AND MASM
31,32,33 Basic arithmetic and Logical operations CO1
34,35,36
Square and Cube program, Find 2?s complement of a number
CO5
Unpacked BCD to ASCII
37,38,39
Password checking and Print RAM size with system date
CO6
Counters and Time Delay
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
40,41,42 Sorting of an array using 8051 CO2
43,44,45
Separate odd and even numbers using 8086


CO3
Sum of N consecutive numbers using 8086
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00




College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING




To impart professional education integrated with human values to the younger generation, so as to shape
them as proficient and dedicated engineers, capable of providing comprehensive solutions to the challenges in
deploying technology for the service of humanity



? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices


VISION
MISSION
VISION
MISSION
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of
engineering that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this
enables to find solutions for real time problem in industry and organization and to design products
requiring interdisciplinary skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up
their communication skills, individual leadership and supportive qualities and to develop them to adapt and
work in ever changing technologies
5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees











6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer
Science and Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the
career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both
verbal and written forms
i) To work in a team as team member or a leader and make unique contributions and work with
coordination
j) To engage lifelong learning and exhibit their technical skills
k) To develop and manage projects in multidisciplinary environments










7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER
LABORATORY
SYLLABUS

? To learn the working of ARM processor
? To introduce ALP concepts and features
? To write ALP for arithmetic and logical operations in 8086 and 8051
? To differentiate Serial and Parallel Interface
? To interface different I/Os with Microprocessors
? To be familiar with MASM
LIST OF EXPERIMENTS:
8086 Programs using kits and MASM
1. Basic arithmetic and Logical operations
2. Move a data block without overlap
3. Code conversion, decimal arithmetic and Matrix operations.
4. Floating point operations, string manipulations, sorting and searching
5. Password checking, Print RAM size and system date
6. Counters and Time Delay
Peripherals and Interfacing Experiments
7. Traffic light control
8. Stepper motor control
9. Digital clock
10. Key board and Display
11. Printer status
12. Serial interface and Parallel interface
13. A/D and D/A interface and Waveform Generation 8051
Experiments using kits and MASM
14. Basic arithmetic and Logical operations
15. Square and Cube program, Find 2 ?s complement of a number
16. Unpacked BCD to ASCII

? Write programs in ARM for a specific Application
? Write ALP Programs for fixed and Floating Point and Arithmetic
? Interface different I/Os with processor and Generate waveforms using Microprocessors
? Execute Programs in 8051
? Assess the performance of optical devices: light sources, fibers and detectors from both physical and
system point of view


COURSE OUTCOMES
COURSE OBJECTIVES
8 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 - 8086 PROGRAMS USING KITS AND MASM
1 Basic arithmetic and Logical operations 10
2 Decimal arithmetic and Code conversion 15
3 Move a data block without overlap 21
4 Matrix operations 24
5 Searching and Sorting a sting in a given array 27
6 Password checking and Print RAM size with system date 33
7 Counters and Time Delay 36
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
8 Stepper motor control 39
9 Traffic light control 42
10 Digital clock 47
11 Serial interface and Parallel interface 50
12 A/D interface 54
13 Key board and Display 57
14 D/A interface and Waveform Generation 60
CYCLE 3 - 8051 PROGRAMS USING KITS AND MASM
15 Basic arithmetic and Logical operations 64
16 Square and Cube program, Find 2?s complement of a number 69
17 Unpacked BCD to ASCII 71
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
18 Sorting of an array using 8051 74
19 Separate odd and even numbers using 8086 77
20 Sum of N consecutive numbers using 8086 80

9 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.1 BASIC ARITHMETIC AND LOGICAL OPERATIONS

Aim:
To write an Assembly Language Program to perform Arithmetic operation and to execute using 8086
microprocessor
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
Arithmetic Operation:
1. Addition:
Algorithm:
1. Clear BL register to store carry
2. Get the addend in AX register pair
3. Get the Augend in CX register pair
4. Add Augend and addend
5. Check for carry, If it is one go to step 6 else go to step 7
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

6. Increments carry (BL register by 1)
7. Store the sum in memory from AX register pair
8. Store the carry in memory from BL register
9. Stop
Program:
Address
Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 1010H
1007 MOV CX, 2020H
100B CLC
100C ADD AX, CX
100E JNC Label1
1010 INC BL
1012 Label 1 MOV [1200], AX
1016 MOV [1202], BL
101A HLT
Precaution:
Make sure that all the machine codes should be as per the specified in the program.
Tabulation:
Input Output
Address Data Address Data








2. Subtraction:
Algorithm:
1. Clear BL register for storing borrow
2. Get the minuend in AX register pair
3. Get the subtrahend in CX register pair
4. Subtract minuend and subtrahend
5. Check borrow, if borrow is one go to step 6 else go to step 8
6. Increment borrow (BL register by 1)
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

7. Negate AX register
8. Store the difference from AX in memory
9. Story the borrow from BL in memory
10. Stop
Program:
Address Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 2024H
1007 MOV CX, 1010H
100B SUB AX, CX
100D JNC Label1
100F INC BL
1011 NEG AX
1013 Label 1 MOV [1200], AX
1017 MOV [1202], BL
101B HLT

Tabulation:
Input Output
Address Data Address Data






3. Multiplication
Algorithm:
1. Clear DX register
2. Load the AX register pair with multiplicand
3. Load the CX register pair with multiplier
4. Multiply multiplicand and multiplier
5. Store the higher byte of product(from DX register pair) in memory specified
6. Store the lower byte of product(from AX register pair) in memory specified
7. Stop
8.
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV DX, 0000H
1004 MOV AX, 00FFH
1008 MOV CX, 0002H
100C MUL CX
100E MOV [1200], AX
1012 MOV [1202], DX
1016 HLT
Tabulation:
Input Output
Address Data Address Data






4. Division:
Algorithm
1. Clear DX register
2. Load the AX register pair with dividend
3. Load the CX register pair with divisor
4. Dividend divided by divisor
5. Store the quotient (from AX register pair) in memory specified
6. Store the remainder (from DX register pair) in memory specified
7. Stop
Program:
Address Label Mnemonics
1000 MOV DX, 0000H
1004 MOV AX, 0008H
1008 MOV CX, 0004H
100C DIV CX
100E MOV [1200], AX
1012 MOV [1202], DX
1016 HLT

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


Result:
Thus Assembly language program are written to perform arithmetic operation using 8086 microprocessor.
They are executed using 8086 processor and the outputs are verified.
Outcome:
At the end of this experiment the students able to write ALP programs for Arithmetic and Logical operations.

1. Write the size of the data bus of 8086.
2. Write the size of the address bus of 8086.
3. What is meant by physical addressing in 8086?
4. What is meant by an Opcode?
5. What is meant by an Operand?
6. What is meant by a Mnemonics?
7. What are the other possibilities of writing ADD, SUB and MUL instructions in other addressing modes?
8. What is the difference between microprocessor and microcontroller?
9. What is meant by LATCH?
10. What is the difference between primary & secondary storage device?
11. What is the difference between static and dynamic RAM?
12. What is an interrupt?
13. Differentiate between RAM and ROM?
14. Define ? Compiler
15. Define ? Flag
16. Define ? Stack
17. How clock signal is generated in 8086 microprocessor?
18. State the functions of queue status line QS0 and QS1 in 8086 microprocessor.
19. What is the purpose of BIU& EU?
20. List out the two examples of assembler directives.

Viva ? voce
15 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Applications:
1. barrel shifters
2. Multiple-precision arithmetic
3. Calculation pipeline
4. binary multipliers
5. Calculation in a single clock

16 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.2 DECIMAL ARITHMETIC AND CODE CONVERSION
Aim:
To write an Assembly Language Program to perform Code conversion and Decimal Arithmetic operations
and to execute using 8086 microprocessor
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
Decimal Arithmetic:
1. Using DAA
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Clear the CL reg.
4. Add the contents of AL and BL.
5. Adjust decimal accumulator after addition.
6. Store the result.
17 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 MOV CL, 00
100B ADD AL,BL
100D DAA
100E JNC L1
1010 INC CL
1012 L1 MOV [1150], AL
1016 MOV [1151], CL
101A HLT

Tabulation:
Input Output
Address Data Address Data


2. Using AAM
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Multiply the contents of AL and BL.
4. Adjust decimal accumulator after multiplication.
5. Store the result.
Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 MUL BL
100A AAM
100C MOV [1150], AH
1010 MOV [1151], AL
1014 HLT

18 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


3. Using DAS
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Subtract the contents of BL from AL.
4. Adjust decimal accumulator after subtraction.
5. Store the result.
Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 SUB AL,BL
100A DAS
100B MOV [1150], AL
100F HLT
Tabulation:
Input Output
Address Data Address Data


Code Conversion:
1. Binary to BCD
Algorithm:
1. Get the input and store in AL.
2. Clear the carry flag.
3. Rotate right the bits of input.
4. Find logical XOR between input and shifted input.
5. Store the result.
FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING


EC6513 ? MICROPROCESSOR AND MICROCONTROLLERLABORATORY


V SEMESTER - R 2013










Name : _______________________________________
Register No. : _______________________________________
Section : _______________________________________



LABORATORY MANUAL
2 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY


C01 - To learn the working of ARM processor
C02 - To introduce ALP concepts and features
C03 - To write ALP for arithmetic and logical operations in 8086 and 8051
C04 - To differentiate Serial and Parallel Interface
C05 - To interface different I/Os with Microprocessors
C06 - To be familiar with MASM
.




1. Write programs in ARM for a specific Application
2. Write ALP Programs for fixed and Floating Point and Arithmetic
3. Interface different I/Os with processor and Generate waveforms using Microprocessors
4. Execute Programs in 8051
5. Assess the performance of optical devices: light sources, fibers and detectors from both physical and system
point of view

INTRODUCTION
This course illustrates the concepts covered in course CS6412 and provides students with hands-on
experience in Assembly language programs.
PREREQUISITE:
1. Digital Electronics
EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
Lecture
No./Session No.
Name of the Experiment
Course
objectives
Proposed
date

1,2,3
Introduction to lab
CO1

CYCLE I - 8086 PROGRAMS USING KITS AND MASM
4,5,6 Basic arithmetic and Logical operations CO2
COURSE OBJECTIVES
COURSE OUTCOMES
3 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00













7,8,9 Decimal arithmetic and Code conversion CO3
10,11,12
Move a data block without overlap
CO3
Matrix operations
13,14,15 Searching and Sorting a sting in a given array CO2
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
16,17,18 D/A interface and Waveform Generation CO4
19,20,21 A/D interface CO5
22,23,24 Key board and Display CO5
25,26,27
Stepper motor control CO2
Traffic light control CO5
28,29,30
Digital clock CO6
Serial interface and Parallel interface CO4
CYCLE III - 8051 PROGRAMS USING KITS AND MASM
31,32,33 Basic arithmetic and Logical operations CO1
34,35,36
Square and Cube program, Find 2?s complement of a number
CO5
Unpacked BCD to ASCII
37,38,39
Password checking and Print RAM size with system date
CO6
Counters and Time Delay
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
40,41,42 Sorting of an array using 8051 CO2
43,44,45
Separate odd and even numbers using 8086


CO3
Sum of N consecutive numbers using 8086
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00




College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING




To impart professional education integrated with human values to the younger generation, so as to shape
them as proficient and dedicated engineers, capable of providing comprehensive solutions to the challenges in
deploying technology for the service of humanity



? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices


VISION
MISSION
VISION
MISSION
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of
engineering that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this
enables to find solutions for real time problem in industry and organization and to design products
requiring interdisciplinary skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up
their communication skills, individual leadership and supportive qualities and to develop them to adapt and
work in ever changing technologies
5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees











6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer
Science and Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the
career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both
verbal and written forms
i) To work in a team as team member or a leader and make unique contributions and work with
coordination
j) To engage lifelong learning and exhibit their technical skills
k) To develop and manage projects in multidisciplinary environments










7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER
LABORATORY
SYLLABUS

? To learn the working of ARM processor
? To introduce ALP concepts and features
? To write ALP for arithmetic and logical operations in 8086 and 8051
? To differentiate Serial and Parallel Interface
? To interface different I/Os with Microprocessors
? To be familiar with MASM
LIST OF EXPERIMENTS:
8086 Programs using kits and MASM
1. Basic arithmetic and Logical operations
2. Move a data block without overlap
3. Code conversion, decimal arithmetic and Matrix operations.
4. Floating point operations, string manipulations, sorting and searching
5. Password checking, Print RAM size and system date
6. Counters and Time Delay
Peripherals and Interfacing Experiments
7. Traffic light control
8. Stepper motor control
9. Digital clock
10. Key board and Display
11. Printer status
12. Serial interface and Parallel interface
13. A/D and D/A interface and Waveform Generation 8051
Experiments using kits and MASM
14. Basic arithmetic and Logical operations
15. Square and Cube program, Find 2 ?s complement of a number
16. Unpacked BCD to ASCII

? Write programs in ARM for a specific Application
? Write ALP Programs for fixed and Floating Point and Arithmetic
? Interface different I/Os with processor and Generate waveforms using Microprocessors
? Execute Programs in 8051
? Assess the performance of optical devices: light sources, fibers and detectors from both physical and
system point of view


COURSE OUTCOMES
COURSE OBJECTIVES
8 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 - 8086 PROGRAMS USING KITS AND MASM
1 Basic arithmetic and Logical operations 10
2 Decimal arithmetic and Code conversion 15
3 Move a data block without overlap 21
4 Matrix operations 24
5 Searching and Sorting a sting in a given array 27
6 Password checking and Print RAM size with system date 33
7 Counters and Time Delay 36
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
8 Stepper motor control 39
9 Traffic light control 42
10 Digital clock 47
11 Serial interface and Parallel interface 50
12 A/D interface 54
13 Key board and Display 57
14 D/A interface and Waveform Generation 60
CYCLE 3 - 8051 PROGRAMS USING KITS AND MASM
15 Basic arithmetic and Logical operations 64
16 Square and Cube program, Find 2?s complement of a number 69
17 Unpacked BCD to ASCII 71
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
18 Sorting of an array using 8051 74
19 Separate odd and even numbers using 8086 77
20 Sum of N consecutive numbers using 8086 80

9 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.1 BASIC ARITHMETIC AND LOGICAL OPERATIONS

Aim:
To write an Assembly Language Program to perform Arithmetic operation and to execute using 8086
microprocessor
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
Arithmetic Operation:
1. Addition:
Algorithm:
1. Clear BL register to store carry
2. Get the addend in AX register pair
3. Get the Augend in CX register pair
4. Add Augend and addend
5. Check for carry, If it is one go to step 6 else go to step 7
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

6. Increments carry (BL register by 1)
7. Store the sum in memory from AX register pair
8. Store the carry in memory from BL register
9. Stop
Program:
Address
Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 1010H
1007 MOV CX, 2020H
100B CLC
100C ADD AX, CX
100E JNC Label1
1010 INC BL
1012 Label 1 MOV [1200], AX
1016 MOV [1202], BL
101A HLT
Precaution:
Make sure that all the machine codes should be as per the specified in the program.
Tabulation:
Input Output
Address Data Address Data








2. Subtraction:
Algorithm:
1. Clear BL register for storing borrow
2. Get the minuend in AX register pair
3. Get the subtrahend in CX register pair
4. Subtract minuend and subtrahend
5. Check borrow, if borrow is one go to step 6 else go to step 8
6. Increment borrow (BL register by 1)
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

7. Negate AX register
8. Store the difference from AX in memory
9. Story the borrow from BL in memory
10. Stop
Program:
Address Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 2024H
1007 MOV CX, 1010H
100B SUB AX, CX
100D JNC Label1
100F INC BL
1011 NEG AX
1013 Label 1 MOV [1200], AX
1017 MOV [1202], BL
101B HLT

Tabulation:
Input Output
Address Data Address Data






3. Multiplication
Algorithm:
1. Clear DX register
2. Load the AX register pair with multiplicand
3. Load the CX register pair with multiplier
4. Multiply multiplicand and multiplier
5. Store the higher byte of product(from DX register pair) in memory specified
6. Store the lower byte of product(from AX register pair) in memory specified
7. Stop
8.
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV DX, 0000H
1004 MOV AX, 00FFH
1008 MOV CX, 0002H
100C MUL CX
100E MOV [1200], AX
1012 MOV [1202], DX
1016 HLT
Tabulation:
Input Output
Address Data Address Data






4. Division:
Algorithm
1. Clear DX register
2. Load the AX register pair with dividend
3. Load the CX register pair with divisor
4. Dividend divided by divisor
5. Store the quotient (from AX register pair) in memory specified
6. Store the remainder (from DX register pair) in memory specified
7. Stop
Program:
Address Label Mnemonics
1000 MOV DX, 0000H
1004 MOV AX, 0008H
1008 MOV CX, 0004H
100C DIV CX
100E MOV [1200], AX
1012 MOV [1202], DX
1016 HLT

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


Result:
Thus Assembly language program are written to perform arithmetic operation using 8086 microprocessor.
They are executed using 8086 processor and the outputs are verified.
Outcome:
At the end of this experiment the students able to write ALP programs for Arithmetic and Logical operations.

1. Write the size of the data bus of 8086.
2. Write the size of the address bus of 8086.
3. What is meant by physical addressing in 8086?
4. What is meant by an Opcode?
5. What is meant by an Operand?
6. What is meant by a Mnemonics?
7. What are the other possibilities of writing ADD, SUB and MUL instructions in other addressing modes?
8. What is the difference between microprocessor and microcontroller?
9. What is meant by LATCH?
10. What is the difference between primary & secondary storage device?
11. What is the difference between static and dynamic RAM?
12. What is an interrupt?
13. Differentiate between RAM and ROM?
14. Define ? Compiler
15. Define ? Flag
16. Define ? Stack
17. How clock signal is generated in 8086 microprocessor?
18. State the functions of queue status line QS0 and QS1 in 8086 microprocessor.
19. What is the purpose of BIU& EU?
20. List out the two examples of assembler directives.

Viva ? voce
15 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Applications:
1. barrel shifters
2. Multiple-precision arithmetic
3. Calculation pipeline
4. binary multipliers
5. Calculation in a single clock

16 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.2 DECIMAL ARITHMETIC AND CODE CONVERSION
Aim:
To write an Assembly Language Program to perform Code conversion and Decimal Arithmetic operations
and to execute using 8086 microprocessor
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
Decimal Arithmetic:
1. Using DAA
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Clear the CL reg.
4. Add the contents of AL and BL.
5. Adjust decimal accumulator after addition.
6. Store the result.
17 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 MOV CL, 00
100B ADD AL,BL
100D DAA
100E JNC L1
1010 INC CL
1012 L1 MOV [1150], AL
1016 MOV [1151], CL
101A HLT

Tabulation:
Input Output
Address Data Address Data


2. Using AAM
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Multiply the contents of AL and BL.
4. Adjust decimal accumulator after multiplication.
5. Store the result.
Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 MUL BL
100A AAM
100C MOV [1150], AH
1010 MOV [1151], AL
1014 HLT

18 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


3. Using DAS
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Subtract the contents of BL from AL.
4. Adjust decimal accumulator after subtraction.
5. Store the result.
Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 SUB AL,BL
100A DAS
100B MOV [1150], AL
100F HLT
Tabulation:
Input Output
Address Data Address Data


Code Conversion:
1. Binary to BCD
Algorithm:
1. Get the input and store in AL.
2. Clear the carry flag.
3. Rotate right the bits of input.
4. Find logical XOR between input and shifted input.
5. Store the result.
19 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 XOR AX,AX
1002 XOR CX,CX
1004 MOV BX,000B
1008 L2 CMP BX,00
100C JZ L1
100E DEC BX
100F MOV AL,CL
1011 ADD AL,01
1014 DAA
1015 MOV CL,AL
1017 MOV AL,CH
1019 ADC AL,00
101C DAA
101D MOV CH,AL
101F JMP L2
1022 MOV [1150],CX
1026 HLT
Tabulation:
Input Output
Address Data Address Data




2. Binary to Gray
Algorithm:
1. Get the input and store in AL.
2. Clear the carry flag.
3. Rotate right the bits of input.
4. Find logical XOR between input and shifted input.
5. Store the result.

FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING


EC6513 ? MICROPROCESSOR AND MICROCONTROLLERLABORATORY


V SEMESTER - R 2013










Name : _______________________________________
Register No. : _______________________________________
Section : _______________________________________



LABORATORY MANUAL
2 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY


C01 - To learn the working of ARM processor
C02 - To introduce ALP concepts and features
C03 - To write ALP for arithmetic and logical operations in 8086 and 8051
C04 - To differentiate Serial and Parallel Interface
C05 - To interface different I/Os with Microprocessors
C06 - To be familiar with MASM
.




1. Write programs in ARM for a specific Application
2. Write ALP Programs for fixed and Floating Point and Arithmetic
3. Interface different I/Os with processor and Generate waveforms using Microprocessors
4. Execute Programs in 8051
5. Assess the performance of optical devices: light sources, fibers and detectors from both physical and system
point of view

INTRODUCTION
This course illustrates the concepts covered in course CS6412 and provides students with hands-on
experience in Assembly language programs.
PREREQUISITE:
1. Digital Electronics
EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
Lecture
No./Session No.
Name of the Experiment
Course
objectives
Proposed
date

1,2,3
Introduction to lab
CO1

CYCLE I - 8086 PROGRAMS USING KITS AND MASM
4,5,6 Basic arithmetic and Logical operations CO2
COURSE OBJECTIVES
COURSE OUTCOMES
3 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00













7,8,9 Decimal arithmetic and Code conversion CO3
10,11,12
Move a data block without overlap
CO3
Matrix operations
13,14,15 Searching and Sorting a sting in a given array CO2
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
16,17,18 D/A interface and Waveform Generation CO4
19,20,21 A/D interface CO5
22,23,24 Key board and Display CO5
25,26,27
Stepper motor control CO2
Traffic light control CO5
28,29,30
Digital clock CO6
Serial interface and Parallel interface CO4
CYCLE III - 8051 PROGRAMS USING KITS AND MASM
31,32,33 Basic arithmetic and Logical operations CO1
34,35,36
Square and Cube program, Find 2?s complement of a number
CO5
Unpacked BCD to ASCII
37,38,39
Password checking and Print RAM size with system date
CO6
Counters and Time Delay
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
40,41,42 Sorting of an array using 8051 CO2
43,44,45
Separate odd and even numbers using 8086


CO3
Sum of N consecutive numbers using 8086
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00




College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING




To impart professional education integrated with human values to the younger generation, so as to shape
them as proficient and dedicated engineers, capable of providing comprehensive solutions to the challenges in
deploying technology for the service of humanity



? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices


VISION
MISSION
VISION
MISSION
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of
engineering that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this
enables to find solutions for real time problem in industry and organization and to design products
requiring interdisciplinary skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up
their communication skills, individual leadership and supportive qualities and to develop them to adapt and
work in ever changing technologies
5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees











6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer
Science and Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the
career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both
verbal and written forms
i) To work in a team as team member or a leader and make unique contributions and work with
coordination
j) To engage lifelong learning and exhibit their technical skills
k) To develop and manage projects in multidisciplinary environments










7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER
LABORATORY
SYLLABUS

? To learn the working of ARM processor
? To introduce ALP concepts and features
? To write ALP for arithmetic and logical operations in 8086 and 8051
? To differentiate Serial and Parallel Interface
? To interface different I/Os with Microprocessors
? To be familiar with MASM
LIST OF EXPERIMENTS:
8086 Programs using kits and MASM
1. Basic arithmetic and Logical operations
2. Move a data block without overlap
3. Code conversion, decimal arithmetic and Matrix operations.
4. Floating point operations, string manipulations, sorting and searching
5. Password checking, Print RAM size and system date
6. Counters and Time Delay
Peripherals and Interfacing Experiments
7. Traffic light control
8. Stepper motor control
9. Digital clock
10. Key board and Display
11. Printer status
12. Serial interface and Parallel interface
13. A/D and D/A interface and Waveform Generation 8051
Experiments using kits and MASM
14. Basic arithmetic and Logical operations
15. Square and Cube program, Find 2 ?s complement of a number
16. Unpacked BCD to ASCII

? Write programs in ARM for a specific Application
? Write ALP Programs for fixed and Floating Point and Arithmetic
? Interface different I/Os with processor and Generate waveforms using Microprocessors
? Execute Programs in 8051
? Assess the performance of optical devices: light sources, fibers and detectors from both physical and
system point of view


COURSE OUTCOMES
COURSE OBJECTIVES
8 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 - 8086 PROGRAMS USING KITS AND MASM
1 Basic arithmetic and Logical operations 10
2 Decimal arithmetic and Code conversion 15
3 Move a data block without overlap 21
4 Matrix operations 24
5 Searching and Sorting a sting in a given array 27
6 Password checking and Print RAM size with system date 33
7 Counters and Time Delay 36
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
8 Stepper motor control 39
9 Traffic light control 42
10 Digital clock 47
11 Serial interface and Parallel interface 50
12 A/D interface 54
13 Key board and Display 57
14 D/A interface and Waveform Generation 60
CYCLE 3 - 8051 PROGRAMS USING KITS AND MASM
15 Basic arithmetic and Logical operations 64
16 Square and Cube program, Find 2?s complement of a number 69
17 Unpacked BCD to ASCII 71
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
18 Sorting of an array using 8051 74
19 Separate odd and even numbers using 8086 77
20 Sum of N consecutive numbers using 8086 80

9 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.1 BASIC ARITHMETIC AND LOGICAL OPERATIONS

Aim:
To write an Assembly Language Program to perform Arithmetic operation and to execute using 8086
microprocessor
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
Arithmetic Operation:
1. Addition:
Algorithm:
1. Clear BL register to store carry
2. Get the addend in AX register pair
3. Get the Augend in CX register pair
4. Add Augend and addend
5. Check for carry, If it is one go to step 6 else go to step 7
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

6. Increments carry (BL register by 1)
7. Store the sum in memory from AX register pair
8. Store the carry in memory from BL register
9. Stop
Program:
Address
Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 1010H
1007 MOV CX, 2020H
100B CLC
100C ADD AX, CX
100E JNC Label1
1010 INC BL
1012 Label 1 MOV [1200], AX
1016 MOV [1202], BL
101A HLT
Precaution:
Make sure that all the machine codes should be as per the specified in the program.
Tabulation:
Input Output
Address Data Address Data








2. Subtraction:
Algorithm:
1. Clear BL register for storing borrow
2. Get the minuend in AX register pair
3. Get the subtrahend in CX register pair
4. Subtract minuend and subtrahend
5. Check borrow, if borrow is one go to step 6 else go to step 8
6. Increment borrow (BL register by 1)
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

7. Negate AX register
8. Store the difference from AX in memory
9. Story the borrow from BL in memory
10. Stop
Program:
Address Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 2024H
1007 MOV CX, 1010H
100B SUB AX, CX
100D JNC Label1
100F INC BL
1011 NEG AX
1013 Label 1 MOV [1200], AX
1017 MOV [1202], BL
101B HLT

Tabulation:
Input Output
Address Data Address Data






3. Multiplication
Algorithm:
1. Clear DX register
2. Load the AX register pair with multiplicand
3. Load the CX register pair with multiplier
4. Multiply multiplicand and multiplier
5. Store the higher byte of product(from DX register pair) in memory specified
6. Store the lower byte of product(from AX register pair) in memory specified
7. Stop
8.
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV DX, 0000H
1004 MOV AX, 00FFH
1008 MOV CX, 0002H
100C MUL CX
100E MOV [1200], AX
1012 MOV [1202], DX
1016 HLT
Tabulation:
Input Output
Address Data Address Data






4. Division:
Algorithm
1. Clear DX register
2. Load the AX register pair with dividend
3. Load the CX register pair with divisor
4. Dividend divided by divisor
5. Store the quotient (from AX register pair) in memory specified
6. Store the remainder (from DX register pair) in memory specified
7. Stop
Program:
Address Label Mnemonics
1000 MOV DX, 0000H
1004 MOV AX, 0008H
1008 MOV CX, 0004H
100C DIV CX
100E MOV [1200], AX
1012 MOV [1202], DX
1016 HLT

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


Result:
Thus Assembly language program are written to perform arithmetic operation using 8086 microprocessor.
They are executed using 8086 processor and the outputs are verified.
Outcome:
At the end of this experiment the students able to write ALP programs for Arithmetic and Logical operations.

1. Write the size of the data bus of 8086.
2. Write the size of the address bus of 8086.
3. What is meant by physical addressing in 8086?
4. What is meant by an Opcode?
5. What is meant by an Operand?
6. What is meant by a Mnemonics?
7. What are the other possibilities of writing ADD, SUB and MUL instructions in other addressing modes?
8. What is the difference between microprocessor and microcontroller?
9. What is meant by LATCH?
10. What is the difference between primary & secondary storage device?
11. What is the difference between static and dynamic RAM?
12. What is an interrupt?
13. Differentiate between RAM and ROM?
14. Define ? Compiler
15. Define ? Flag
16. Define ? Stack
17. How clock signal is generated in 8086 microprocessor?
18. State the functions of queue status line QS0 and QS1 in 8086 microprocessor.
19. What is the purpose of BIU& EU?
20. List out the two examples of assembler directives.

Viva ? voce
15 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Applications:
1. barrel shifters
2. Multiple-precision arithmetic
3. Calculation pipeline
4. binary multipliers
5. Calculation in a single clock

16 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.2 DECIMAL ARITHMETIC AND CODE CONVERSION
Aim:
To write an Assembly Language Program to perform Code conversion and Decimal Arithmetic operations
and to execute using 8086 microprocessor
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
Decimal Arithmetic:
1. Using DAA
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Clear the CL reg.
4. Add the contents of AL and BL.
5. Adjust decimal accumulator after addition.
6. Store the result.
17 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 MOV CL, 00
100B ADD AL,BL
100D DAA
100E JNC L1
1010 INC CL
1012 L1 MOV [1150], AL
1016 MOV [1151], CL
101A HLT

Tabulation:
Input Output
Address Data Address Data


2. Using AAM
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Multiply the contents of AL and BL.
4. Adjust decimal accumulator after multiplication.
5. Store the result.
Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 MUL BL
100A AAM
100C MOV [1150], AH
1010 MOV [1151], AL
1014 HLT

18 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


3. Using DAS
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Subtract the contents of BL from AL.
4. Adjust decimal accumulator after subtraction.
5. Store the result.
Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 SUB AL,BL
100A DAS
100B MOV [1150], AL
100F HLT
Tabulation:
Input Output
Address Data Address Data


Code Conversion:
1. Binary to BCD
Algorithm:
1. Get the input and store in AL.
2. Clear the carry flag.
3. Rotate right the bits of input.
4. Find logical XOR between input and shifted input.
5. Store the result.
19 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 XOR AX,AX
1002 XOR CX,CX
1004 MOV BX,000B
1008 L2 CMP BX,00
100C JZ L1
100E DEC BX
100F MOV AL,CL
1011 ADD AL,01
1014 DAA
1015 MOV CL,AL
1017 MOV AL,CH
1019 ADC AL,00
101C DAA
101D MOV CH,AL
101F JMP L2
1022 MOV [1150],CX
1026 HLT
Tabulation:
Input Output
Address Data Address Data




2. Binary to Gray
Algorithm:
1. Get the input and store in AL.
2. Clear the carry flag.
3. Rotate right the bits of input.
4. Find logical XOR between input and shifted input.
5. Store the result.

20 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, AL
1006 CLC
1007 MOV CL,01
100A RCR AL,CL
100C XOR BL,AL
100E MOV [1150],BL
1012 HLT
Tabulation:
Input Output
Address Data Address Data


Result:
Thus an Assembly Language Program for code conversion and decimal arithmetic operations is written. The
program is executed using 8086 and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts of code conversions and
decimal arithmetic operations.








FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING


EC6513 ? MICROPROCESSOR AND MICROCONTROLLERLABORATORY


V SEMESTER - R 2013










Name : _______________________________________
Register No. : _______________________________________
Section : _______________________________________



LABORATORY MANUAL
2 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY


C01 - To learn the working of ARM processor
C02 - To introduce ALP concepts and features
C03 - To write ALP for arithmetic and logical operations in 8086 and 8051
C04 - To differentiate Serial and Parallel Interface
C05 - To interface different I/Os with Microprocessors
C06 - To be familiar with MASM
.




1. Write programs in ARM for a specific Application
2. Write ALP Programs for fixed and Floating Point and Arithmetic
3. Interface different I/Os with processor and Generate waveforms using Microprocessors
4. Execute Programs in 8051
5. Assess the performance of optical devices: light sources, fibers and detectors from both physical and system
point of view

INTRODUCTION
This course illustrates the concepts covered in course CS6412 and provides students with hands-on
experience in Assembly language programs.
PREREQUISITE:
1. Digital Electronics
EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
Lecture
No./Session No.
Name of the Experiment
Course
objectives
Proposed
date

1,2,3
Introduction to lab
CO1

CYCLE I - 8086 PROGRAMS USING KITS AND MASM
4,5,6 Basic arithmetic and Logical operations CO2
COURSE OBJECTIVES
COURSE OUTCOMES
3 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00













7,8,9 Decimal arithmetic and Code conversion CO3
10,11,12
Move a data block without overlap
CO3
Matrix operations
13,14,15 Searching and Sorting a sting in a given array CO2
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
16,17,18 D/A interface and Waveform Generation CO4
19,20,21 A/D interface CO5
22,23,24 Key board and Display CO5
25,26,27
Stepper motor control CO2
Traffic light control CO5
28,29,30
Digital clock CO6
Serial interface and Parallel interface CO4
CYCLE III - 8051 PROGRAMS USING KITS AND MASM
31,32,33 Basic arithmetic and Logical operations CO1
34,35,36
Square and Cube program, Find 2?s complement of a number
CO5
Unpacked BCD to ASCII
37,38,39
Password checking and Print RAM size with system date
CO6
Counters and Time Delay
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
40,41,42 Sorting of an array using 8051 CO2
43,44,45
Separate odd and even numbers using 8086


CO3
Sum of N consecutive numbers using 8086
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00




College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING




To impart professional education integrated with human values to the younger generation, so as to shape
them as proficient and dedicated engineers, capable of providing comprehensive solutions to the challenges in
deploying technology for the service of humanity



? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices


VISION
MISSION
VISION
MISSION
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of
engineering that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this
enables to find solutions for real time problem in industry and organization and to design products
requiring interdisciplinary skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up
their communication skills, individual leadership and supportive qualities and to develop them to adapt and
work in ever changing technologies
5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees











6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer
Science and Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the
career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both
verbal and written forms
i) To work in a team as team member or a leader and make unique contributions and work with
coordination
j) To engage lifelong learning and exhibit their technical skills
k) To develop and manage projects in multidisciplinary environments










7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER
LABORATORY
SYLLABUS

? To learn the working of ARM processor
? To introduce ALP concepts and features
? To write ALP for arithmetic and logical operations in 8086 and 8051
? To differentiate Serial and Parallel Interface
? To interface different I/Os with Microprocessors
? To be familiar with MASM
LIST OF EXPERIMENTS:
8086 Programs using kits and MASM
1. Basic arithmetic and Logical operations
2. Move a data block without overlap
3. Code conversion, decimal arithmetic and Matrix operations.
4. Floating point operations, string manipulations, sorting and searching
5. Password checking, Print RAM size and system date
6. Counters and Time Delay
Peripherals and Interfacing Experiments
7. Traffic light control
8. Stepper motor control
9. Digital clock
10. Key board and Display
11. Printer status
12. Serial interface and Parallel interface
13. A/D and D/A interface and Waveform Generation 8051
Experiments using kits and MASM
14. Basic arithmetic and Logical operations
15. Square and Cube program, Find 2 ?s complement of a number
16. Unpacked BCD to ASCII

? Write programs in ARM for a specific Application
? Write ALP Programs for fixed and Floating Point and Arithmetic
? Interface different I/Os with processor and Generate waveforms using Microprocessors
? Execute Programs in 8051
? Assess the performance of optical devices: light sources, fibers and detectors from both physical and
system point of view


COURSE OUTCOMES
COURSE OBJECTIVES
8 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 - 8086 PROGRAMS USING KITS AND MASM
1 Basic arithmetic and Logical operations 10
2 Decimal arithmetic and Code conversion 15
3 Move a data block without overlap 21
4 Matrix operations 24
5 Searching and Sorting a sting in a given array 27
6 Password checking and Print RAM size with system date 33
7 Counters and Time Delay 36
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
8 Stepper motor control 39
9 Traffic light control 42
10 Digital clock 47
11 Serial interface and Parallel interface 50
12 A/D interface 54
13 Key board and Display 57
14 D/A interface and Waveform Generation 60
CYCLE 3 - 8051 PROGRAMS USING KITS AND MASM
15 Basic arithmetic and Logical operations 64
16 Square and Cube program, Find 2?s complement of a number 69
17 Unpacked BCD to ASCII 71
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
18 Sorting of an array using 8051 74
19 Separate odd and even numbers using 8086 77
20 Sum of N consecutive numbers using 8086 80

9 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.1 BASIC ARITHMETIC AND LOGICAL OPERATIONS

Aim:
To write an Assembly Language Program to perform Arithmetic operation and to execute using 8086
microprocessor
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
Arithmetic Operation:
1. Addition:
Algorithm:
1. Clear BL register to store carry
2. Get the addend in AX register pair
3. Get the Augend in CX register pair
4. Add Augend and addend
5. Check for carry, If it is one go to step 6 else go to step 7
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

6. Increments carry (BL register by 1)
7. Store the sum in memory from AX register pair
8. Store the carry in memory from BL register
9. Stop
Program:
Address
Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 1010H
1007 MOV CX, 2020H
100B CLC
100C ADD AX, CX
100E JNC Label1
1010 INC BL
1012 Label 1 MOV [1200], AX
1016 MOV [1202], BL
101A HLT
Precaution:
Make sure that all the machine codes should be as per the specified in the program.
Tabulation:
Input Output
Address Data Address Data








2. Subtraction:
Algorithm:
1. Clear BL register for storing borrow
2. Get the minuend in AX register pair
3. Get the subtrahend in CX register pair
4. Subtract minuend and subtrahend
5. Check borrow, if borrow is one go to step 6 else go to step 8
6. Increment borrow (BL register by 1)
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

7. Negate AX register
8. Store the difference from AX in memory
9. Story the borrow from BL in memory
10. Stop
Program:
Address Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 2024H
1007 MOV CX, 1010H
100B SUB AX, CX
100D JNC Label1
100F INC BL
1011 NEG AX
1013 Label 1 MOV [1200], AX
1017 MOV [1202], BL
101B HLT

Tabulation:
Input Output
Address Data Address Data






3. Multiplication
Algorithm:
1. Clear DX register
2. Load the AX register pair with multiplicand
3. Load the CX register pair with multiplier
4. Multiply multiplicand and multiplier
5. Store the higher byte of product(from DX register pair) in memory specified
6. Store the lower byte of product(from AX register pair) in memory specified
7. Stop
8.
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV DX, 0000H
1004 MOV AX, 00FFH
1008 MOV CX, 0002H
100C MUL CX
100E MOV [1200], AX
1012 MOV [1202], DX
1016 HLT
Tabulation:
Input Output
Address Data Address Data






4. Division:
Algorithm
1. Clear DX register
2. Load the AX register pair with dividend
3. Load the CX register pair with divisor
4. Dividend divided by divisor
5. Store the quotient (from AX register pair) in memory specified
6. Store the remainder (from DX register pair) in memory specified
7. Stop
Program:
Address Label Mnemonics
1000 MOV DX, 0000H
1004 MOV AX, 0008H
1008 MOV CX, 0004H
100C DIV CX
100E MOV [1200], AX
1012 MOV [1202], DX
1016 HLT

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


Result:
Thus Assembly language program are written to perform arithmetic operation using 8086 microprocessor.
They are executed using 8086 processor and the outputs are verified.
Outcome:
At the end of this experiment the students able to write ALP programs for Arithmetic and Logical operations.

1. Write the size of the data bus of 8086.
2. Write the size of the address bus of 8086.
3. What is meant by physical addressing in 8086?
4. What is meant by an Opcode?
5. What is meant by an Operand?
6. What is meant by a Mnemonics?
7. What are the other possibilities of writing ADD, SUB and MUL instructions in other addressing modes?
8. What is the difference between microprocessor and microcontroller?
9. What is meant by LATCH?
10. What is the difference between primary & secondary storage device?
11. What is the difference between static and dynamic RAM?
12. What is an interrupt?
13. Differentiate between RAM and ROM?
14. Define ? Compiler
15. Define ? Flag
16. Define ? Stack
17. How clock signal is generated in 8086 microprocessor?
18. State the functions of queue status line QS0 and QS1 in 8086 microprocessor.
19. What is the purpose of BIU& EU?
20. List out the two examples of assembler directives.

Viva ? voce
15 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Applications:
1. barrel shifters
2. Multiple-precision arithmetic
3. Calculation pipeline
4. binary multipliers
5. Calculation in a single clock

16 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.2 DECIMAL ARITHMETIC AND CODE CONVERSION
Aim:
To write an Assembly Language Program to perform Code conversion and Decimal Arithmetic operations
and to execute using 8086 microprocessor
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
Decimal Arithmetic:
1. Using DAA
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Clear the CL reg.
4. Add the contents of AL and BL.
5. Adjust decimal accumulator after addition.
6. Store the result.
17 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 MOV CL, 00
100B ADD AL,BL
100D DAA
100E JNC L1
1010 INC CL
1012 L1 MOV [1150], AL
1016 MOV [1151], CL
101A HLT

Tabulation:
Input Output
Address Data Address Data


2. Using AAM
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Multiply the contents of AL and BL.
4. Adjust decimal accumulator after multiplication.
5. Store the result.
Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 MUL BL
100A AAM
100C MOV [1150], AH
1010 MOV [1151], AL
1014 HLT

18 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


3. Using DAS
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Subtract the contents of BL from AL.
4. Adjust decimal accumulator after subtraction.
5. Store the result.
Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 SUB AL,BL
100A DAS
100B MOV [1150], AL
100F HLT
Tabulation:
Input Output
Address Data Address Data


Code Conversion:
1. Binary to BCD
Algorithm:
1. Get the input and store in AL.
2. Clear the carry flag.
3. Rotate right the bits of input.
4. Find logical XOR between input and shifted input.
5. Store the result.
19 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 XOR AX,AX
1002 XOR CX,CX
1004 MOV BX,000B
1008 L2 CMP BX,00
100C JZ L1
100E DEC BX
100F MOV AL,CL
1011 ADD AL,01
1014 DAA
1015 MOV CL,AL
1017 MOV AL,CH
1019 ADC AL,00
101C DAA
101D MOV CH,AL
101F JMP L2
1022 MOV [1150],CX
1026 HLT
Tabulation:
Input Output
Address Data Address Data




2. Binary to Gray
Algorithm:
1. Get the input and store in AL.
2. Clear the carry flag.
3. Rotate right the bits of input.
4. Find logical XOR between input and shifted input.
5. Store the result.

20 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, AL
1006 CLC
1007 MOV CL,01
100A RCR AL,CL
100C XOR BL,AL
100E MOV [1150],BL
1012 HLT
Tabulation:
Input Output
Address Data Address Data


Result:
Thus an Assembly Language Program for code conversion and decimal arithmetic operations is written. The
program is executed using 8086 and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts of code conversions and
decimal arithmetic operations.








21 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


1. Write the function of the following 8085 instructions: JP, JPE, JPO, and JNZ.
2. What is the purpose of the following commands in 8086?
a) AAD
b) RCL
3. List out the addressing modes in 8086.
4. List out the various string instructions that are available in 8086.
5. What are the 8086 instructions used for BCD arithmetic?
6. What flags get affected after executing ADD instruction?
7. Which instruction is used to add immediate data?
8. What is BCD code? Where it is used?
9. What is ASCII code? Where it is used?
10. What is the difference between carry flag and overflow flag?
11. What are the special function register associated with interrupts?
12. List the flags affected by arithmetic instructions.
13. After executing ADDC instruction, what flags get affected?
14. How many bytes the instruction ADDC will add?
15. Name the signals used by the processor to communicate with an I/O processor
16. What is the function of IP?
17. What is the use of base pointer register?
18. Mention the index registers of 8086.
19. How many memory locations are available in 8086 microprocessor?
20. What are the flags in 8086? What are the various interrupts in 8086?
Applications:
1. Programmable calculators
2. Counting system using counts the tennis ball
3. Detecting and Correcting an Error with the Hamming Code
4. Power tool
5. Radio clocks
Viva ? voce
FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING


EC6513 ? MICROPROCESSOR AND MICROCONTROLLERLABORATORY


V SEMESTER - R 2013










Name : _______________________________________
Register No. : _______________________________________
Section : _______________________________________



LABORATORY MANUAL
2 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY


C01 - To learn the working of ARM processor
C02 - To introduce ALP concepts and features
C03 - To write ALP for arithmetic and logical operations in 8086 and 8051
C04 - To differentiate Serial and Parallel Interface
C05 - To interface different I/Os with Microprocessors
C06 - To be familiar with MASM
.




1. Write programs in ARM for a specific Application
2. Write ALP Programs for fixed and Floating Point and Arithmetic
3. Interface different I/Os with processor and Generate waveforms using Microprocessors
4. Execute Programs in 8051
5. Assess the performance of optical devices: light sources, fibers and detectors from both physical and system
point of view

INTRODUCTION
This course illustrates the concepts covered in course CS6412 and provides students with hands-on
experience in Assembly language programs.
PREREQUISITE:
1. Digital Electronics
EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
Lecture
No./Session No.
Name of the Experiment
Course
objectives
Proposed
date

1,2,3
Introduction to lab
CO1

CYCLE I - 8086 PROGRAMS USING KITS AND MASM
4,5,6 Basic arithmetic and Logical operations CO2
COURSE OBJECTIVES
COURSE OUTCOMES
3 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00













7,8,9 Decimal arithmetic and Code conversion CO3
10,11,12
Move a data block without overlap
CO3
Matrix operations
13,14,15 Searching and Sorting a sting in a given array CO2
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
16,17,18 D/A interface and Waveform Generation CO4
19,20,21 A/D interface CO5
22,23,24 Key board and Display CO5
25,26,27
Stepper motor control CO2
Traffic light control CO5
28,29,30
Digital clock CO6
Serial interface and Parallel interface CO4
CYCLE III - 8051 PROGRAMS USING KITS AND MASM
31,32,33 Basic arithmetic and Logical operations CO1
34,35,36
Square and Cube program, Find 2?s complement of a number
CO5
Unpacked BCD to ASCII
37,38,39
Password checking and Print RAM size with system date
CO6
Counters and Time Delay
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
40,41,42 Sorting of an array using 8051 CO2
43,44,45
Separate odd and even numbers using 8086


CO3
Sum of N consecutive numbers using 8086
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00




College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING




To impart professional education integrated with human values to the younger generation, so as to shape
them as proficient and dedicated engineers, capable of providing comprehensive solutions to the challenges in
deploying technology for the service of humanity



? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices


VISION
MISSION
VISION
MISSION
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of
engineering that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this
enables to find solutions for real time problem in industry and organization and to design products
requiring interdisciplinary skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up
their communication skills, individual leadership and supportive qualities and to develop them to adapt and
work in ever changing technologies
5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees











6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer
Science and Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the
career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both
verbal and written forms
i) To work in a team as team member or a leader and make unique contributions and work with
coordination
j) To engage lifelong learning and exhibit their technical skills
k) To develop and manage projects in multidisciplinary environments










7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER
LABORATORY
SYLLABUS

? To learn the working of ARM processor
? To introduce ALP concepts and features
? To write ALP for arithmetic and logical operations in 8086 and 8051
? To differentiate Serial and Parallel Interface
? To interface different I/Os with Microprocessors
? To be familiar with MASM
LIST OF EXPERIMENTS:
8086 Programs using kits and MASM
1. Basic arithmetic and Logical operations
2. Move a data block without overlap
3. Code conversion, decimal arithmetic and Matrix operations.
4. Floating point operations, string manipulations, sorting and searching
5. Password checking, Print RAM size and system date
6. Counters and Time Delay
Peripherals and Interfacing Experiments
7. Traffic light control
8. Stepper motor control
9. Digital clock
10. Key board and Display
11. Printer status
12. Serial interface and Parallel interface
13. A/D and D/A interface and Waveform Generation 8051
Experiments using kits and MASM
14. Basic arithmetic and Logical operations
15. Square and Cube program, Find 2 ?s complement of a number
16. Unpacked BCD to ASCII

? Write programs in ARM for a specific Application
? Write ALP Programs for fixed and Floating Point and Arithmetic
? Interface different I/Os with processor and Generate waveforms using Microprocessors
? Execute Programs in 8051
? Assess the performance of optical devices: light sources, fibers and detectors from both physical and
system point of view


COURSE OUTCOMES
COURSE OBJECTIVES
8 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 - 8086 PROGRAMS USING KITS AND MASM
1 Basic arithmetic and Logical operations 10
2 Decimal arithmetic and Code conversion 15
3 Move a data block without overlap 21
4 Matrix operations 24
5 Searching and Sorting a sting in a given array 27
6 Password checking and Print RAM size with system date 33
7 Counters and Time Delay 36
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
8 Stepper motor control 39
9 Traffic light control 42
10 Digital clock 47
11 Serial interface and Parallel interface 50
12 A/D interface 54
13 Key board and Display 57
14 D/A interface and Waveform Generation 60
CYCLE 3 - 8051 PROGRAMS USING KITS AND MASM
15 Basic arithmetic and Logical operations 64
16 Square and Cube program, Find 2?s complement of a number 69
17 Unpacked BCD to ASCII 71
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
18 Sorting of an array using 8051 74
19 Separate odd and even numbers using 8086 77
20 Sum of N consecutive numbers using 8086 80

9 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.1 BASIC ARITHMETIC AND LOGICAL OPERATIONS

Aim:
To write an Assembly Language Program to perform Arithmetic operation and to execute using 8086
microprocessor
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
Arithmetic Operation:
1. Addition:
Algorithm:
1. Clear BL register to store carry
2. Get the addend in AX register pair
3. Get the Augend in CX register pair
4. Add Augend and addend
5. Check for carry, If it is one go to step 6 else go to step 7
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

6. Increments carry (BL register by 1)
7. Store the sum in memory from AX register pair
8. Store the carry in memory from BL register
9. Stop
Program:
Address
Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 1010H
1007 MOV CX, 2020H
100B CLC
100C ADD AX, CX
100E JNC Label1
1010 INC BL
1012 Label 1 MOV [1200], AX
1016 MOV [1202], BL
101A HLT
Precaution:
Make sure that all the machine codes should be as per the specified in the program.
Tabulation:
Input Output
Address Data Address Data








2. Subtraction:
Algorithm:
1. Clear BL register for storing borrow
2. Get the minuend in AX register pair
3. Get the subtrahend in CX register pair
4. Subtract minuend and subtrahend
5. Check borrow, if borrow is one go to step 6 else go to step 8
6. Increment borrow (BL register by 1)
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

7. Negate AX register
8. Store the difference from AX in memory
9. Story the borrow from BL in memory
10. Stop
Program:
Address Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 2024H
1007 MOV CX, 1010H
100B SUB AX, CX
100D JNC Label1
100F INC BL
1011 NEG AX
1013 Label 1 MOV [1200], AX
1017 MOV [1202], BL
101B HLT

Tabulation:
Input Output
Address Data Address Data






3. Multiplication
Algorithm:
1. Clear DX register
2. Load the AX register pair with multiplicand
3. Load the CX register pair with multiplier
4. Multiply multiplicand and multiplier
5. Store the higher byte of product(from DX register pair) in memory specified
6. Store the lower byte of product(from AX register pair) in memory specified
7. Stop
8.
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV DX, 0000H
1004 MOV AX, 00FFH
1008 MOV CX, 0002H
100C MUL CX
100E MOV [1200], AX
1012 MOV [1202], DX
1016 HLT
Tabulation:
Input Output
Address Data Address Data






4. Division:
Algorithm
1. Clear DX register
2. Load the AX register pair with dividend
3. Load the CX register pair with divisor
4. Dividend divided by divisor
5. Store the quotient (from AX register pair) in memory specified
6. Store the remainder (from DX register pair) in memory specified
7. Stop
Program:
Address Label Mnemonics
1000 MOV DX, 0000H
1004 MOV AX, 0008H
1008 MOV CX, 0004H
100C DIV CX
100E MOV [1200], AX
1012 MOV [1202], DX
1016 HLT

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


Result:
Thus Assembly language program are written to perform arithmetic operation using 8086 microprocessor.
They are executed using 8086 processor and the outputs are verified.
Outcome:
At the end of this experiment the students able to write ALP programs for Arithmetic and Logical operations.

1. Write the size of the data bus of 8086.
2. Write the size of the address bus of 8086.
3. What is meant by physical addressing in 8086?
4. What is meant by an Opcode?
5. What is meant by an Operand?
6. What is meant by a Mnemonics?
7. What are the other possibilities of writing ADD, SUB and MUL instructions in other addressing modes?
8. What is the difference between microprocessor and microcontroller?
9. What is meant by LATCH?
10. What is the difference between primary & secondary storage device?
11. What is the difference between static and dynamic RAM?
12. What is an interrupt?
13. Differentiate between RAM and ROM?
14. Define ? Compiler
15. Define ? Flag
16. Define ? Stack
17. How clock signal is generated in 8086 microprocessor?
18. State the functions of queue status line QS0 and QS1 in 8086 microprocessor.
19. What is the purpose of BIU& EU?
20. List out the two examples of assembler directives.

Viva ? voce
15 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Applications:
1. barrel shifters
2. Multiple-precision arithmetic
3. Calculation pipeline
4. binary multipliers
5. Calculation in a single clock

16 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.2 DECIMAL ARITHMETIC AND CODE CONVERSION
Aim:
To write an Assembly Language Program to perform Code conversion and Decimal Arithmetic operations
and to execute using 8086 microprocessor
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
Decimal Arithmetic:
1. Using DAA
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Clear the CL reg.
4. Add the contents of AL and BL.
5. Adjust decimal accumulator after addition.
6. Store the result.
17 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 MOV CL, 00
100B ADD AL,BL
100D DAA
100E JNC L1
1010 INC CL
1012 L1 MOV [1150], AL
1016 MOV [1151], CL
101A HLT

Tabulation:
Input Output
Address Data Address Data


2. Using AAM
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Multiply the contents of AL and BL.
4. Adjust decimal accumulator after multiplication.
5. Store the result.
Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 MUL BL
100A AAM
100C MOV [1150], AH
1010 MOV [1151], AL
1014 HLT

18 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


3. Using DAS
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Subtract the contents of BL from AL.
4. Adjust decimal accumulator after subtraction.
5. Store the result.
Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 SUB AL,BL
100A DAS
100B MOV [1150], AL
100F HLT
Tabulation:
Input Output
Address Data Address Data


Code Conversion:
1. Binary to BCD
Algorithm:
1. Get the input and store in AL.
2. Clear the carry flag.
3. Rotate right the bits of input.
4. Find logical XOR between input and shifted input.
5. Store the result.
19 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 XOR AX,AX
1002 XOR CX,CX
1004 MOV BX,000B
1008 L2 CMP BX,00
100C JZ L1
100E DEC BX
100F MOV AL,CL
1011 ADD AL,01
1014 DAA
1015 MOV CL,AL
1017 MOV AL,CH
1019 ADC AL,00
101C DAA
101D MOV CH,AL
101F JMP L2
1022 MOV [1150],CX
1026 HLT
Tabulation:
Input Output
Address Data Address Data




2. Binary to Gray
Algorithm:
1. Get the input and store in AL.
2. Clear the carry flag.
3. Rotate right the bits of input.
4. Find logical XOR between input and shifted input.
5. Store the result.

20 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, AL
1006 CLC
1007 MOV CL,01
100A RCR AL,CL
100C XOR BL,AL
100E MOV [1150],BL
1012 HLT
Tabulation:
Input Output
Address Data Address Data


Result:
Thus an Assembly Language Program for code conversion and decimal arithmetic operations is written. The
program is executed using 8086 and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts of code conversions and
decimal arithmetic operations.








21 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


1. Write the function of the following 8085 instructions: JP, JPE, JPO, and JNZ.
2. What is the purpose of the following commands in 8086?
a) AAD
b) RCL
3. List out the addressing modes in 8086.
4. List out the various string instructions that are available in 8086.
5. What are the 8086 instructions used for BCD arithmetic?
6. What flags get affected after executing ADD instruction?
7. Which instruction is used to add immediate data?
8. What is BCD code? Where it is used?
9. What is ASCII code? Where it is used?
10. What is the difference between carry flag and overflow flag?
11. What are the special function register associated with interrupts?
12. List the flags affected by arithmetic instructions.
13. After executing ADDC instruction, what flags get affected?
14. How many bytes the instruction ADDC will add?
15. Name the signals used by the processor to communicate with an I/O processor
16. What is the function of IP?
17. What is the use of base pointer register?
18. Mention the index registers of 8086.
19. How many memory locations are available in 8086 microprocessor?
20. What are the flags in 8086? What are the various interrupts in 8086?
Applications:
1. Programmable calculators
2. Counting system using counts the tennis ball
3. Detecting and Correcting an Error with the Hamming Code
4. Power tool
5. Radio clocks
Viva ? voce
22 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.3 MOVE A DATA BLOCK WITHOUT OVERLAP
Aim:
To write an assembly language program to move a block of data to another memory location and execute it
using 8086
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Algorithm:
1. Initialize the source and destination memory location to SI and DI register
2. Initialize the counter (CL register)
3. Move the data to designation memory through AL register
4. Decrement the count
5. Check for zero flag and if zero flag is set go to next step
6. else go to step 3
7. Stop
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING


EC6513 ? MICROPROCESSOR AND MICROCONTROLLERLABORATORY


V SEMESTER - R 2013










Name : _______________________________________
Register No. : _______________________________________
Section : _______________________________________



LABORATORY MANUAL
2 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY


C01 - To learn the working of ARM processor
C02 - To introduce ALP concepts and features
C03 - To write ALP for arithmetic and logical operations in 8086 and 8051
C04 - To differentiate Serial and Parallel Interface
C05 - To interface different I/Os with Microprocessors
C06 - To be familiar with MASM
.




1. Write programs in ARM for a specific Application
2. Write ALP Programs for fixed and Floating Point and Arithmetic
3. Interface different I/Os with processor and Generate waveforms using Microprocessors
4. Execute Programs in 8051
5. Assess the performance of optical devices: light sources, fibers and detectors from both physical and system
point of view

INTRODUCTION
This course illustrates the concepts covered in course CS6412 and provides students with hands-on
experience in Assembly language programs.
PREREQUISITE:
1. Digital Electronics
EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
Lecture
No./Session No.
Name of the Experiment
Course
objectives
Proposed
date

1,2,3
Introduction to lab
CO1

CYCLE I - 8086 PROGRAMS USING KITS AND MASM
4,5,6 Basic arithmetic and Logical operations CO2
COURSE OBJECTIVES
COURSE OUTCOMES
3 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00













7,8,9 Decimal arithmetic and Code conversion CO3
10,11,12
Move a data block without overlap
CO3
Matrix operations
13,14,15 Searching and Sorting a sting in a given array CO2
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
16,17,18 D/A interface and Waveform Generation CO4
19,20,21 A/D interface CO5
22,23,24 Key board and Display CO5
25,26,27
Stepper motor control CO2
Traffic light control CO5
28,29,30
Digital clock CO6
Serial interface and Parallel interface CO4
CYCLE III - 8051 PROGRAMS USING KITS AND MASM
31,32,33 Basic arithmetic and Logical operations CO1
34,35,36
Square and Cube program, Find 2?s complement of a number
CO5
Unpacked BCD to ASCII
37,38,39
Password checking and Print RAM size with system date
CO6
Counters and Time Delay
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
40,41,42 Sorting of an array using 8051 CO2
43,44,45
Separate odd and even numbers using 8086


CO3
Sum of N consecutive numbers using 8086
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00




College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING




To impart professional education integrated with human values to the younger generation, so as to shape
them as proficient and dedicated engineers, capable of providing comprehensive solutions to the challenges in
deploying technology for the service of humanity



? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices


VISION
MISSION
VISION
MISSION
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of
engineering that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this
enables to find solutions for real time problem in industry and organization and to design products
requiring interdisciplinary skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up
their communication skills, individual leadership and supportive qualities and to develop them to adapt and
work in ever changing technologies
5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees











6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer
Science and Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the
career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both
verbal and written forms
i) To work in a team as team member or a leader and make unique contributions and work with
coordination
j) To engage lifelong learning and exhibit their technical skills
k) To develop and manage projects in multidisciplinary environments










7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER
LABORATORY
SYLLABUS

? To learn the working of ARM processor
? To introduce ALP concepts and features
? To write ALP for arithmetic and logical operations in 8086 and 8051
? To differentiate Serial and Parallel Interface
? To interface different I/Os with Microprocessors
? To be familiar with MASM
LIST OF EXPERIMENTS:
8086 Programs using kits and MASM
1. Basic arithmetic and Logical operations
2. Move a data block without overlap
3. Code conversion, decimal arithmetic and Matrix operations.
4. Floating point operations, string manipulations, sorting and searching
5. Password checking, Print RAM size and system date
6. Counters and Time Delay
Peripherals and Interfacing Experiments
7. Traffic light control
8. Stepper motor control
9. Digital clock
10. Key board and Display
11. Printer status
12. Serial interface and Parallel interface
13. A/D and D/A interface and Waveform Generation 8051
Experiments using kits and MASM
14. Basic arithmetic and Logical operations
15. Square and Cube program, Find 2 ?s complement of a number
16. Unpacked BCD to ASCII

? Write programs in ARM for a specific Application
? Write ALP Programs for fixed and Floating Point and Arithmetic
? Interface different I/Os with processor and Generate waveforms using Microprocessors
? Execute Programs in 8051
? Assess the performance of optical devices: light sources, fibers and detectors from both physical and
system point of view


COURSE OUTCOMES
COURSE OBJECTIVES
8 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 - 8086 PROGRAMS USING KITS AND MASM
1 Basic arithmetic and Logical operations 10
2 Decimal arithmetic and Code conversion 15
3 Move a data block without overlap 21
4 Matrix operations 24
5 Searching and Sorting a sting in a given array 27
6 Password checking and Print RAM size with system date 33
7 Counters and Time Delay 36
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
8 Stepper motor control 39
9 Traffic light control 42
10 Digital clock 47
11 Serial interface and Parallel interface 50
12 A/D interface 54
13 Key board and Display 57
14 D/A interface and Waveform Generation 60
CYCLE 3 - 8051 PROGRAMS USING KITS AND MASM
15 Basic arithmetic and Logical operations 64
16 Square and Cube program, Find 2?s complement of a number 69
17 Unpacked BCD to ASCII 71
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
18 Sorting of an array using 8051 74
19 Separate odd and even numbers using 8086 77
20 Sum of N consecutive numbers using 8086 80

9 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.1 BASIC ARITHMETIC AND LOGICAL OPERATIONS

Aim:
To write an Assembly Language Program to perform Arithmetic operation and to execute using 8086
microprocessor
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
Arithmetic Operation:
1. Addition:
Algorithm:
1. Clear BL register to store carry
2. Get the addend in AX register pair
3. Get the Augend in CX register pair
4. Add Augend and addend
5. Check for carry, If it is one go to step 6 else go to step 7
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

6. Increments carry (BL register by 1)
7. Store the sum in memory from AX register pair
8. Store the carry in memory from BL register
9. Stop
Program:
Address
Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 1010H
1007 MOV CX, 2020H
100B CLC
100C ADD AX, CX
100E JNC Label1
1010 INC BL
1012 Label 1 MOV [1200], AX
1016 MOV [1202], BL
101A HLT
Precaution:
Make sure that all the machine codes should be as per the specified in the program.
Tabulation:
Input Output
Address Data Address Data








2. Subtraction:
Algorithm:
1. Clear BL register for storing borrow
2. Get the minuend in AX register pair
3. Get the subtrahend in CX register pair
4. Subtract minuend and subtrahend
5. Check borrow, if borrow is one go to step 6 else go to step 8
6. Increment borrow (BL register by 1)
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

7. Negate AX register
8. Store the difference from AX in memory
9. Story the borrow from BL in memory
10. Stop
Program:
Address Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 2024H
1007 MOV CX, 1010H
100B SUB AX, CX
100D JNC Label1
100F INC BL
1011 NEG AX
1013 Label 1 MOV [1200], AX
1017 MOV [1202], BL
101B HLT

Tabulation:
Input Output
Address Data Address Data






3. Multiplication
Algorithm:
1. Clear DX register
2. Load the AX register pair with multiplicand
3. Load the CX register pair with multiplier
4. Multiply multiplicand and multiplier
5. Store the higher byte of product(from DX register pair) in memory specified
6. Store the lower byte of product(from AX register pair) in memory specified
7. Stop
8.
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV DX, 0000H
1004 MOV AX, 00FFH
1008 MOV CX, 0002H
100C MUL CX
100E MOV [1200], AX
1012 MOV [1202], DX
1016 HLT
Tabulation:
Input Output
Address Data Address Data






4. Division:
Algorithm
1. Clear DX register
2. Load the AX register pair with dividend
3. Load the CX register pair with divisor
4. Dividend divided by divisor
5. Store the quotient (from AX register pair) in memory specified
6. Store the remainder (from DX register pair) in memory specified
7. Stop
Program:
Address Label Mnemonics
1000 MOV DX, 0000H
1004 MOV AX, 0008H
1008 MOV CX, 0004H
100C DIV CX
100E MOV [1200], AX
1012 MOV [1202], DX
1016 HLT

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


Result:
Thus Assembly language program are written to perform arithmetic operation using 8086 microprocessor.
They are executed using 8086 processor and the outputs are verified.
Outcome:
At the end of this experiment the students able to write ALP programs for Arithmetic and Logical operations.

1. Write the size of the data bus of 8086.
2. Write the size of the address bus of 8086.
3. What is meant by physical addressing in 8086?
4. What is meant by an Opcode?
5. What is meant by an Operand?
6. What is meant by a Mnemonics?
7. What are the other possibilities of writing ADD, SUB and MUL instructions in other addressing modes?
8. What is the difference between microprocessor and microcontroller?
9. What is meant by LATCH?
10. What is the difference between primary & secondary storage device?
11. What is the difference between static and dynamic RAM?
12. What is an interrupt?
13. Differentiate between RAM and ROM?
14. Define ? Compiler
15. Define ? Flag
16. Define ? Stack
17. How clock signal is generated in 8086 microprocessor?
18. State the functions of queue status line QS0 and QS1 in 8086 microprocessor.
19. What is the purpose of BIU& EU?
20. List out the two examples of assembler directives.

Viva ? voce
15 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Applications:
1. barrel shifters
2. Multiple-precision arithmetic
3. Calculation pipeline
4. binary multipliers
5. Calculation in a single clock

16 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.2 DECIMAL ARITHMETIC AND CODE CONVERSION
Aim:
To write an Assembly Language Program to perform Code conversion and Decimal Arithmetic operations
and to execute using 8086 microprocessor
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
Decimal Arithmetic:
1. Using DAA
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Clear the CL reg.
4. Add the contents of AL and BL.
5. Adjust decimal accumulator after addition.
6. Store the result.
17 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 MOV CL, 00
100B ADD AL,BL
100D DAA
100E JNC L1
1010 INC CL
1012 L1 MOV [1150], AL
1016 MOV [1151], CL
101A HLT

Tabulation:
Input Output
Address Data Address Data


2. Using AAM
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Multiply the contents of AL and BL.
4. Adjust decimal accumulator after multiplication.
5. Store the result.
Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 MUL BL
100A AAM
100C MOV [1150], AH
1010 MOV [1151], AL
1014 HLT

18 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


3. Using DAS
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Subtract the contents of BL from AL.
4. Adjust decimal accumulator after subtraction.
5. Store the result.
Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 SUB AL,BL
100A DAS
100B MOV [1150], AL
100F HLT
Tabulation:
Input Output
Address Data Address Data


Code Conversion:
1. Binary to BCD
Algorithm:
1. Get the input and store in AL.
2. Clear the carry flag.
3. Rotate right the bits of input.
4. Find logical XOR between input and shifted input.
5. Store the result.
19 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 XOR AX,AX
1002 XOR CX,CX
1004 MOV BX,000B
1008 L2 CMP BX,00
100C JZ L1
100E DEC BX
100F MOV AL,CL
1011 ADD AL,01
1014 DAA
1015 MOV CL,AL
1017 MOV AL,CH
1019 ADC AL,00
101C DAA
101D MOV CH,AL
101F JMP L2
1022 MOV [1150],CX
1026 HLT
Tabulation:
Input Output
Address Data Address Data




2. Binary to Gray
Algorithm:
1. Get the input and store in AL.
2. Clear the carry flag.
3. Rotate right the bits of input.
4. Find logical XOR between input and shifted input.
5. Store the result.

20 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, AL
1006 CLC
1007 MOV CL,01
100A RCR AL,CL
100C XOR BL,AL
100E MOV [1150],BL
1012 HLT
Tabulation:
Input Output
Address Data Address Data


Result:
Thus an Assembly Language Program for code conversion and decimal arithmetic operations is written. The
program is executed using 8086 and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts of code conversions and
decimal arithmetic operations.








21 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


1. Write the function of the following 8085 instructions: JP, JPE, JPO, and JNZ.
2. What is the purpose of the following commands in 8086?
a) AAD
b) RCL
3. List out the addressing modes in 8086.
4. List out the various string instructions that are available in 8086.
5. What are the 8086 instructions used for BCD arithmetic?
6. What flags get affected after executing ADD instruction?
7. Which instruction is used to add immediate data?
8. What is BCD code? Where it is used?
9. What is ASCII code? Where it is used?
10. What is the difference between carry flag and overflow flag?
11. What are the special function register associated with interrupts?
12. List the flags affected by arithmetic instructions.
13. After executing ADDC instruction, what flags get affected?
14. How many bytes the instruction ADDC will add?
15. Name the signals used by the processor to communicate with an I/O processor
16. What is the function of IP?
17. What is the use of base pointer register?
18. Mention the index registers of 8086.
19. How many memory locations are available in 8086 microprocessor?
20. What are the flags in 8086? What are the various interrupts in 8086?
Applications:
1. Programmable calculators
2. Counting system using counts the tennis ball
3. Detecting and Correcting an Error with the Hamming Code
4. Power tool
5. Radio clocks
Viva ? voce
22 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.3 MOVE A DATA BLOCK WITHOUT OVERLAP
Aim:
To write an assembly language program to move a block of data to another memory location and execute it
using 8086
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Algorithm:
1. Initialize the source and destination memory location to SI and DI register
2. Initialize the counter (CL register)
3. Move the data to designation memory through AL register
4. Decrement the count
5. Check for zero flag and if zero flag is set go to next step
6. else go to step 3
7. Stop
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
23 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


Program:
Address Label Mnemonics
1000 MOV CL, 08
1003 MOV SI, 1200
1007 MOV DI, 1300
100B L1 LOD SB
100C MOV [DI], AL
100E INC DI
100F DEC CL
1011 JNZ L1
1013 HLT

Tabulation:
Input Output
Address Data Address Data




Result:
Thus an Assembly Language Program for moving data to another location is written the program is
executed using 8086 and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts and write the ALP program for
moving data to another location.



FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING


EC6513 ? MICROPROCESSOR AND MICROCONTROLLERLABORATORY


V SEMESTER - R 2013










Name : _______________________________________
Register No. : _______________________________________
Section : _______________________________________



LABORATORY MANUAL
2 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY


C01 - To learn the working of ARM processor
C02 - To introduce ALP concepts and features
C03 - To write ALP for arithmetic and logical operations in 8086 and 8051
C04 - To differentiate Serial and Parallel Interface
C05 - To interface different I/Os with Microprocessors
C06 - To be familiar with MASM
.




1. Write programs in ARM for a specific Application
2. Write ALP Programs for fixed and Floating Point and Arithmetic
3. Interface different I/Os with processor and Generate waveforms using Microprocessors
4. Execute Programs in 8051
5. Assess the performance of optical devices: light sources, fibers and detectors from both physical and system
point of view

INTRODUCTION
This course illustrates the concepts covered in course CS6412 and provides students with hands-on
experience in Assembly language programs.
PREREQUISITE:
1. Digital Electronics
EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
Lecture
No./Session No.
Name of the Experiment
Course
objectives
Proposed
date

1,2,3
Introduction to lab
CO1

CYCLE I - 8086 PROGRAMS USING KITS AND MASM
4,5,6 Basic arithmetic and Logical operations CO2
COURSE OBJECTIVES
COURSE OUTCOMES
3 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00













7,8,9 Decimal arithmetic and Code conversion CO3
10,11,12
Move a data block without overlap
CO3
Matrix operations
13,14,15 Searching and Sorting a sting in a given array CO2
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
16,17,18 D/A interface and Waveform Generation CO4
19,20,21 A/D interface CO5
22,23,24 Key board and Display CO5
25,26,27
Stepper motor control CO2
Traffic light control CO5
28,29,30
Digital clock CO6
Serial interface and Parallel interface CO4
CYCLE III - 8051 PROGRAMS USING KITS AND MASM
31,32,33 Basic arithmetic and Logical operations CO1
34,35,36
Square and Cube program, Find 2?s complement of a number
CO5
Unpacked BCD to ASCII
37,38,39
Password checking and Print RAM size with system date
CO6
Counters and Time Delay
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
40,41,42 Sorting of an array using 8051 CO2
43,44,45
Separate odd and even numbers using 8086


CO3
Sum of N consecutive numbers using 8086
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00




College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING




To impart professional education integrated with human values to the younger generation, so as to shape
them as proficient and dedicated engineers, capable of providing comprehensive solutions to the challenges in
deploying technology for the service of humanity



? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices


VISION
MISSION
VISION
MISSION
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of
engineering that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this
enables to find solutions for real time problem in industry and organization and to design products
requiring interdisciplinary skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up
their communication skills, individual leadership and supportive qualities and to develop them to adapt and
work in ever changing technologies
5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees











6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer
Science and Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the
career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both
verbal and written forms
i) To work in a team as team member or a leader and make unique contributions and work with
coordination
j) To engage lifelong learning and exhibit their technical skills
k) To develop and manage projects in multidisciplinary environments










7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER
LABORATORY
SYLLABUS

? To learn the working of ARM processor
? To introduce ALP concepts and features
? To write ALP for arithmetic and logical operations in 8086 and 8051
? To differentiate Serial and Parallel Interface
? To interface different I/Os with Microprocessors
? To be familiar with MASM
LIST OF EXPERIMENTS:
8086 Programs using kits and MASM
1. Basic arithmetic and Logical operations
2. Move a data block without overlap
3. Code conversion, decimal arithmetic and Matrix operations.
4. Floating point operations, string manipulations, sorting and searching
5. Password checking, Print RAM size and system date
6. Counters and Time Delay
Peripherals and Interfacing Experiments
7. Traffic light control
8. Stepper motor control
9. Digital clock
10. Key board and Display
11. Printer status
12. Serial interface and Parallel interface
13. A/D and D/A interface and Waveform Generation 8051
Experiments using kits and MASM
14. Basic arithmetic and Logical operations
15. Square and Cube program, Find 2 ?s complement of a number
16. Unpacked BCD to ASCII

? Write programs in ARM for a specific Application
? Write ALP Programs for fixed and Floating Point and Arithmetic
? Interface different I/Os with processor and Generate waveforms using Microprocessors
? Execute Programs in 8051
? Assess the performance of optical devices: light sources, fibers and detectors from both physical and
system point of view


COURSE OUTCOMES
COURSE OBJECTIVES
8 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 - 8086 PROGRAMS USING KITS AND MASM
1 Basic arithmetic and Logical operations 10
2 Decimal arithmetic and Code conversion 15
3 Move a data block without overlap 21
4 Matrix operations 24
5 Searching and Sorting a sting in a given array 27
6 Password checking and Print RAM size with system date 33
7 Counters and Time Delay 36
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
8 Stepper motor control 39
9 Traffic light control 42
10 Digital clock 47
11 Serial interface and Parallel interface 50
12 A/D interface 54
13 Key board and Display 57
14 D/A interface and Waveform Generation 60
CYCLE 3 - 8051 PROGRAMS USING KITS AND MASM
15 Basic arithmetic and Logical operations 64
16 Square and Cube program, Find 2?s complement of a number 69
17 Unpacked BCD to ASCII 71
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
18 Sorting of an array using 8051 74
19 Separate odd and even numbers using 8086 77
20 Sum of N consecutive numbers using 8086 80

9 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.1 BASIC ARITHMETIC AND LOGICAL OPERATIONS

Aim:
To write an Assembly Language Program to perform Arithmetic operation and to execute using 8086
microprocessor
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
Arithmetic Operation:
1. Addition:
Algorithm:
1. Clear BL register to store carry
2. Get the addend in AX register pair
3. Get the Augend in CX register pair
4. Add Augend and addend
5. Check for carry, If it is one go to step 6 else go to step 7
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

6. Increments carry (BL register by 1)
7. Store the sum in memory from AX register pair
8. Store the carry in memory from BL register
9. Stop
Program:
Address
Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 1010H
1007 MOV CX, 2020H
100B CLC
100C ADD AX, CX
100E JNC Label1
1010 INC BL
1012 Label 1 MOV [1200], AX
1016 MOV [1202], BL
101A HLT
Precaution:
Make sure that all the machine codes should be as per the specified in the program.
Tabulation:
Input Output
Address Data Address Data








2. Subtraction:
Algorithm:
1. Clear BL register for storing borrow
2. Get the minuend in AX register pair
3. Get the subtrahend in CX register pair
4. Subtract minuend and subtrahend
5. Check borrow, if borrow is one go to step 6 else go to step 8
6. Increment borrow (BL register by 1)
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

7. Negate AX register
8. Store the difference from AX in memory
9. Story the borrow from BL in memory
10. Stop
Program:
Address Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 2024H
1007 MOV CX, 1010H
100B SUB AX, CX
100D JNC Label1
100F INC BL
1011 NEG AX
1013 Label 1 MOV [1200], AX
1017 MOV [1202], BL
101B HLT

Tabulation:
Input Output
Address Data Address Data






3. Multiplication
Algorithm:
1. Clear DX register
2. Load the AX register pair with multiplicand
3. Load the CX register pair with multiplier
4. Multiply multiplicand and multiplier
5. Store the higher byte of product(from DX register pair) in memory specified
6. Store the lower byte of product(from AX register pair) in memory specified
7. Stop
8.
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV DX, 0000H
1004 MOV AX, 00FFH
1008 MOV CX, 0002H
100C MUL CX
100E MOV [1200], AX
1012 MOV [1202], DX
1016 HLT
Tabulation:
Input Output
Address Data Address Data






4. Division:
Algorithm
1. Clear DX register
2. Load the AX register pair with dividend
3. Load the CX register pair with divisor
4. Dividend divided by divisor
5. Store the quotient (from AX register pair) in memory specified
6. Store the remainder (from DX register pair) in memory specified
7. Stop
Program:
Address Label Mnemonics
1000 MOV DX, 0000H
1004 MOV AX, 0008H
1008 MOV CX, 0004H
100C DIV CX
100E MOV [1200], AX
1012 MOV [1202], DX
1016 HLT

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


Result:
Thus Assembly language program are written to perform arithmetic operation using 8086 microprocessor.
They are executed using 8086 processor and the outputs are verified.
Outcome:
At the end of this experiment the students able to write ALP programs for Arithmetic and Logical operations.

1. Write the size of the data bus of 8086.
2. Write the size of the address bus of 8086.
3. What is meant by physical addressing in 8086?
4. What is meant by an Opcode?
5. What is meant by an Operand?
6. What is meant by a Mnemonics?
7. What are the other possibilities of writing ADD, SUB and MUL instructions in other addressing modes?
8. What is the difference between microprocessor and microcontroller?
9. What is meant by LATCH?
10. What is the difference between primary & secondary storage device?
11. What is the difference between static and dynamic RAM?
12. What is an interrupt?
13. Differentiate between RAM and ROM?
14. Define ? Compiler
15. Define ? Flag
16. Define ? Stack
17. How clock signal is generated in 8086 microprocessor?
18. State the functions of queue status line QS0 and QS1 in 8086 microprocessor.
19. What is the purpose of BIU& EU?
20. List out the two examples of assembler directives.

Viva ? voce
15 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Applications:
1. barrel shifters
2. Multiple-precision arithmetic
3. Calculation pipeline
4. binary multipliers
5. Calculation in a single clock

16 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.2 DECIMAL ARITHMETIC AND CODE CONVERSION
Aim:
To write an Assembly Language Program to perform Code conversion and Decimal Arithmetic operations
and to execute using 8086 microprocessor
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
Decimal Arithmetic:
1. Using DAA
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Clear the CL reg.
4. Add the contents of AL and BL.
5. Adjust decimal accumulator after addition.
6. Store the result.
17 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 MOV CL, 00
100B ADD AL,BL
100D DAA
100E JNC L1
1010 INC CL
1012 L1 MOV [1150], AL
1016 MOV [1151], CL
101A HLT

Tabulation:
Input Output
Address Data Address Data


2. Using AAM
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Multiply the contents of AL and BL.
4. Adjust decimal accumulator after multiplication.
5. Store the result.
Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 MUL BL
100A AAM
100C MOV [1150], AH
1010 MOV [1151], AL
1014 HLT

18 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


3. Using DAS
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Subtract the contents of BL from AL.
4. Adjust decimal accumulator after subtraction.
5. Store the result.
Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 SUB AL,BL
100A DAS
100B MOV [1150], AL
100F HLT
Tabulation:
Input Output
Address Data Address Data


Code Conversion:
1. Binary to BCD
Algorithm:
1. Get the input and store in AL.
2. Clear the carry flag.
3. Rotate right the bits of input.
4. Find logical XOR between input and shifted input.
5. Store the result.
19 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 XOR AX,AX
1002 XOR CX,CX
1004 MOV BX,000B
1008 L2 CMP BX,00
100C JZ L1
100E DEC BX
100F MOV AL,CL
1011 ADD AL,01
1014 DAA
1015 MOV CL,AL
1017 MOV AL,CH
1019 ADC AL,00
101C DAA
101D MOV CH,AL
101F JMP L2
1022 MOV [1150],CX
1026 HLT
Tabulation:
Input Output
Address Data Address Data




2. Binary to Gray
Algorithm:
1. Get the input and store in AL.
2. Clear the carry flag.
3. Rotate right the bits of input.
4. Find logical XOR between input and shifted input.
5. Store the result.

20 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, AL
1006 CLC
1007 MOV CL,01
100A RCR AL,CL
100C XOR BL,AL
100E MOV [1150],BL
1012 HLT
Tabulation:
Input Output
Address Data Address Data


Result:
Thus an Assembly Language Program for code conversion and decimal arithmetic operations is written. The
program is executed using 8086 and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts of code conversions and
decimal arithmetic operations.








21 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


1. Write the function of the following 8085 instructions: JP, JPE, JPO, and JNZ.
2. What is the purpose of the following commands in 8086?
a) AAD
b) RCL
3. List out the addressing modes in 8086.
4. List out the various string instructions that are available in 8086.
5. What are the 8086 instructions used for BCD arithmetic?
6. What flags get affected after executing ADD instruction?
7. Which instruction is used to add immediate data?
8. What is BCD code? Where it is used?
9. What is ASCII code? Where it is used?
10. What is the difference between carry flag and overflow flag?
11. What are the special function register associated with interrupts?
12. List the flags affected by arithmetic instructions.
13. After executing ADDC instruction, what flags get affected?
14. How many bytes the instruction ADDC will add?
15. Name the signals used by the processor to communicate with an I/O processor
16. What is the function of IP?
17. What is the use of base pointer register?
18. Mention the index registers of 8086.
19. How many memory locations are available in 8086 microprocessor?
20. What are the flags in 8086? What are the various interrupts in 8086?
Applications:
1. Programmable calculators
2. Counting system using counts the tennis ball
3. Detecting and Correcting an Error with the Hamming Code
4. Power tool
5. Radio clocks
Viva ? voce
22 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.3 MOVE A DATA BLOCK WITHOUT OVERLAP
Aim:
To write an assembly language program to move a block of data to another memory location and execute it
using 8086
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Algorithm:
1. Initialize the source and destination memory location to SI and DI register
2. Initialize the counter (CL register)
3. Move the data to designation memory through AL register
4. Decrement the count
5. Check for zero flag and if zero flag is set go to next step
6. else go to step 3
7. Stop
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
23 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


Program:
Address Label Mnemonics
1000 MOV CL, 08
1003 MOV SI, 1200
1007 MOV DI, 1300
100B L1 LOD SB
100C MOV [DI], AL
100E INC DI
100F DEC CL
1011 JNZ L1
1013 HLT

Tabulation:
Input Output
Address Data Address Data




Result:
Thus an Assembly Language Program for moving data to another location is written the program is
executed using 8086 and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts and write the ALP program for
moving data to another location.



24 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00



1. List out the Flag manipulation instruction.
2. Define ? Variables
3. Define ? Segment Override Prefix
4. How is the memory segment accessed by 8086 microprocessor identified?
5. List out the advantages of using Direct Memory Access (DMA).
6. What is BIOS function call in 8086? (May 2012)
7. List out the difference between procedures and Macros.
8. What is meant by maskable interrupts& non-maskable interrupts?
9. What is the Maximum clock frequency in 8086?
10. Which Stack is used in 8086?
11. Define ? Pipeline (Dec 2011)
12. How many address lines are available in 8086? What is the maximum address possible?
13. What is an assembler?( May 2012)
14. What is the purpose of LEA instruction in 8086? (May 2012)
15. Give the function of index and pointers in 8086.
16. What are the different instruction set of 8086?
17. Give the various addressing modes in 8086.
18. Give the differences between JUMP and LOOP instruction.
19. Give the physical address formation of any two addressing mode.
20. Give the use of ?ASSUME? in 8086 programming.
Applications:
1. Priority Encoder
2. DVD players
3. Cellular telephones
4. Household appliances
5. Car equipment
Viva ? voce
FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING


EC6513 ? MICROPROCESSOR AND MICROCONTROLLERLABORATORY


V SEMESTER - R 2013










Name : _______________________________________
Register No. : _______________________________________
Section : _______________________________________



LABORATORY MANUAL
2 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY


C01 - To learn the working of ARM processor
C02 - To introduce ALP concepts and features
C03 - To write ALP for arithmetic and logical operations in 8086 and 8051
C04 - To differentiate Serial and Parallel Interface
C05 - To interface different I/Os with Microprocessors
C06 - To be familiar with MASM
.




1. Write programs in ARM for a specific Application
2. Write ALP Programs for fixed and Floating Point and Arithmetic
3. Interface different I/Os with processor and Generate waveforms using Microprocessors
4. Execute Programs in 8051
5. Assess the performance of optical devices: light sources, fibers and detectors from both physical and system
point of view

INTRODUCTION
This course illustrates the concepts covered in course CS6412 and provides students with hands-on
experience in Assembly language programs.
PREREQUISITE:
1. Digital Electronics
EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
Lecture
No./Session No.
Name of the Experiment
Course
objectives
Proposed
date

1,2,3
Introduction to lab
CO1

CYCLE I - 8086 PROGRAMS USING KITS AND MASM
4,5,6 Basic arithmetic and Logical operations CO2
COURSE OBJECTIVES
COURSE OUTCOMES
3 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00













7,8,9 Decimal arithmetic and Code conversion CO3
10,11,12
Move a data block without overlap
CO3
Matrix operations
13,14,15 Searching and Sorting a sting in a given array CO2
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
16,17,18 D/A interface and Waveform Generation CO4
19,20,21 A/D interface CO5
22,23,24 Key board and Display CO5
25,26,27
Stepper motor control CO2
Traffic light control CO5
28,29,30
Digital clock CO6
Serial interface and Parallel interface CO4
CYCLE III - 8051 PROGRAMS USING KITS AND MASM
31,32,33 Basic arithmetic and Logical operations CO1
34,35,36
Square and Cube program, Find 2?s complement of a number
CO5
Unpacked BCD to ASCII
37,38,39
Password checking and Print RAM size with system date
CO6
Counters and Time Delay
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
40,41,42 Sorting of an array using 8051 CO2
43,44,45
Separate odd and even numbers using 8086


CO3
Sum of N consecutive numbers using 8086
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00




College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING




To impart professional education integrated with human values to the younger generation, so as to shape
them as proficient and dedicated engineers, capable of providing comprehensive solutions to the challenges in
deploying technology for the service of humanity



? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices


VISION
MISSION
VISION
MISSION
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of
engineering that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this
enables to find solutions for real time problem in industry and organization and to design products
requiring interdisciplinary skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up
their communication skills, individual leadership and supportive qualities and to develop them to adapt and
work in ever changing technologies
5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees











6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer
Science and Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the
career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both
verbal and written forms
i) To work in a team as team member or a leader and make unique contributions and work with
coordination
j) To engage lifelong learning and exhibit their technical skills
k) To develop and manage projects in multidisciplinary environments










7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER
LABORATORY
SYLLABUS

? To learn the working of ARM processor
? To introduce ALP concepts and features
? To write ALP for arithmetic and logical operations in 8086 and 8051
? To differentiate Serial and Parallel Interface
? To interface different I/Os with Microprocessors
? To be familiar with MASM
LIST OF EXPERIMENTS:
8086 Programs using kits and MASM
1. Basic arithmetic and Logical operations
2. Move a data block without overlap
3. Code conversion, decimal arithmetic and Matrix operations.
4. Floating point operations, string manipulations, sorting and searching
5. Password checking, Print RAM size and system date
6. Counters and Time Delay
Peripherals and Interfacing Experiments
7. Traffic light control
8. Stepper motor control
9. Digital clock
10. Key board and Display
11. Printer status
12. Serial interface and Parallel interface
13. A/D and D/A interface and Waveform Generation 8051
Experiments using kits and MASM
14. Basic arithmetic and Logical operations
15. Square and Cube program, Find 2 ?s complement of a number
16. Unpacked BCD to ASCII

? Write programs in ARM for a specific Application
? Write ALP Programs for fixed and Floating Point and Arithmetic
? Interface different I/Os with processor and Generate waveforms using Microprocessors
? Execute Programs in 8051
? Assess the performance of optical devices: light sources, fibers and detectors from both physical and
system point of view


COURSE OUTCOMES
COURSE OBJECTIVES
8 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 - 8086 PROGRAMS USING KITS AND MASM
1 Basic arithmetic and Logical operations 10
2 Decimal arithmetic and Code conversion 15
3 Move a data block without overlap 21
4 Matrix operations 24
5 Searching and Sorting a sting in a given array 27
6 Password checking and Print RAM size with system date 33
7 Counters and Time Delay 36
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
8 Stepper motor control 39
9 Traffic light control 42
10 Digital clock 47
11 Serial interface and Parallel interface 50
12 A/D interface 54
13 Key board and Display 57
14 D/A interface and Waveform Generation 60
CYCLE 3 - 8051 PROGRAMS USING KITS AND MASM
15 Basic arithmetic and Logical operations 64
16 Square and Cube program, Find 2?s complement of a number 69
17 Unpacked BCD to ASCII 71
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
18 Sorting of an array using 8051 74
19 Separate odd and even numbers using 8086 77
20 Sum of N consecutive numbers using 8086 80

9 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.1 BASIC ARITHMETIC AND LOGICAL OPERATIONS

Aim:
To write an Assembly Language Program to perform Arithmetic operation and to execute using 8086
microprocessor
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
Arithmetic Operation:
1. Addition:
Algorithm:
1. Clear BL register to store carry
2. Get the addend in AX register pair
3. Get the Augend in CX register pair
4. Add Augend and addend
5. Check for carry, If it is one go to step 6 else go to step 7
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

6. Increments carry (BL register by 1)
7. Store the sum in memory from AX register pair
8. Store the carry in memory from BL register
9. Stop
Program:
Address
Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 1010H
1007 MOV CX, 2020H
100B CLC
100C ADD AX, CX
100E JNC Label1
1010 INC BL
1012 Label 1 MOV [1200], AX
1016 MOV [1202], BL
101A HLT
Precaution:
Make sure that all the machine codes should be as per the specified in the program.
Tabulation:
Input Output
Address Data Address Data








2. Subtraction:
Algorithm:
1. Clear BL register for storing borrow
2. Get the minuend in AX register pair
3. Get the subtrahend in CX register pair
4. Subtract minuend and subtrahend
5. Check borrow, if borrow is one go to step 6 else go to step 8
6. Increment borrow (BL register by 1)
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

7. Negate AX register
8. Store the difference from AX in memory
9. Story the borrow from BL in memory
10. Stop
Program:
Address Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 2024H
1007 MOV CX, 1010H
100B SUB AX, CX
100D JNC Label1
100F INC BL
1011 NEG AX
1013 Label 1 MOV [1200], AX
1017 MOV [1202], BL
101B HLT

Tabulation:
Input Output
Address Data Address Data






3. Multiplication
Algorithm:
1. Clear DX register
2. Load the AX register pair with multiplicand
3. Load the CX register pair with multiplier
4. Multiply multiplicand and multiplier
5. Store the higher byte of product(from DX register pair) in memory specified
6. Store the lower byte of product(from AX register pair) in memory specified
7. Stop
8.
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV DX, 0000H
1004 MOV AX, 00FFH
1008 MOV CX, 0002H
100C MUL CX
100E MOV [1200], AX
1012 MOV [1202], DX
1016 HLT
Tabulation:
Input Output
Address Data Address Data






4. Division:
Algorithm
1. Clear DX register
2. Load the AX register pair with dividend
3. Load the CX register pair with divisor
4. Dividend divided by divisor
5. Store the quotient (from AX register pair) in memory specified
6. Store the remainder (from DX register pair) in memory specified
7. Stop
Program:
Address Label Mnemonics
1000 MOV DX, 0000H
1004 MOV AX, 0008H
1008 MOV CX, 0004H
100C DIV CX
100E MOV [1200], AX
1012 MOV [1202], DX
1016 HLT

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


Result:
Thus Assembly language program are written to perform arithmetic operation using 8086 microprocessor.
They are executed using 8086 processor and the outputs are verified.
Outcome:
At the end of this experiment the students able to write ALP programs for Arithmetic and Logical operations.

1. Write the size of the data bus of 8086.
2. Write the size of the address bus of 8086.
3. What is meant by physical addressing in 8086?
4. What is meant by an Opcode?
5. What is meant by an Operand?
6. What is meant by a Mnemonics?
7. What are the other possibilities of writing ADD, SUB and MUL instructions in other addressing modes?
8. What is the difference between microprocessor and microcontroller?
9. What is meant by LATCH?
10. What is the difference between primary & secondary storage device?
11. What is the difference between static and dynamic RAM?
12. What is an interrupt?
13. Differentiate between RAM and ROM?
14. Define ? Compiler
15. Define ? Flag
16. Define ? Stack
17. How clock signal is generated in 8086 microprocessor?
18. State the functions of queue status line QS0 and QS1 in 8086 microprocessor.
19. What is the purpose of BIU& EU?
20. List out the two examples of assembler directives.

Viva ? voce
15 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Applications:
1. barrel shifters
2. Multiple-precision arithmetic
3. Calculation pipeline
4. binary multipliers
5. Calculation in a single clock

16 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.2 DECIMAL ARITHMETIC AND CODE CONVERSION
Aim:
To write an Assembly Language Program to perform Code conversion and Decimal Arithmetic operations
and to execute using 8086 microprocessor
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
Decimal Arithmetic:
1. Using DAA
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Clear the CL reg.
4. Add the contents of AL and BL.
5. Adjust decimal accumulator after addition.
6. Store the result.
17 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 MOV CL, 00
100B ADD AL,BL
100D DAA
100E JNC L1
1010 INC CL
1012 L1 MOV [1150], AL
1016 MOV [1151], CL
101A HLT

Tabulation:
Input Output
Address Data Address Data


2. Using AAM
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Multiply the contents of AL and BL.
4. Adjust decimal accumulator after multiplication.
5. Store the result.
Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 MUL BL
100A AAM
100C MOV [1150], AH
1010 MOV [1151], AL
1014 HLT

18 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


3. Using DAS
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Subtract the contents of BL from AL.
4. Adjust decimal accumulator after subtraction.
5. Store the result.
Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 SUB AL,BL
100A DAS
100B MOV [1150], AL
100F HLT
Tabulation:
Input Output
Address Data Address Data


Code Conversion:
1. Binary to BCD
Algorithm:
1. Get the input and store in AL.
2. Clear the carry flag.
3. Rotate right the bits of input.
4. Find logical XOR between input and shifted input.
5. Store the result.
19 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 XOR AX,AX
1002 XOR CX,CX
1004 MOV BX,000B
1008 L2 CMP BX,00
100C JZ L1
100E DEC BX
100F MOV AL,CL
1011 ADD AL,01
1014 DAA
1015 MOV CL,AL
1017 MOV AL,CH
1019 ADC AL,00
101C DAA
101D MOV CH,AL
101F JMP L2
1022 MOV [1150],CX
1026 HLT
Tabulation:
Input Output
Address Data Address Data




2. Binary to Gray
Algorithm:
1. Get the input and store in AL.
2. Clear the carry flag.
3. Rotate right the bits of input.
4. Find logical XOR between input and shifted input.
5. Store the result.

20 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, AL
1006 CLC
1007 MOV CL,01
100A RCR AL,CL
100C XOR BL,AL
100E MOV [1150],BL
1012 HLT
Tabulation:
Input Output
Address Data Address Data


Result:
Thus an Assembly Language Program for code conversion and decimal arithmetic operations is written. The
program is executed using 8086 and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts of code conversions and
decimal arithmetic operations.








21 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


1. Write the function of the following 8085 instructions: JP, JPE, JPO, and JNZ.
2. What is the purpose of the following commands in 8086?
a) AAD
b) RCL
3. List out the addressing modes in 8086.
4. List out the various string instructions that are available in 8086.
5. What are the 8086 instructions used for BCD arithmetic?
6. What flags get affected after executing ADD instruction?
7. Which instruction is used to add immediate data?
8. What is BCD code? Where it is used?
9. What is ASCII code? Where it is used?
10. What is the difference between carry flag and overflow flag?
11. What are the special function register associated with interrupts?
12. List the flags affected by arithmetic instructions.
13. After executing ADDC instruction, what flags get affected?
14. How many bytes the instruction ADDC will add?
15. Name the signals used by the processor to communicate with an I/O processor
16. What is the function of IP?
17. What is the use of base pointer register?
18. Mention the index registers of 8086.
19. How many memory locations are available in 8086 microprocessor?
20. What are the flags in 8086? What are the various interrupts in 8086?
Applications:
1. Programmable calculators
2. Counting system using counts the tennis ball
3. Detecting and Correcting an Error with the Hamming Code
4. Power tool
5. Radio clocks
Viva ? voce
22 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.3 MOVE A DATA BLOCK WITHOUT OVERLAP
Aim:
To write an assembly language program to move a block of data to another memory location and execute it
using 8086
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Algorithm:
1. Initialize the source and destination memory location to SI and DI register
2. Initialize the counter (CL register)
3. Move the data to designation memory through AL register
4. Decrement the count
5. Check for zero flag and if zero flag is set go to next step
6. else go to step 3
7. Stop
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
23 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


Program:
Address Label Mnemonics
1000 MOV CL, 08
1003 MOV SI, 1200
1007 MOV DI, 1300
100B L1 LOD SB
100C MOV [DI], AL
100E INC DI
100F DEC CL
1011 JNZ L1
1013 HLT

Tabulation:
Input Output
Address Data Address Data




Result:
Thus an Assembly Language Program for moving data to another location is written the program is
executed using 8086 and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts and write the ALP program for
moving data to another location.



24 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00



1. List out the Flag manipulation instruction.
2. Define ? Variables
3. Define ? Segment Override Prefix
4. How is the memory segment accessed by 8086 microprocessor identified?
5. List out the advantages of using Direct Memory Access (DMA).
6. What is BIOS function call in 8086? (May 2012)
7. List out the difference between procedures and Macros.
8. What is meant by maskable interrupts& non-maskable interrupts?
9. What is the Maximum clock frequency in 8086?
10. Which Stack is used in 8086?
11. Define ? Pipeline (Dec 2011)
12. How many address lines are available in 8086? What is the maximum address possible?
13. What is an assembler?( May 2012)
14. What is the purpose of LEA instruction in 8086? (May 2012)
15. Give the function of index and pointers in 8086.
16. What are the different instruction set of 8086?
17. Give the various addressing modes in 8086.
18. Give the differences between JUMP and LOOP instruction.
19. Give the physical address formation of any two addressing mode.
20. Give the use of ?ASSUME? in 8086 programming.
Applications:
1. Priority Encoder
2. DVD players
3. Cellular telephones
4. Household appliances
5. Car equipment
Viva ? voce
25 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.4 MATRIX OPERATIONS
Aim:
To write an assembly language program to perform matrix addition and to execute it using 8086
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Algorithm:
1. Get the size (count) of the matrix
2. Initialize SI pointer for storing first matrix
3. Initialize DI pointer for storing second matrix
4. Move the contents pointed by SI pointer to accumulator
5. Move the contents pointed by DI pointer BL register
6. Add the contents of accumulator and BL register
7. Store result in the address pointed by DI pointer
8. Increment DI and SI pointer by 1 and Decrement count by 1
9. Check for zero. If no zero jump to step 4 else go to step 11
10. Stop the execution
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result

FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING


EC6513 ? MICROPROCESSOR AND MICROCONTROLLERLABORATORY


V SEMESTER - R 2013










Name : _______________________________________
Register No. : _______________________________________
Section : _______________________________________



LABORATORY MANUAL
2 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY


C01 - To learn the working of ARM processor
C02 - To introduce ALP concepts and features
C03 - To write ALP for arithmetic and logical operations in 8086 and 8051
C04 - To differentiate Serial and Parallel Interface
C05 - To interface different I/Os with Microprocessors
C06 - To be familiar with MASM
.




1. Write programs in ARM for a specific Application
2. Write ALP Programs for fixed and Floating Point and Arithmetic
3. Interface different I/Os with processor and Generate waveforms using Microprocessors
4. Execute Programs in 8051
5. Assess the performance of optical devices: light sources, fibers and detectors from both physical and system
point of view

INTRODUCTION
This course illustrates the concepts covered in course CS6412 and provides students with hands-on
experience in Assembly language programs.
PREREQUISITE:
1. Digital Electronics
EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
Lecture
No./Session No.
Name of the Experiment
Course
objectives
Proposed
date

1,2,3
Introduction to lab
CO1

CYCLE I - 8086 PROGRAMS USING KITS AND MASM
4,5,6 Basic arithmetic and Logical operations CO2
COURSE OBJECTIVES
COURSE OUTCOMES
3 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00













7,8,9 Decimal arithmetic and Code conversion CO3
10,11,12
Move a data block without overlap
CO3
Matrix operations
13,14,15 Searching and Sorting a sting in a given array CO2
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
16,17,18 D/A interface and Waveform Generation CO4
19,20,21 A/D interface CO5
22,23,24 Key board and Display CO5
25,26,27
Stepper motor control CO2
Traffic light control CO5
28,29,30
Digital clock CO6
Serial interface and Parallel interface CO4
CYCLE III - 8051 PROGRAMS USING KITS AND MASM
31,32,33 Basic arithmetic and Logical operations CO1
34,35,36
Square and Cube program, Find 2?s complement of a number
CO5
Unpacked BCD to ASCII
37,38,39
Password checking and Print RAM size with system date
CO6
Counters and Time Delay
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
40,41,42 Sorting of an array using 8051 CO2
43,44,45
Separate odd and even numbers using 8086


CO3
Sum of N consecutive numbers using 8086
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00




College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING




To impart professional education integrated with human values to the younger generation, so as to shape
them as proficient and dedicated engineers, capable of providing comprehensive solutions to the challenges in
deploying technology for the service of humanity



? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices


VISION
MISSION
VISION
MISSION
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of
engineering that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this
enables to find solutions for real time problem in industry and organization and to design products
requiring interdisciplinary skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up
their communication skills, individual leadership and supportive qualities and to develop them to adapt and
work in ever changing technologies
5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees











6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer
Science and Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the
career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both
verbal and written forms
i) To work in a team as team member or a leader and make unique contributions and work with
coordination
j) To engage lifelong learning and exhibit their technical skills
k) To develop and manage projects in multidisciplinary environments










7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER
LABORATORY
SYLLABUS

? To learn the working of ARM processor
? To introduce ALP concepts and features
? To write ALP for arithmetic and logical operations in 8086 and 8051
? To differentiate Serial and Parallel Interface
? To interface different I/Os with Microprocessors
? To be familiar with MASM
LIST OF EXPERIMENTS:
8086 Programs using kits and MASM
1. Basic arithmetic and Logical operations
2. Move a data block without overlap
3. Code conversion, decimal arithmetic and Matrix operations.
4. Floating point operations, string manipulations, sorting and searching
5. Password checking, Print RAM size and system date
6. Counters and Time Delay
Peripherals and Interfacing Experiments
7. Traffic light control
8. Stepper motor control
9. Digital clock
10. Key board and Display
11. Printer status
12. Serial interface and Parallel interface
13. A/D and D/A interface and Waveform Generation 8051
Experiments using kits and MASM
14. Basic arithmetic and Logical operations
15. Square and Cube program, Find 2 ?s complement of a number
16. Unpacked BCD to ASCII

? Write programs in ARM for a specific Application
? Write ALP Programs for fixed and Floating Point and Arithmetic
? Interface different I/Os with processor and Generate waveforms using Microprocessors
? Execute Programs in 8051
? Assess the performance of optical devices: light sources, fibers and detectors from both physical and
system point of view


COURSE OUTCOMES
COURSE OBJECTIVES
8 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 - 8086 PROGRAMS USING KITS AND MASM
1 Basic arithmetic and Logical operations 10
2 Decimal arithmetic and Code conversion 15
3 Move a data block without overlap 21
4 Matrix operations 24
5 Searching and Sorting a sting in a given array 27
6 Password checking and Print RAM size with system date 33
7 Counters and Time Delay 36
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
8 Stepper motor control 39
9 Traffic light control 42
10 Digital clock 47
11 Serial interface and Parallel interface 50
12 A/D interface 54
13 Key board and Display 57
14 D/A interface and Waveform Generation 60
CYCLE 3 - 8051 PROGRAMS USING KITS AND MASM
15 Basic arithmetic and Logical operations 64
16 Square and Cube program, Find 2?s complement of a number 69
17 Unpacked BCD to ASCII 71
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
18 Sorting of an array using 8051 74
19 Separate odd and even numbers using 8086 77
20 Sum of N consecutive numbers using 8086 80

9 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.1 BASIC ARITHMETIC AND LOGICAL OPERATIONS

Aim:
To write an Assembly Language Program to perform Arithmetic operation and to execute using 8086
microprocessor
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
Arithmetic Operation:
1. Addition:
Algorithm:
1. Clear BL register to store carry
2. Get the addend in AX register pair
3. Get the Augend in CX register pair
4. Add Augend and addend
5. Check for carry, If it is one go to step 6 else go to step 7
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

6. Increments carry (BL register by 1)
7. Store the sum in memory from AX register pair
8. Store the carry in memory from BL register
9. Stop
Program:
Address
Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 1010H
1007 MOV CX, 2020H
100B CLC
100C ADD AX, CX
100E JNC Label1
1010 INC BL
1012 Label 1 MOV [1200], AX
1016 MOV [1202], BL
101A HLT
Precaution:
Make sure that all the machine codes should be as per the specified in the program.
Tabulation:
Input Output
Address Data Address Data








2. Subtraction:
Algorithm:
1. Clear BL register for storing borrow
2. Get the minuend in AX register pair
3. Get the subtrahend in CX register pair
4. Subtract minuend and subtrahend
5. Check borrow, if borrow is one go to step 6 else go to step 8
6. Increment borrow (BL register by 1)
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

7. Negate AX register
8. Store the difference from AX in memory
9. Story the borrow from BL in memory
10. Stop
Program:
Address Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 2024H
1007 MOV CX, 1010H
100B SUB AX, CX
100D JNC Label1
100F INC BL
1011 NEG AX
1013 Label 1 MOV [1200], AX
1017 MOV [1202], BL
101B HLT

Tabulation:
Input Output
Address Data Address Data






3. Multiplication
Algorithm:
1. Clear DX register
2. Load the AX register pair with multiplicand
3. Load the CX register pair with multiplier
4. Multiply multiplicand and multiplier
5. Store the higher byte of product(from DX register pair) in memory specified
6. Store the lower byte of product(from AX register pair) in memory specified
7. Stop
8.
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV DX, 0000H
1004 MOV AX, 00FFH
1008 MOV CX, 0002H
100C MUL CX
100E MOV [1200], AX
1012 MOV [1202], DX
1016 HLT
Tabulation:
Input Output
Address Data Address Data






4. Division:
Algorithm
1. Clear DX register
2. Load the AX register pair with dividend
3. Load the CX register pair with divisor
4. Dividend divided by divisor
5. Store the quotient (from AX register pair) in memory specified
6. Store the remainder (from DX register pair) in memory specified
7. Stop
Program:
Address Label Mnemonics
1000 MOV DX, 0000H
1004 MOV AX, 0008H
1008 MOV CX, 0004H
100C DIV CX
100E MOV [1200], AX
1012 MOV [1202], DX
1016 HLT

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


Result:
Thus Assembly language program are written to perform arithmetic operation using 8086 microprocessor.
They are executed using 8086 processor and the outputs are verified.
Outcome:
At the end of this experiment the students able to write ALP programs for Arithmetic and Logical operations.

1. Write the size of the data bus of 8086.
2. Write the size of the address bus of 8086.
3. What is meant by physical addressing in 8086?
4. What is meant by an Opcode?
5. What is meant by an Operand?
6. What is meant by a Mnemonics?
7. What are the other possibilities of writing ADD, SUB and MUL instructions in other addressing modes?
8. What is the difference between microprocessor and microcontroller?
9. What is meant by LATCH?
10. What is the difference between primary & secondary storage device?
11. What is the difference between static and dynamic RAM?
12. What is an interrupt?
13. Differentiate between RAM and ROM?
14. Define ? Compiler
15. Define ? Flag
16. Define ? Stack
17. How clock signal is generated in 8086 microprocessor?
18. State the functions of queue status line QS0 and QS1 in 8086 microprocessor.
19. What is the purpose of BIU& EU?
20. List out the two examples of assembler directives.

Viva ? voce
15 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Applications:
1. barrel shifters
2. Multiple-precision arithmetic
3. Calculation pipeline
4. binary multipliers
5. Calculation in a single clock

16 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.2 DECIMAL ARITHMETIC AND CODE CONVERSION
Aim:
To write an Assembly Language Program to perform Code conversion and Decimal Arithmetic operations
and to execute using 8086 microprocessor
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
Decimal Arithmetic:
1. Using DAA
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Clear the CL reg.
4. Add the contents of AL and BL.
5. Adjust decimal accumulator after addition.
6. Store the result.
17 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 MOV CL, 00
100B ADD AL,BL
100D DAA
100E JNC L1
1010 INC CL
1012 L1 MOV [1150], AL
1016 MOV [1151], CL
101A HLT

Tabulation:
Input Output
Address Data Address Data


2. Using AAM
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Multiply the contents of AL and BL.
4. Adjust decimal accumulator after multiplication.
5. Store the result.
Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 MUL BL
100A AAM
100C MOV [1150], AH
1010 MOV [1151], AL
1014 HLT

18 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


3. Using DAS
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Subtract the contents of BL from AL.
4. Adjust decimal accumulator after subtraction.
5. Store the result.
Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 SUB AL,BL
100A DAS
100B MOV [1150], AL
100F HLT
Tabulation:
Input Output
Address Data Address Data


Code Conversion:
1. Binary to BCD
Algorithm:
1. Get the input and store in AL.
2. Clear the carry flag.
3. Rotate right the bits of input.
4. Find logical XOR between input and shifted input.
5. Store the result.
19 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 XOR AX,AX
1002 XOR CX,CX
1004 MOV BX,000B
1008 L2 CMP BX,00
100C JZ L1
100E DEC BX
100F MOV AL,CL
1011 ADD AL,01
1014 DAA
1015 MOV CL,AL
1017 MOV AL,CH
1019 ADC AL,00
101C DAA
101D MOV CH,AL
101F JMP L2
1022 MOV [1150],CX
1026 HLT
Tabulation:
Input Output
Address Data Address Data




2. Binary to Gray
Algorithm:
1. Get the input and store in AL.
2. Clear the carry flag.
3. Rotate right the bits of input.
4. Find logical XOR between input and shifted input.
5. Store the result.

20 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, AL
1006 CLC
1007 MOV CL,01
100A RCR AL,CL
100C XOR BL,AL
100E MOV [1150],BL
1012 HLT
Tabulation:
Input Output
Address Data Address Data


Result:
Thus an Assembly Language Program for code conversion and decimal arithmetic operations is written. The
program is executed using 8086 and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts of code conversions and
decimal arithmetic operations.








21 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


1. Write the function of the following 8085 instructions: JP, JPE, JPO, and JNZ.
2. What is the purpose of the following commands in 8086?
a) AAD
b) RCL
3. List out the addressing modes in 8086.
4. List out the various string instructions that are available in 8086.
5. What are the 8086 instructions used for BCD arithmetic?
6. What flags get affected after executing ADD instruction?
7. Which instruction is used to add immediate data?
8. What is BCD code? Where it is used?
9. What is ASCII code? Where it is used?
10. What is the difference between carry flag and overflow flag?
11. What are the special function register associated with interrupts?
12. List the flags affected by arithmetic instructions.
13. After executing ADDC instruction, what flags get affected?
14. How many bytes the instruction ADDC will add?
15. Name the signals used by the processor to communicate with an I/O processor
16. What is the function of IP?
17. What is the use of base pointer register?
18. Mention the index registers of 8086.
19. How many memory locations are available in 8086 microprocessor?
20. What are the flags in 8086? What are the various interrupts in 8086?
Applications:
1. Programmable calculators
2. Counting system using counts the tennis ball
3. Detecting and Correcting an Error with the Hamming Code
4. Power tool
5. Radio clocks
Viva ? voce
22 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.3 MOVE A DATA BLOCK WITHOUT OVERLAP
Aim:
To write an assembly language program to move a block of data to another memory location and execute it
using 8086
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Algorithm:
1. Initialize the source and destination memory location to SI and DI register
2. Initialize the counter (CL register)
3. Move the data to designation memory through AL register
4. Decrement the count
5. Check for zero flag and if zero flag is set go to next step
6. else go to step 3
7. Stop
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
23 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


Program:
Address Label Mnemonics
1000 MOV CL, 08
1003 MOV SI, 1200
1007 MOV DI, 1300
100B L1 LOD SB
100C MOV [DI], AL
100E INC DI
100F DEC CL
1011 JNZ L1
1013 HLT

Tabulation:
Input Output
Address Data Address Data




Result:
Thus an Assembly Language Program for moving data to another location is written the program is
executed using 8086 and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts and write the ALP program for
moving data to another location.



24 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00



1. List out the Flag manipulation instruction.
2. Define ? Variables
3. Define ? Segment Override Prefix
4. How is the memory segment accessed by 8086 microprocessor identified?
5. List out the advantages of using Direct Memory Access (DMA).
6. What is BIOS function call in 8086? (May 2012)
7. List out the difference between procedures and Macros.
8. What is meant by maskable interrupts& non-maskable interrupts?
9. What is the Maximum clock frequency in 8086?
10. Which Stack is used in 8086?
11. Define ? Pipeline (Dec 2011)
12. How many address lines are available in 8086? What is the maximum address possible?
13. What is an assembler?( May 2012)
14. What is the purpose of LEA instruction in 8086? (May 2012)
15. Give the function of index and pointers in 8086.
16. What are the different instruction set of 8086?
17. Give the various addressing modes in 8086.
18. Give the differences between JUMP and LOOP instruction.
19. Give the physical address formation of any two addressing mode.
20. Give the use of ?ASSUME? in 8086 programming.
Applications:
1. Priority Encoder
2. DVD players
3. Cellular telephones
4. Household appliances
5. Car equipment
Viva ? voce
25 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.4 MATRIX OPERATIONS
Aim:
To write an assembly language program to perform matrix addition and to execute it using 8086
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Algorithm:
1. Get the size (count) of the matrix
2. Initialize SI pointer for storing first matrix
3. Initialize DI pointer for storing second matrix
4. Move the contents pointed by SI pointer to accumulator
5. Move the contents pointed by DI pointer BL register
6. Add the contents of accumulator and BL register
7. Store result in the address pointed by DI pointer
8. Increment DI and SI pointer by 1 and Decrement count by 1
9. Check for zero. If no zero jump to step 4 else go to step 11
10. Stop the execution
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result

26 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV CL, 09
1003 MOV SI, 1100
1007 MOV DI, 1200
100B L1 MOV AL, [SI]
100D MOV BL, [DI]
100F ADD AL, BL
1011 MOV [DI], AL
1013 INC SI
1014 INC DI
1015 DEC CL
1017 JNZ L1
1019 HLT

Tabulation:
Input Output
Address Data Address Data



Result:
Thus an assembly language program for matrix addition was written. It is executed using 8086
microprocessor and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts of moving and adding the group
of data from one location to another location.







FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING


EC6513 ? MICROPROCESSOR AND MICROCONTROLLERLABORATORY


V SEMESTER - R 2013










Name : _______________________________________
Register No. : _______________________________________
Section : _______________________________________



LABORATORY MANUAL
2 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY


C01 - To learn the working of ARM processor
C02 - To introduce ALP concepts and features
C03 - To write ALP for arithmetic and logical operations in 8086 and 8051
C04 - To differentiate Serial and Parallel Interface
C05 - To interface different I/Os with Microprocessors
C06 - To be familiar with MASM
.




1. Write programs in ARM for a specific Application
2. Write ALP Programs for fixed and Floating Point and Arithmetic
3. Interface different I/Os with processor and Generate waveforms using Microprocessors
4. Execute Programs in 8051
5. Assess the performance of optical devices: light sources, fibers and detectors from both physical and system
point of view

INTRODUCTION
This course illustrates the concepts covered in course CS6412 and provides students with hands-on
experience in Assembly language programs.
PREREQUISITE:
1. Digital Electronics
EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
Lecture
No./Session No.
Name of the Experiment
Course
objectives
Proposed
date

1,2,3
Introduction to lab
CO1

CYCLE I - 8086 PROGRAMS USING KITS AND MASM
4,5,6 Basic arithmetic and Logical operations CO2
COURSE OBJECTIVES
COURSE OUTCOMES
3 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00













7,8,9 Decimal arithmetic and Code conversion CO3
10,11,12
Move a data block without overlap
CO3
Matrix operations
13,14,15 Searching and Sorting a sting in a given array CO2
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
16,17,18 D/A interface and Waveform Generation CO4
19,20,21 A/D interface CO5
22,23,24 Key board and Display CO5
25,26,27
Stepper motor control CO2
Traffic light control CO5
28,29,30
Digital clock CO6
Serial interface and Parallel interface CO4
CYCLE III - 8051 PROGRAMS USING KITS AND MASM
31,32,33 Basic arithmetic and Logical operations CO1
34,35,36
Square and Cube program, Find 2?s complement of a number
CO5
Unpacked BCD to ASCII
37,38,39
Password checking and Print RAM size with system date
CO6
Counters and Time Delay
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
40,41,42 Sorting of an array using 8051 CO2
43,44,45
Separate odd and even numbers using 8086


CO3
Sum of N consecutive numbers using 8086
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00




College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING




To impart professional education integrated with human values to the younger generation, so as to shape
them as proficient and dedicated engineers, capable of providing comprehensive solutions to the challenges in
deploying technology for the service of humanity



? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices


VISION
MISSION
VISION
MISSION
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of
engineering that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this
enables to find solutions for real time problem in industry and organization and to design products
requiring interdisciplinary skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up
their communication skills, individual leadership and supportive qualities and to develop them to adapt and
work in ever changing technologies
5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees











6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer
Science and Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the
career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both
verbal and written forms
i) To work in a team as team member or a leader and make unique contributions and work with
coordination
j) To engage lifelong learning and exhibit their technical skills
k) To develop and manage projects in multidisciplinary environments










7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER
LABORATORY
SYLLABUS

? To learn the working of ARM processor
? To introduce ALP concepts and features
? To write ALP for arithmetic and logical operations in 8086 and 8051
? To differentiate Serial and Parallel Interface
? To interface different I/Os with Microprocessors
? To be familiar with MASM
LIST OF EXPERIMENTS:
8086 Programs using kits and MASM
1. Basic arithmetic and Logical operations
2. Move a data block without overlap
3. Code conversion, decimal arithmetic and Matrix operations.
4. Floating point operations, string manipulations, sorting and searching
5. Password checking, Print RAM size and system date
6. Counters and Time Delay
Peripherals and Interfacing Experiments
7. Traffic light control
8. Stepper motor control
9. Digital clock
10. Key board and Display
11. Printer status
12. Serial interface and Parallel interface
13. A/D and D/A interface and Waveform Generation 8051
Experiments using kits and MASM
14. Basic arithmetic and Logical operations
15. Square and Cube program, Find 2 ?s complement of a number
16. Unpacked BCD to ASCII

? Write programs in ARM for a specific Application
? Write ALP Programs for fixed and Floating Point and Arithmetic
? Interface different I/Os with processor and Generate waveforms using Microprocessors
? Execute Programs in 8051
? Assess the performance of optical devices: light sources, fibers and detectors from both physical and
system point of view


COURSE OUTCOMES
COURSE OBJECTIVES
8 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 - 8086 PROGRAMS USING KITS AND MASM
1 Basic arithmetic and Logical operations 10
2 Decimal arithmetic and Code conversion 15
3 Move a data block without overlap 21
4 Matrix operations 24
5 Searching and Sorting a sting in a given array 27
6 Password checking and Print RAM size with system date 33
7 Counters and Time Delay 36
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
8 Stepper motor control 39
9 Traffic light control 42
10 Digital clock 47
11 Serial interface and Parallel interface 50
12 A/D interface 54
13 Key board and Display 57
14 D/A interface and Waveform Generation 60
CYCLE 3 - 8051 PROGRAMS USING KITS AND MASM
15 Basic arithmetic and Logical operations 64
16 Square and Cube program, Find 2?s complement of a number 69
17 Unpacked BCD to ASCII 71
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
18 Sorting of an array using 8051 74
19 Separate odd and even numbers using 8086 77
20 Sum of N consecutive numbers using 8086 80

9 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.1 BASIC ARITHMETIC AND LOGICAL OPERATIONS

Aim:
To write an Assembly Language Program to perform Arithmetic operation and to execute using 8086
microprocessor
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
Arithmetic Operation:
1. Addition:
Algorithm:
1. Clear BL register to store carry
2. Get the addend in AX register pair
3. Get the Augend in CX register pair
4. Add Augend and addend
5. Check for carry, If it is one go to step 6 else go to step 7
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

6. Increments carry (BL register by 1)
7. Store the sum in memory from AX register pair
8. Store the carry in memory from BL register
9. Stop
Program:
Address
Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 1010H
1007 MOV CX, 2020H
100B CLC
100C ADD AX, CX
100E JNC Label1
1010 INC BL
1012 Label 1 MOV [1200], AX
1016 MOV [1202], BL
101A HLT
Precaution:
Make sure that all the machine codes should be as per the specified in the program.
Tabulation:
Input Output
Address Data Address Data








2. Subtraction:
Algorithm:
1. Clear BL register for storing borrow
2. Get the minuend in AX register pair
3. Get the subtrahend in CX register pair
4. Subtract minuend and subtrahend
5. Check borrow, if borrow is one go to step 6 else go to step 8
6. Increment borrow (BL register by 1)
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

7. Negate AX register
8. Store the difference from AX in memory
9. Story the borrow from BL in memory
10. Stop
Program:
Address Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 2024H
1007 MOV CX, 1010H
100B SUB AX, CX
100D JNC Label1
100F INC BL
1011 NEG AX
1013 Label 1 MOV [1200], AX
1017 MOV [1202], BL
101B HLT

Tabulation:
Input Output
Address Data Address Data






3. Multiplication
Algorithm:
1. Clear DX register
2. Load the AX register pair with multiplicand
3. Load the CX register pair with multiplier
4. Multiply multiplicand and multiplier
5. Store the higher byte of product(from DX register pair) in memory specified
6. Store the lower byte of product(from AX register pair) in memory specified
7. Stop
8.
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV DX, 0000H
1004 MOV AX, 00FFH
1008 MOV CX, 0002H
100C MUL CX
100E MOV [1200], AX
1012 MOV [1202], DX
1016 HLT
Tabulation:
Input Output
Address Data Address Data






4. Division:
Algorithm
1. Clear DX register
2. Load the AX register pair with dividend
3. Load the CX register pair with divisor
4. Dividend divided by divisor
5. Store the quotient (from AX register pair) in memory specified
6. Store the remainder (from DX register pair) in memory specified
7. Stop
Program:
Address Label Mnemonics
1000 MOV DX, 0000H
1004 MOV AX, 0008H
1008 MOV CX, 0004H
100C DIV CX
100E MOV [1200], AX
1012 MOV [1202], DX
1016 HLT

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


Result:
Thus Assembly language program are written to perform arithmetic operation using 8086 microprocessor.
They are executed using 8086 processor and the outputs are verified.
Outcome:
At the end of this experiment the students able to write ALP programs for Arithmetic and Logical operations.

1. Write the size of the data bus of 8086.
2. Write the size of the address bus of 8086.
3. What is meant by physical addressing in 8086?
4. What is meant by an Opcode?
5. What is meant by an Operand?
6. What is meant by a Mnemonics?
7. What are the other possibilities of writing ADD, SUB and MUL instructions in other addressing modes?
8. What is the difference between microprocessor and microcontroller?
9. What is meant by LATCH?
10. What is the difference between primary & secondary storage device?
11. What is the difference between static and dynamic RAM?
12. What is an interrupt?
13. Differentiate between RAM and ROM?
14. Define ? Compiler
15. Define ? Flag
16. Define ? Stack
17. How clock signal is generated in 8086 microprocessor?
18. State the functions of queue status line QS0 and QS1 in 8086 microprocessor.
19. What is the purpose of BIU& EU?
20. List out the two examples of assembler directives.

Viva ? voce
15 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Applications:
1. barrel shifters
2. Multiple-precision arithmetic
3. Calculation pipeline
4. binary multipliers
5. Calculation in a single clock

16 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.2 DECIMAL ARITHMETIC AND CODE CONVERSION
Aim:
To write an Assembly Language Program to perform Code conversion and Decimal Arithmetic operations
and to execute using 8086 microprocessor
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
Decimal Arithmetic:
1. Using DAA
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Clear the CL reg.
4. Add the contents of AL and BL.
5. Adjust decimal accumulator after addition.
6. Store the result.
17 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 MOV CL, 00
100B ADD AL,BL
100D DAA
100E JNC L1
1010 INC CL
1012 L1 MOV [1150], AL
1016 MOV [1151], CL
101A HLT

Tabulation:
Input Output
Address Data Address Data


2. Using AAM
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Multiply the contents of AL and BL.
4. Adjust decimal accumulator after multiplication.
5. Store the result.
Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 MUL BL
100A AAM
100C MOV [1150], AH
1010 MOV [1151], AL
1014 HLT

18 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


3. Using DAS
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Subtract the contents of BL from AL.
4. Adjust decimal accumulator after subtraction.
5. Store the result.
Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 SUB AL,BL
100A DAS
100B MOV [1150], AL
100F HLT
Tabulation:
Input Output
Address Data Address Data


Code Conversion:
1. Binary to BCD
Algorithm:
1. Get the input and store in AL.
2. Clear the carry flag.
3. Rotate right the bits of input.
4. Find logical XOR between input and shifted input.
5. Store the result.
19 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 XOR AX,AX
1002 XOR CX,CX
1004 MOV BX,000B
1008 L2 CMP BX,00
100C JZ L1
100E DEC BX
100F MOV AL,CL
1011 ADD AL,01
1014 DAA
1015 MOV CL,AL
1017 MOV AL,CH
1019 ADC AL,00
101C DAA
101D MOV CH,AL
101F JMP L2
1022 MOV [1150],CX
1026 HLT
Tabulation:
Input Output
Address Data Address Data




2. Binary to Gray
Algorithm:
1. Get the input and store in AL.
2. Clear the carry flag.
3. Rotate right the bits of input.
4. Find logical XOR between input and shifted input.
5. Store the result.

20 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, AL
1006 CLC
1007 MOV CL,01
100A RCR AL,CL
100C XOR BL,AL
100E MOV [1150],BL
1012 HLT
Tabulation:
Input Output
Address Data Address Data


Result:
Thus an Assembly Language Program for code conversion and decimal arithmetic operations is written. The
program is executed using 8086 and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts of code conversions and
decimal arithmetic operations.








21 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


1. Write the function of the following 8085 instructions: JP, JPE, JPO, and JNZ.
2. What is the purpose of the following commands in 8086?
a) AAD
b) RCL
3. List out the addressing modes in 8086.
4. List out the various string instructions that are available in 8086.
5. What are the 8086 instructions used for BCD arithmetic?
6. What flags get affected after executing ADD instruction?
7. Which instruction is used to add immediate data?
8. What is BCD code? Where it is used?
9. What is ASCII code? Where it is used?
10. What is the difference between carry flag and overflow flag?
11. What are the special function register associated with interrupts?
12. List the flags affected by arithmetic instructions.
13. After executing ADDC instruction, what flags get affected?
14. How many bytes the instruction ADDC will add?
15. Name the signals used by the processor to communicate with an I/O processor
16. What is the function of IP?
17. What is the use of base pointer register?
18. Mention the index registers of 8086.
19. How many memory locations are available in 8086 microprocessor?
20. What are the flags in 8086? What are the various interrupts in 8086?
Applications:
1. Programmable calculators
2. Counting system using counts the tennis ball
3. Detecting and Correcting an Error with the Hamming Code
4. Power tool
5. Radio clocks
Viva ? voce
22 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.3 MOVE A DATA BLOCK WITHOUT OVERLAP
Aim:
To write an assembly language program to move a block of data to another memory location and execute it
using 8086
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Algorithm:
1. Initialize the source and destination memory location to SI and DI register
2. Initialize the counter (CL register)
3. Move the data to designation memory through AL register
4. Decrement the count
5. Check for zero flag and if zero flag is set go to next step
6. else go to step 3
7. Stop
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
23 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


Program:
Address Label Mnemonics
1000 MOV CL, 08
1003 MOV SI, 1200
1007 MOV DI, 1300
100B L1 LOD SB
100C MOV [DI], AL
100E INC DI
100F DEC CL
1011 JNZ L1
1013 HLT

Tabulation:
Input Output
Address Data Address Data




Result:
Thus an Assembly Language Program for moving data to another location is written the program is
executed using 8086 and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts and write the ALP program for
moving data to another location.



24 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00



1. List out the Flag manipulation instruction.
2. Define ? Variables
3. Define ? Segment Override Prefix
4. How is the memory segment accessed by 8086 microprocessor identified?
5. List out the advantages of using Direct Memory Access (DMA).
6. What is BIOS function call in 8086? (May 2012)
7. List out the difference between procedures and Macros.
8. What is meant by maskable interrupts& non-maskable interrupts?
9. What is the Maximum clock frequency in 8086?
10. Which Stack is used in 8086?
11. Define ? Pipeline (Dec 2011)
12. How many address lines are available in 8086? What is the maximum address possible?
13. What is an assembler?( May 2012)
14. What is the purpose of LEA instruction in 8086? (May 2012)
15. Give the function of index and pointers in 8086.
16. What are the different instruction set of 8086?
17. Give the various addressing modes in 8086.
18. Give the differences between JUMP and LOOP instruction.
19. Give the physical address formation of any two addressing mode.
20. Give the use of ?ASSUME? in 8086 programming.
Applications:
1. Priority Encoder
2. DVD players
3. Cellular telephones
4. Household appliances
5. Car equipment
Viva ? voce
25 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.4 MATRIX OPERATIONS
Aim:
To write an assembly language program to perform matrix addition and to execute it using 8086
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Algorithm:
1. Get the size (count) of the matrix
2. Initialize SI pointer for storing first matrix
3. Initialize DI pointer for storing second matrix
4. Move the contents pointed by SI pointer to accumulator
5. Move the contents pointed by DI pointer BL register
6. Add the contents of accumulator and BL register
7. Store result in the address pointed by DI pointer
8. Increment DI and SI pointer by 1 and Decrement count by 1
9. Check for zero. If no zero jump to step 4 else go to step 11
10. Stop the execution
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result

26 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV CL, 09
1003 MOV SI, 1100
1007 MOV DI, 1200
100B L1 MOV AL, [SI]
100D MOV BL, [DI]
100F ADD AL, BL
1011 MOV [DI], AL
1013 INC SI
1014 INC DI
1015 DEC CL
1017 JNZ L1
1019 HLT

Tabulation:
Input Output
Address Data Address Data



Result:
Thus an assembly language program for matrix addition was written. It is executed using 8086
microprocessor and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts of moving and adding the group
of data from one location to another location.







27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


1. Write an ALP for 8086 to multiply two 16 bit unsigned numbers.
2. What is an accumulator?
3. List out the segment register available in 8086.
4. List out any four program control instructions that are available in 8086.
5. What is program counter?
6. Give any four logical instructions in 8086.
7. How many memory locations are available in 8086 microprocessor?
8. What are the general purposes registers in 8086?
9. What are the functional units in 8086?
10. How much memory location allotted for the particular segments registers in 8086?
11. When the 8086 processor is in minimum mode and maximum mode?
12. Define ? Segment Override Prefix.
13. Define ? Macro and Procedure
14. Define ? Assembler and assembler directives
15. Define ? Compiler and Linker
16. What is meant by modular programming?
17. Explain the uses of PUSH and POP instruction.
18. Explain the uses of CALL and RET instruction.
19. Identify the addressing modes in the following instructions.
AND AL, BL
SUB AL, 24H
MOV AL, (BP)
MOV CX, 1245H
20. What are the 8086 instructions used for BCD arithmetic?

Applications:
1. Toys
2. Light switches and dimmers
3. Electrical circuit breakers
4. Smoke alarms
5. Battery packs


Viva ? voce
FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING


EC6513 ? MICROPROCESSOR AND MICROCONTROLLERLABORATORY


V SEMESTER - R 2013










Name : _______________________________________
Register No. : _______________________________________
Section : _______________________________________



LABORATORY MANUAL
2 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY


C01 - To learn the working of ARM processor
C02 - To introduce ALP concepts and features
C03 - To write ALP for arithmetic and logical operations in 8086 and 8051
C04 - To differentiate Serial and Parallel Interface
C05 - To interface different I/Os with Microprocessors
C06 - To be familiar with MASM
.




1. Write programs in ARM for a specific Application
2. Write ALP Programs for fixed and Floating Point and Arithmetic
3. Interface different I/Os with processor and Generate waveforms using Microprocessors
4. Execute Programs in 8051
5. Assess the performance of optical devices: light sources, fibers and detectors from both physical and system
point of view

INTRODUCTION
This course illustrates the concepts covered in course CS6412 and provides students with hands-on
experience in Assembly language programs.
PREREQUISITE:
1. Digital Electronics
EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
Lecture
No./Session No.
Name of the Experiment
Course
objectives
Proposed
date

1,2,3
Introduction to lab
CO1

CYCLE I - 8086 PROGRAMS USING KITS AND MASM
4,5,6 Basic arithmetic and Logical operations CO2
COURSE OBJECTIVES
COURSE OUTCOMES
3 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00













7,8,9 Decimal arithmetic and Code conversion CO3
10,11,12
Move a data block without overlap
CO3
Matrix operations
13,14,15 Searching and Sorting a sting in a given array CO2
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
16,17,18 D/A interface and Waveform Generation CO4
19,20,21 A/D interface CO5
22,23,24 Key board and Display CO5
25,26,27
Stepper motor control CO2
Traffic light control CO5
28,29,30
Digital clock CO6
Serial interface and Parallel interface CO4
CYCLE III - 8051 PROGRAMS USING KITS AND MASM
31,32,33 Basic arithmetic and Logical operations CO1
34,35,36
Square and Cube program, Find 2?s complement of a number
CO5
Unpacked BCD to ASCII
37,38,39
Password checking and Print RAM size with system date
CO6
Counters and Time Delay
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
40,41,42 Sorting of an array using 8051 CO2
43,44,45
Separate odd and even numbers using 8086


CO3
Sum of N consecutive numbers using 8086
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00




College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING




To impart professional education integrated with human values to the younger generation, so as to shape
them as proficient and dedicated engineers, capable of providing comprehensive solutions to the challenges in
deploying technology for the service of humanity



? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices


VISION
MISSION
VISION
MISSION
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of
engineering that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this
enables to find solutions for real time problem in industry and organization and to design products
requiring interdisciplinary skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up
their communication skills, individual leadership and supportive qualities and to develop them to adapt and
work in ever changing technologies
5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees











6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer
Science and Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the
career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both
verbal and written forms
i) To work in a team as team member or a leader and make unique contributions and work with
coordination
j) To engage lifelong learning and exhibit their technical skills
k) To develop and manage projects in multidisciplinary environments










7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER
LABORATORY
SYLLABUS

? To learn the working of ARM processor
? To introduce ALP concepts and features
? To write ALP for arithmetic and logical operations in 8086 and 8051
? To differentiate Serial and Parallel Interface
? To interface different I/Os with Microprocessors
? To be familiar with MASM
LIST OF EXPERIMENTS:
8086 Programs using kits and MASM
1. Basic arithmetic and Logical operations
2. Move a data block without overlap
3. Code conversion, decimal arithmetic and Matrix operations.
4. Floating point operations, string manipulations, sorting and searching
5. Password checking, Print RAM size and system date
6. Counters and Time Delay
Peripherals and Interfacing Experiments
7. Traffic light control
8. Stepper motor control
9. Digital clock
10. Key board and Display
11. Printer status
12. Serial interface and Parallel interface
13. A/D and D/A interface and Waveform Generation 8051
Experiments using kits and MASM
14. Basic arithmetic and Logical operations
15. Square and Cube program, Find 2 ?s complement of a number
16. Unpacked BCD to ASCII

? Write programs in ARM for a specific Application
? Write ALP Programs for fixed and Floating Point and Arithmetic
? Interface different I/Os with processor and Generate waveforms using Microprocessors
? Execute Programs in 8051
? Assess the performance of optical devices: light sources, fibers and detectors from both physical and
system point of view


COURSE OUTCOMES
COURSE OBJECTIVES
8 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 - 8086 PROGRAMS USING KITS AND MASM
1 Basic arithmetic and Logical operations 10
2 Decimal arithmetic and Code conversion 15
3 Move a data block without overlap 21
4 Matrix operations 24
5 Searching and Sorting a sting in a given array 27
6 Password checking and Print RAM size with system date 33
7 Counters and Time Delay 36
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
8 Stepper motor control 39
9 Traffic light control 42
10 Digital clock 47
11 Serial interface and Parallel interface 50
12 A/D interface 54
13 Key board and Display 57
14 D/A interface and Waveform Generation 60
CYCLE 3 - 8051 PROGRAMS USING KITS AND MASM
15 Basic arithmetic and Logical operations 64
16 Square and Cube program, Find 2?s complement of a number 69
17 Unpacked BCD to ASCII 71
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
18 Sorting of an array using 8051 74
19 Separate odd and even numbers using 8086 77
20 Sum of N consecutive numbers using 8086 80

9 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.1 BASIC ARITHMETIC AND LOGICAL OPERATIONS

Aim:
To write an Assembly Language Program to perform Arithmetic operation and to execute using 8086
microprocessor
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
Arithmetic Operation:
1. Addition:
Algorithm:
1. Clear BL register to store carry
2. Get the addend in AX register pair
3. Get the Augend in CX register pair
4. Add Augend and addend
5. Check for carry, If it is one go to step 6 else go to step 7
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

6. Increments carry (BL register by 1)
7. Store the sum in memory from AX register pair
8. Store the carry in memory from BL register
9. Stop
Program:
Address
Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 1010H
1007 MOV CX, 2020H
100B CLC
100C ADD AX, CX
100E JNC Label1
1010 INC BL
1012 Label 1 MOV [1200], AX
1016 MOV [1202], BL
101A HLT
Precaution:
Make sure that all the machine codes should be as per the specified in the program.
Tabulation:
Input Output
Address Data Address Data








2. Subtraction:
Algorithm:
1. Clear BL register for storing borrow
2. Get the minuend in AX register pair
3. Get the subtrahend in CX register pair
4. Subtract minuend and subtrahend
5. Check borrow, if borrow is one go to step 6 else go to step 8
6. Increment borrow (BL register by 1)
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

7. Negate AX register
8. Store the difference from AX in memory
9. Story the borrow from BL in memory
10. Stop
Program:
Address Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 2024H
1007 MOV CX, 1010H
100B SUB AX, CX
100D JNC Label1
100F INC BL
1011 NEG AX
1013 Label 1 MOV [1200], AX
1017 MOV [1202], BL
101B HLT

Tabulation:
Input Output
Address Data Address Data






3. Multiplication
Algorithm:
1. Clear DX register
2. Load the AX register pair with multiplicand
3. Load the CX register pair with multiplier
4. Multiply multiplicand and multiplier
5. Store the higher byte of product(from DX register pair) in memory specified
6. Store the lower byte of product(from AX register pair) in memory specified
7. Stop
8.
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV DX, 0000H
1004 MOV AX, 00FFH
1008 MOV CX, 0002H
100C MUL CX
100E MOV [1200], AX
1012 MOV [1202], DX
1016 HLT
Tabulation:
Input Output
Address Data Address Data






4. Division:
Algorithm
1. Clear DX register
2. Load the AX register pair with dividend
3. Load the CX register pair with divisor
4. Dividend divided by divisor
5. Store the quotient (from AX register pair) in memory specified
6. Store the remainder (from DX register pair) in memory specified
7. Stop
Program:
Address Label Mnemonics
1000 MOV DX, 0000H
1004 MOV AX, 0008H
1008 MOV CX, 0004H
100C DIV CX
100E MOV [1200], AX
1012 MOV [1202], DX
1016 HLT

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


Result:
Thus Assembly language program are written to perform arithmetic operation using 8086 microprocessor.
They are executed using 8086 processor and the outputs are verified.
Outcome:
At the end of this experiment the students able to write ALP programs for Arithmetic and Logical operations.

1. Write the size of the data bus of 8086.
2. Write the size of the address bus of 8086.
3. What is meant by physical addressing in 8086?
4. What is meant by an Opcode?
5. What is meant by an Operand?
6. What is meant by a Mnemonics?
7. What are the other possibilities of writing ADD, SUB and MUL instructions in other addressing modes?
8. What is the difference between microprocessor and microcontroller?
9. What is meant by LATCH?
10. What is the difference between primary & secondary storage device?
11. What is the difference between static and dynamic RAM?
12. What is an interrupt?
13. Differentiate between RAM and ROM?
14. Define ? Compiler
15. Define ? Flag
16. Define ? Stack
17. How clock signal is generated in 8086 microprocessor?
18. State the functions of queue status line QS0 and QS1 in 8086 microprocessor.
19. What is the purpose of BIU& EU?
20. List out the two examples of assembler directives.

Viva ? voce
15 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Applications:
1. barrel shifters
2. Multiple-precision arithmetic
3. Calculation pipeline
4. binary multipliers
5. Calculation in a single clock

16 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.2 DECIMAL ARITHMETIC AND CODE CONVERSION
Aim:
To write an Assembly Language Program to perform Code conversion and Decimal Arithmetic operations
and to execute using 8086 microprocessor
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
Decimal Arithmetic:
1. Using DAA
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Clear the CL reg.
4. Add the contents of AL and BL.
5. Adjust decimal accumulator after addition.
6. Store the result.
17 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 MOV CL, 00
100B ADD AL,BL
100D DAA
100E JNC L1
1010 INC CL
1012 L1 MOV [1150], AL
1016 MOV [1151], CL
101A HLT

Tabulation:
Input Output
Address Data Address Data


2. Using AAM
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Multiply the contents of AL and BL.
4. Adjust decimal accumulator after multiplication.
5. Store the result.
Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 MUL BL
100A AAM
100C MOV [1150], AH
1010 MOV [1151], AL
1014 HLT

18 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


3. Using DAS
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Subtract the contents of BL from AL.
4. Adjust decimal accumulator after subtraction.
5. Store the result.
Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 SUB AL,BL
100A DAS
100B MOV [1150], AL
100F HLT
Tabulation:
Input Output
Address Data Address Data


Code Conversion:
1. Binary to BCD
Algorithm:
1. Get the input and store in AL.
2. Clear the carry flag.
3. Rotate right the bits of input.
4. Find logical XOR between input and shifted input.
5. Store the result.
19 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 XOR AX,AX
1002 XOR CX,CX
1004 MOV BX,000B
1008 L2 CMP BX,00
100C JZ L1
100E DEC BX
100F MOV AL,CL
1011 ADD AL,01
1014 DAA
1015 MOV CL,AL
1017 MOV AL,CH
1019 ADC AL,00
101C DAA
101D MOV CH,AL
101F JMP L2
1022 MOV [1150],CX
1026 HLT
Tabulation:
Input Output
Address Data Address Data




2. Binary to Gray
Algorithm:
1. Get the input and store in AL.
2. Clear the carry flag.
3. Rotate right the bits of input.
4. Find logical XOR between input and shifted input.
5. Store the result.

20 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, AL
1006 CLC
1007 MOV CL,01
100A RCR AL,CL
100C XOR BL,AL
100E MOV [1150],BL
1012 HLT
Tabulation:
Input Output
Address Data Address Data


Result:
Thus an Assembly Language Program for code conversion and decimal arithmetic operations is written. The
program is executed using 8086 and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts of code conversions and
decimal arithmetic operations.








21 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


1. Write the function of the following 8085 instructions: JP, JPE, JPO, and JNZ.
2. What is the purpose of the following commands in 8086?
a) AAD
b) RCL
3. List out the addressing modes in 8086.
4. List out the various string instructions that are available in 8086.
5. What are the 8086 instructions used for BCD arithmetic?
6. What flags get affected after executing ADD instruction?
7. Which instruction is used to add immediate data?
8. What is BCD code? Where it is used?
9. What is ASCII code? Where it is used?
10. What is the difference between carry flag and overflow flag?
11. What are the special function register associated with interrupts?
12. List the flags affected by arithmetic instructions.
13. After executing ADDC instruction, what flags get affected?
14. How many bytes the instruction ADDC will add?
15. Name the signals used by the processor to communicate with an I/O processor
16. What is the function of IP?
17. What is the use of base pointer register?
18. Mention the index registers of 8086.
19. How many memory locations are available in 8086 microprocessor?
20. What are the flags in 8086? What are the various interrupts in 8086?
Applications:
1. Programmable calculators
2. Counting system using counts the tennis ball
3. Detecting and Correcting an Error with the Hamming Code
4. Power tool
5. Radio clocks
Viva ? voce
22 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.3 MOVE A DATA BLOCK WITHOUT OVERLAP
Aim:
To write an assembly language program to move a block of data to another memory location and execute it
using 8086
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Algorithm:
1. Initialize the source and destination memory location to SI and DI register
2. Initialize the counter (CL register)
3. Move the data to designation memory through AL register
4. Decrement the count
5. Check for zero flag and if zero flag is set go to next step
6. else go to step 3
7. Stop
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
23 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


Program:
Address Label Mnemonics
1000 MOV CL, 08
1003 MOV SI, 1200
1007 MOV DI, 1300
100B L1 LOD SB
100C MOV [DI], AL
100E INC DI
100F DEC CL
1011 JNZ L1
1013 HLT

Tabulation:
Input Output
Address Data Address Data




Result:
Thus an Assembly Language Program for moving data to another location is written the program is
executed using 8086 and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts and write the ALP program for
moving data to another location.



24 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00



1. List out the Flag manipulation instruction.
2. Define ? Variables
3. Define ? Segment Override Prefix
4. How is the memory segment accessed by 8086 microprocessor identified?
5. List out the advantages of using Direct Memory Access (DMA).
6. What is BIOS function call in 8086? (May 2012)
7. List out the difference between procedures and Macros.
8. What is meant by maskable interrupts& non-maskable interrupts?
9. What is the Maximum clock frequency in 8086?
10. Which Stack is used in 8086?
11. Define ? Pipeline (Dec 2011)
12. How many address lines are available in 8086? What is the maximum address possible?
13. What is an assembler?( May 2012)
14. What is the purpose of LEA instruction in 8086? (May 2012)
15. Give the function of index and pointers in 8086.
16. What are the different instruction set of 8086?
17. Give the various addressing modes in 8086.
18. Give the differences between JUMP and LOOP instruction.
19. Give the physical address formation of any two addressing mode.
20. Give the use of ?ASSUME? in 8086 programming.
Applications:
1. Priority Encoder
2. DVD players
3. Cellular telephones
4. Household appliances
5. Car equipment
Viva ? voce
25 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.4 MATRIX OPERATIONS
Aim:
To write an assembly language program to perform matrix addition and to execute it using 8086
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Algorithm:
1. Get the size (count) of the matrix
2. Initialize SI pointer for storing first matrix
3. Initialize DI pointer for storing second matrix
4. Move the contents pointed by SI pointer to accumulator
5. Move the contents pointed by DI pointer BL register
6. Add the contents of accumulator and BL register
7. Store result in the address pointed by DI pointer
8. Increment DI and SI pointer by 1 and Decrement count by 1
9. Check for zero. If no zero jump to step 4 else go to step 11
10. Stop the execution
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result

26 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV CL, 09
1003 MOV SI, 1100
1007 MOV DI, 1200
100B L1 MOV AL, [SI]
100D MOV BL, [DI]
100F ADD AL, BL
1011 MOV [DI], AL
1013 INC SI
1014 INC DI
1015 DEC CL
1017 JNZ L1
1019 HLT

Tabulation:
Input Output
Address Data Address Data



Result:
Thus an assembly language program for matrix addition was written. It is executed using 8086
microprocessor and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts of moving and adding the group
of data from one location to another location.







27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


1. Write an ALP for 8086 to multiply two 16 bit unsigned numbers.
2. What is an accumulator?
3. List out the segment register available in 8086.
4. List out any four program control instructions that are available in 8086.
5. What is program counter?
6. Give any four logical instructions in 8086.
7. How many memory locations are available in 8086 microprocessor?
8. What are the general purposes registers in 8086?
9. What are the functional units in 8086?
10. How much memory location allotted for the particular segments registers in 8086?
11. When the 8086 processor is in minimum mode and maximum mode?
12. Define ? Segment Override Prefix.
13. Define ? Macro and Procedure
14. Define ? Assembler and assembler directives
15. Define ? Compiler and Linker
16. What is meant by modular programming?
17. Explain the uses of PUSH and POP instruction.
18. Explain the uses of CALL and RET instruction.
19. Identify the addressing modes in the following instructions.
AND AL, BL
SUB AL, 24H
MOV AL, (BP)
MOV CX, 1245H
20. What are the 8086 instructions used for BCD arithmetic?

Applications:
1. Toys
2. Light switches and dimmers
3. Electrical circuit breakers
4. Smoke alarms
5. Battery packs


Viva ? voce
28 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.5 SEARCHING AND SORTING A STRING IN A
GIVEN ARRAY
a) Searching a String in a Given Array:
Aim:
To write an assembly language program to search a string in the given array and to execute it using 8086
kit.
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Algorithm:
1. Initialize the source and destination memory in SI and DI register
2. Initialize the count (CL) and Load the string values to any register (DL)
3. Move string to AL register and Compare the register (DL and AL)
4. Check for zero flag and if it is set jump to step 7 else go to step 9
5. Store the value of AL register
6. Increment DI register by one, Increment SI register by one and Decrement CL register by one
7. Check for zero flag and if it is set jump to step 12 else go to step 4
8. Stop the execution
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Type the Assembly Language Program
6. Press ?RESET? key
To executive the program
7. Press ?GO?
8. Type the starting address to execute the program
9. Press ?RESET? key
To verify the result
FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING


EC6513 ? MICROPROCESSOR AND MICROCONTROLLERLABORATORY


V SEMESTER - R 2013










Name : _______________________________________
Register No. : _______________________________________
Section : _______________________________________



LABORATORY MANUAL
2 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY


C01 - To learn the working of ARM processor
C02 - To introduce ALP concepts and features
C03 - To write ALP for arithmetic and logical operations in 8086 and 8051
C04 - To differentiate Serial and Parallel Interface
C05 - To interface different I/Os with Microprocessors
C06 - To be familiar with MASM
.




1. Write programs in ARM for a specific Application
2. Write ALP Programs for fixed and Floating Point and Arithmetic
3. Interface different I/Os with processor and Generate waveforms using Microprocessors
4. Execute Programs in 8051
5. Assess the performance of optical devices: light sources, fibers and detectors from both physical and system
point of view

INTRODUCTION
This course illustrates the concepts covered in course CS6412 and provides students with hands-on
experience in Assembly language programs.
PREREQUISITE:
1. Digital Electronics
EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
Lecture
No./Session No.
Name of the Experiment
Course
objectives
Proposed
date

1,2,3
Introduction to lab
CO1

CYCLE I - 8086 PROGRAMS USING KITS AND MASM
4,5,6 Basic arithmetic and Logical operations CO2
COURSE OBJECTIVES
COURSE OUTCOMES
3 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00













7,8,9 Decimal arithmetic and Code conversion CO3
10,11,12
Move a data block without overlap
CO3
Matrix operations
13,14,15 Searching and Sorting a sting in a given array CO2
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
16,17,18 D/A interface and Waveform Generation CO4
19,20,21 A/D interface CO5
22,23,24 Key board and Display CO5
25,26,27
Stepper motor control CO2
Traffic light control CO5
28,29,30
Digital clock CO6
Serial interface and Parallel interface CO4
CYCLE III - 8051 PROGRAMS USING KITS AND MASM
31,32,33 Basic arithmetic and Logical operations CO1
34,35,36
Square and Cube program, Find 2?s complement of a number
CO5
Unpacked BCD to ASCII
37,38,39
Password checking and Print RAM size with system date
CO6
Counters and Time Delay
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
40,41,42 Sorting of an array using 8051 CO2
43,44,45
Separate odd and even numbers using 8086


CO3
Sum of N consecutive numbers using 8086
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00




College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING




To impart professional education integrated with human values to the younger generation, so as to shape
them as proficient and dedicated engineers, capable of providing comprehensive solutions to the challenges in
deploying technology for the service of humanity



? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices


VISION
MISSION
VISION
MISSION
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of
engineering that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this
enables to find solutions for real time problem in industry and organization and to design products
requiring interdisciplinary skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up
their communication skills, individual leadership and supportive qualities and to develop them to adapt and
work in ever changing technologies
5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees











6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer
Science and Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the
career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both
verbal and written forms
i) To work in a team as team member or a leader and make unique contributions and work with
coordination
j) To engage lifelong learning and exhibit their technical skills
k) To develop and manage projects in multidisciplinary environments










7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER
LABORATORY
SYLLABUS

? To learn the working of ARM processor
? To introduce ALP concepts and features
? To write ALP for arithmetic and logical operations in 8086 and 8051
? To differentiate Serial and Parallel Interface
? To interface different I/Os with Microprocessors
? To be familiar with MASM
LIST OF EXPERIMENTS:
8086 Programs using kits and MASM
1. Basic arithmetic and Logical operations
2. Move a data block without overlap
3. Code conversion, decimal arithmetic and Matrix operations.
4. Floating point operations, string manipulations, sorting and searching
5. Password checking, Print RAM size and system date
6. Counters and Time Delay
Peripherals and Interfacing Experiments
7. Traffic light control
8. Stepper motor control
9. Digital clock
10. Key board and Display
11. Printer status
12. Serial interface and Parallel interface
13. A/D and D/A interface and Waveform Generation 8051
Experiments using kits and MASM
14. Basic arithmetic and Logical operations
15. Square and Cube program, Find 2 ?s complement of a number
16. Unpacked BCD to ASCII

? Write programs in ARM for a specific Application
? Write ALP Programs for fixed and Floating Point and Arithmetic
? Interface different I/Os with processor and Generate waveforms using Microprocessors
? Execute Programs in 8051
? Assess the performance of optical devices: light sources, fibers and detectors from both physical and
system point of view


COURSE OUTCOMES
COURSE OBJECTIVES
8 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 - 8086 PROGRAMS USING KITS AND MASM
1 Basic arithmetic and Logical operations 10
2 Decimal arithmetic and Code conversion 15
3 Move a data block without overlap 21
4 Matrix operations 24
5 Searching and Sorting a sting in a given array 27
6 Password checking and Print RAM size with system date 33
7 Counters and Time Delay 36
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
8 Stepper motor control 39
9 Traffic light control 42
10 Digital clock 47
11 Serial interface and Parallel interface 50
12 A/D interface 54
13 Key board and Display 57
14 D/A interface and Waveform Generation 60
CYCLE 3 - 8051 PROGRAMS USING KITS AND MASM
15 Basic arithmetic and Logical operations 64
16 Square and Cube program, Find 2?s complement of a number 69
17 Unpacked BCD to ASCII 71
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
18 Sorting of an array using 8051 74
19 Separate odd and even numbers using 8086 77
20 Sum of N consecutive numbers using 8086 80

9 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.1 BASIC ARITHMETIC AND LOGICAL OPERATIONS

Aim:
To write an Assembly Language Program to perform Arithmetic operation and to execute using 8086
microprocessor
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
Arithmetic Operation:
1. Addition:
Algorithm:
1. Clear BL register to store carry
2. Get the addend in AX register pair
3. Get the Augend in CX register pair
4. Add Augend and addend
5. Check for carry, If it is one go to step 6 else go to step 7
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

6. Increments carry (BL register by 1)
7. Store the sum in memory from AX register pair
8. Store the carry in memory from BL register
9. Stop
Program:
Address
Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 1010H
1007 MOV CX, 2020H
100B CLC
100C ADD AX, CX
100E JNC Label1
1010 INC BL
1012 Label 1 MOV [1200], AX
1016 MOV [1202], BL
101A HLT
Precaution:
Make sure that all the machine codes should be as per the specified in the program.
Tabulation:
Input Output
Address Data Address Data








2. Subtraction:
Algorithm:
1. Clear BL register for storing borrow
2. Get the minuend in AX register pair
3. Get the subtrahend in CX register pair
4. Subtract minuend and subtrahend
5. Check borrow, if borrow is one go to step 6 else go to step 8
6. Increment borrow (BL register by 1)
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

7. Negate AX register
8. Store the difference from AX in memory
9. Story the borrow from BL in memory
10. Stop
Program:
Address Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 2024H
1007 MOV CX, 1010H
100B SUB AX, CX
100D JNC Label1
100F INC BL
1011 NEG AX
1013 Label 1 MOV [1200], AX
1017 MOV [1202], BL
101B HLT

Tabulation:
Input Output
Address Data Address Data






3. Multiplication
Algorithm:
1. Clear DX register
2. Load the AX register pair with multiplicand
3. Load the CX register pair with multiplier
4. Multiply multiplicand and multiplier
5. Store the higher byte of product(from DX register pair) in memory specified
6. Store the lower byte of product(from AX register pair) in memory specified
7. Stop
8.
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV DX, 0000H
1004 MOV AX, 00FFH
1008 MOV CX, 0002H
100C MUL CX
100E MOV [1200], AX
1012 MOV [1202], DX
1016 HLT
Tabulation:
Input Output
Address Data Address Data






4. Division:
Algorithm
1. Clear DX register
2. Load the AX register pair with dividend
3. Load the CX register pair with divisor
4. Dividend divided by divisor
5. Store the quotient (from AX register pair) in memory specified
6. Store the remainder (from DX register pair) in memory specified
7. Stop
Program:
Address Label Mnemonics
1000 MOV DX, 0000H
1004 MOV AX, 0008H
1008 MOV CX, 0004H
100C DIV CX
100E MOV [1200], AX
1012 MOV [1202], DX
1016 HLT

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


Result:
Thus Assembly language program are written to perform arithmetic operation using 8086 microprocessor.
They are executed using 8086 processor and the outputs are verified.
Outcome:
At the end of this experiment the students able to write ALP programs for Arithmetic and Logical operations.

1. Write the size of the data bus of 8086.
2. Write the size of the address bus of 8086.
3. What is meant by physical addressing in 8086?
4. What is meant by an Opcode?
5. What is meant by an Operand?
6. What is meant by a Mnemonics?
7. What are the other possibilities of writing ADD, SUB and MUL instructions in other addressing modes?
8. What is the difference between microprocessor and microcontroller?
9. What is meant by LATCH?
10. What is the difference between primary & secondary storage device?
11. What is the difference between static and dynamic RAM?
12. What is an interrupt?
13. Differentiate between RAM and ROM?
14. Define ? Compiler
15. Define ? Flag
16. Define ? Stack
17. How clock signal is generated in 8086 microprocessor?
18. State the functions of queue status line QS0 and QS1 in 8086 microprocessor.
19. What is the purpose of BIU& EU?
20. List out the two examples of assembler directives.

Viva ? voce
15 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Applications:
1. barrel shifters
2. Multiple-precision arithmetic
3. Calculation pipeline
4. binary multipliers
5. Calculation in a single clock

16 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.2 DECIMAL ARITHMETIC AND CODE CONVERSION
Aim:
To write an Assembly Language Program to perform Code conversion and Decimal Arithmetic operations
and to execute using 8086 microprocessor
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
Decimal Arithmetic:
1. Using DAA
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Clear the CL reg.
4. Add the contents of AL and BL.
5. Adjust decimal accumulator after addition.
6. Store the result.
17 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 MOV CL, 00
100B ADD AL,BL
100D DAA
100E JNC L1
1010 INC CL
1012 L1 MOV [1150], AL
1016 MOV [1151], CL
101A HLT

Tabulation:
Input Output
Address Data Address Data


2. Using AAM
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Multiply the contents of AL and BL.
4. Adjust decimal accumulator after multiplication.
5. Store the result.
Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 MUL BL
100A AAM
100C MOV [1150], AH
1010 MOV [1151], AL
1014 HLT

18 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


3. Using DAS
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Subtract the contents of BL from AL.
4. Adjust decimal accumulator after subtraction.
5. Store the result.
Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 SUB AL,BL
100A DAS
100B MOV [1150], AL
100F HLT
Tabulation:
Input Output
Address Data Address Data


Code Conversion:
1. Binary to BCD
Algorithm:
1. Get the input and store in AL.
2. Clear the carry flag.
3. Rotate right the bits of input.
4. Find logical XOR between input and shifted input.
5. Store the result.
19 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 XOR AX,AX
1002 XOR CX,CX
1004 MOV BX,000B
1008 L2 CMP BX,00
100C JZ L1
100E DEC BX
100F MOV AL,CL
1011 ADD AL,01
1014 DAA
1015 MOV CL,AL
1017 MOV AL,CH
1019 ADC AL,00
101C DAA
101D MOV CH,AL
101F JMP L2
1022 MOV [1150],CX
1026 HLT
Tabulation:
Input Output
Address Data Address Data




2. Binary to Gray
Algorithm:
1. Get the input and store in AL.
2. Clear the carry flag.
3. Rotate right the bits of input.
4. Find logical XOR between input and shifted input.
5. Store the result.

20 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, AL
1006 CLC
1007 MOV CL,01
100A RCR AL,CL
100C XOR BL,AL
100E MOV [1150],BL
1012 HLT
Tabulation:
Input Output
Address Data Address Data


Result:
Thus an Assembly Language Program for code conversion and decimal arithmetic operations is written. The
program is executed using 8086 and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts of code conversions and
decimal arithmetic operations.








21 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


1. Write the function of the following 8085 instructions: JP, JPE, JPO, and JNZ.
2. What is the purpose of the following commands in 8086?
a) AAD
b) RCL
3. List out the addressing modes in 8086.
4. List out the various string instructions that are available in 8086.
5. What are the 8086 instructions used for BCD arithmetic?
6. What flags get affected after executing ADD instruction?
7. Which instruction is used to add immediate data?
8. What is BCD code? Where it is used?
9. What is ASCII code? Where it is used?
10. What is the difference between carry flag and overflow flag?
11. What are the special function register associated with interrupts?
12. List the flags affected by arithmetic instructions.
13. After executing ADDC instruction, what flags get affected?
14. How many bytes the instruction ADDC will add?
15. Name the signals used by the processor to communicate with an I/O processor
16. What is the function of IP?
17. What is the use of base pointer register?
18. Mention the index registers of 8086.
19. How many memory locations are available in 8086 microprocessor?
20. What are the flags in 8086? What are the various interrupts in 8086?
Applications:
1. Programmable calculators
2. Counting system using counts the tennis ball
3. Detecting and Correcting an Error with the Hamming Code
4. Power tool
5. Radio clocks
Viva ? voce
22 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.3 MOVE A DATA BLOCK WITHOUT OVERLAP
Aim:
To write an assembly language program to move a block of data to another memory location and execute it
using 8086
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Algorithm:
1. Initialize the source and destination memory location to SI and DI register
2. Initialize the counter (CL register)
3. Move the data to designation memory through AL register
4. Decrement the count
5. Check for zero flag and if zero flag is set go to next step
6. else go to step 3
7. Stop
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
23 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


Program:
Address Label Mnemonics
1000 MOV CL, 08
1003 MOV SI, 1200
1007 MOV DI, 1300
100B L1 LOD SB
100C MOV [DI], AL
100E INC DI
100F DEC CL
1011 JNZ L1
1013 HLT

Tabulation:
Input Output
Address Data Address Data




Result:
Thus an Assembly Language Program for moving data to another location is written the program is
executed using 8086 and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts and write the ALP program for
moving data to another location.



24 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00



1. List out the Flag manipulation instruction.
2. Define ? Variables
3. Define ? Segment Override Prefix
4. How is the memory segment accessed by 8086 microprocessor identified?
5. List out the advantages of using Direct Memory Access (DMA).
6. What is BIOS function call in 8086? (May 2012)
7. List out the difference between procedures and Macros.
8. What is meant by maskable interrupts& non-maskable interrupts?
9. What is the Maximum clock frequency in 8086?
10. Which Stack is used in 8086?
11. Define ? Pipeline (Dec 2011)
12. How many address lines are available in 8086? What is the maximum address possible?
13. What is an assembler?( May 2012)
14. What is the purpose of LEA instruction in 8086? (May 2012)
15. Give the function of index and pointers in 8086.
16. What are the different instruction set of 8086?
17. Give the various addressing modes in 8086.
18. Give the differences between JUMP and LOOP instruction.
19. Give the physical address formation of any two addressing mode.
20. Give the use of ?ASSUME? in 8086 programming.
Applications:
1. Priority Encoder
2. DVD players
3. Cellular telephones
4. Household appliances
5. Car equipment
Viva ? voce
25 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.4 MATRIX OPERATIONS
Aim:
To write an assembly language program to perform matrix addition and to execute it using 8086
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Algorithm:
1. Get the size (count) of the matrix
2. Initialize SI pointer for storing first matrix
3. Initialize DI pointer for storing second matrix
4. Move the contents pointed by SI pointer to accumulator
5. Move the contents pointed by DI pointer BL register
6. Add the contents of accumulator and BL register
7. Store result in the address pointed by DI pointer
8. Increment DI and SI pointer by 1 and Decrement count by 1
9. Check for zero. If no zero jump to step 4 else go to step 11
10. Stop the execution
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result

26 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV CL, 09
1003 MOV SI, 1100
1007 MOV DI, 1200
100B L1 MOV AL, [SI]
100D MOV BL, [DI]
100F ADD AL, BL
1011 MOV [DI], AL
1013 INC SI
1014 INC DI
1015 DEC CL
1017 JNZ L1
1019 HLT

Tabulation:
Input Output
Address Data Address Data



Result:
Thus an assembly language program for matrix addition was written. It is executed using 8086
microprocessor and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts of moving and adding the group
of data from one location to another location.







27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


1. Write an ALP for 8086 to multiply two 16 bit unsigned numbers.
2. What is an accumulator?
3. List out the segment register available in 8086.
4. List out any four program control instructions that are available in 8086.
5. What is program counter?
6. Give any four logical instructions in 8086.
7. How many memory locations are available in 8086 microprocessor?
8. What are the general purposes registers in 8086?
9. What are the functional units in 8086?
10. How much memory location allotted for the particular segments registers in 8086?
11. When the 8086 processor is in minimum mode and maximum mode?
12. Define ? Segment Override Prefix.
13. Define ? Macro and Procedure
14. Define ? Assembler and assembler directives
15. Define ? Compiler and Linker
16. What is meant by modular programming?
17. Explain the uses of PUSH and POP instruction.
18. Explain the uses of CALL and RET instruction.
19. Identify the addressing modes in the following instructions.
AND AL, BL
SUB AL, 24H
MOV AL, (BP)
MOV CX, 1245H
20. What are the 8086 instructions used for BCD arithmetic?

Applications:
1. Toys
2. Light switches and dimmers
3. Electrical circuit breakers
4. Smoke alarms
5. Battery packs


Viva ? voce
28 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.5 SEARCHING AND SORTING A STRING IN A
GIVEN ARRAY
a) Searching a String in a Given Array:
Aim:
To write an assembly language program to search a string in the given array and to execute it using 8086
kit.
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Algorithm:
1. Initialize the source and destination memory in SI and DI register
2. Initialize the count (CL) and Load the string values to any register (DL)
3. Move string to AL register and Compare the register (DL and AL)
4. Check for zero flag and if it is set jump to step 7 else go to step 9
5. Store the value of AL register
6. Increment DI register by one, Increment SI register by one and Decrement CL register by one
7. Check for zero flag and if it is set jump to step 12 else go to step 4
8. Stop the execution
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Type the Assembly Language Program
6. Press ?RESET? key
To executive the program
7. Press ?GO?
8. Type the starting address to execute the program
9. Press ?RESET? key
To verify the result
29 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

10. Type ?SB(Substitute Byte)?
11. Enter the output address location to check the result
Program:
Address Label Mnemonics
1000 MOV DI, 1300
1004 MOV SI, 1200
1008 MOV CL, 06
100B MOV DL, 02
100E L1 MOV AL, [SI]
1010 CMP DL, AL
1012 JNZ L2
1014 MOV [DI], AL
1016 INC DI
1017 L2 INC SI
1018 DEC CL
101A JNZ L1
101C HLT

Tabulation:
Input Output
Address Data Address Data


Result:
Thus an assembly language program to search a string in the string in the given array is written. The
program is executed using 8086 and the output is verified.






FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING


EC6513 ? MICROPROCESSOR AND MICROCONTROLLERLABORATORY


V SEMESTER - R 2013










Name : _______________________________________
Register No. : _______________________________________
Section : _______________________________________



LABORATORY MANUAL
2 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY


C01 - To learn the working of ARM processor
C02 - To introduce ALP concepts and features
C03 - To write ALP for arithmetic and logical operations in 8086 and 8051
C04 - To differentiate Serial and Parallel Interface
C05 - To interface different I/Os with Microprocessors
C06 - To be familiar with MASM
.




1. Write programs in ARM for a specific Application
2. Write ALP Programs for fixed and Floating Point and Arithmetic
3. Interface different I/Os with processor and Generate waveforms using Microprocessors
4. Execute Programs in 8051
5. Assess the performance of optical devices: light sources, fibers and detectors from both physical and system
point of view

INTRODUCTION
This course illustrates the concepts covered in course CS6412 and provides students with hands-on
experience in Assembly language programs.
PREREQUISITE:
1. Digital Electronics
EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
Lecture
No./Session No.
Name of the Experiment
Course
objectives
Proposed
date

1,2,3
Introduction to lab
CO1

CYCLE I - 8086 PROGRAMS USING KITS AND MASM
4,5,6 Basic arithmetic and Logical operations CO2
COURSE OBJECTIVES
COURSE OUTCOMES
3 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00













7,8,9 Decimal arithmetic and Code conversion CO3
10,11,12
Move a data block without overlap
CO3
Matrix operations
13,14,15 Searching and Sorting a sting in a given array CO2
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
16,17,18 D/A interface and Waveform Generation CO4
19,20,21 A/D interface CO5
22,23,24 Key board and Display CO5
25,26,27
Stepper motor control CO2
Traffic light control CO5
28,29,30
Digital clock CO6
Serial interface and Parallel interface CO4
CYCLE III - 8051 PROGRAMS USING KITS AND MASM
31,32,33 Basic arithmetic and Logical operations CO1
34,35,36
Square and Cube program, Find 2?s complement of a number
CO5
Unpacked BCD to ASCII
37,38,39
Password checking and Print RAM size with system date
CO6
Counters and Time Delay
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
40,41,42 Sorting of an array using 8051 CO2
43,44,45
Separate odd and even numbers using 8086


CO3
Sum of N consecutive numbers using 8086
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00




College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING




To impart professional education integrated with human values to the younger generation, so as to shape
them as proficient and dedicated engineers, capable of providing comprehensive solutions to the challenges in
deploying technology for the service of humanity



? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices


VISION
MISSION
VISION
MISSION
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of
engineering that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this
enables to find solutions for real time problem in industry and organization and to design products
requiring interdisciplinary skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up
their communication skills, individual leadership and supportive qualities and to develop them to adapt and
work in ever changing technologies
5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees











6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer
Science and Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the
career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both
verbal and written forms
i) To work in a team as team member or a leader and make unique contributions and work with
coordination
j) To engage lifelong learning and exhibit their technical skills
k) To develop and manage projects in multidisciplinary environments










7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER
LABORATORY
SYLLABUS

? To learn the working of ARM processor
? To introduce ALP concepts and features
? To write ALP for arithmetic and logical operations in 8086 and 8051
? To differentiate Serial and Parallel Interface
? To interface different I/Os with Microprocessors
? To be familiar with MASM
LIST OF EXPERIMENTS:
8086 Programs using kits and MASM
1. Basic arithmetic and Logical operations
2. Move a data block without overlap
3. Code conversion, decimal arithmetic and Matrix operations.
4. Floating point operations, string manipulations, sorting and searching
5. Password checking, Print RAM size and system date
6. Counters and Time Delay
Peripherals and Interfacing Experiments
7. Traffic light control
8. Stepper motor control
9. Digital clock
10. Key board and Display
11. Printer status
12. Serial interface and Parallel interface
13. A/D and D/A interface and Waveform Generation 8051
Experiments using kits and MASM
14. Basic arithmetic and Logical operations
15. Square and Cube program, Find 2 ?s complement of a number
16. Unpacked BCD to ASCII

? Write programs in ARM for a specific Application
? Write ALP Programs for fixed and Floating Point and Arithmetic
? Interface different I/Os with processor and Generate waveforms using Microprocessors
? Execute Programs in 8051
? Assess the performance of optical devices: light sources, fibers and detectors from both physical and
system point of view


COURSE OUTCOMES
COURSE OBJECTIVES
8 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 - 8086 PROGRAMS USING KITS AND MASM
1 Basic arithmetic and Logical operations 10
2 Decimal arithmetic and Code conversion 15
3 Move a data block without overlap 21
4 Matrix operations 24
5 Searching and Sorting a sting in a given array 27
6 Password checking and Print RAM size with system date 33
7 Counters and Time Delay 36
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
8 Stepper motor control 39
9 Traffic light control 42
10 Digital clock 47
11 Serial interface and Parallel interface 50
12 A/D interface 54
13 Key board and Display 57
14 D/A interface and Waveform Generation 60
CYCLE 3 - 8051 PROGRAMS USING KITS AND MASM
15 Basic arithmetic and Logical operations 64
16 Square and Cube program, Find 2?s complement of a number 69
17 Unpacked BCD to ASCII 71
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
18 Sorting of an array using 8051 74
19 Separate odd and even numbers using 8086 77
20 Sum of N consecutive numbers using 8086 80

9 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.1 BASIC ARITHMETIC AND LOGICAL OPERATIONS

Aim:
To write an Assembly Language Program to perform Arithmetic operation and to execute using 8086
microprocessor
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
Arithmetic Operation:
1. Addition:
Algorithm:
1. Clear BL register to store carry
2. Get the addend in AX register pair
3. Get the Augend in CX register pair
4. Add Augend and addend
5. Check for carry, If it is one go to step 6 else go to step 7
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

6. Increments carry (BL register by 1)
7. Store the sum in memory from AX register pair
8. Store the carry in memory from BL register
9. Stop
Program:
Address
Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 1010H
1007 MOV CX, 2020H
100B CLC
100C ADD AX, CX
100E JNC Label1
1010 INC BL
1012 Label 1 MOV [1200], AX
1016 MOV [1202], BL
101A HLT
Precaution:
Make sure that all the machine codes should be as per the specified in the program.
Tabulation:
Input Output
Address Data Address Data








2. Subtraction:
Algorithm:
1. Clear BL register for storing borrow
2. Get the minuend in AX register pair
3. Get the subtrahend in CX register pair
4. Subtract minuend and subtrahend
5. Check borrow, if borrow is one go to step 6 else go to step 8
6. Increment borrow (BL register by 1)
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

7. Negate AX register
8. Store the difference from AX in memory
9. Story the borrow from BL in memory
10. Stop
Program:
Address Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 2024H
1007 MOV CX, 1010H
100B SUB AX, CX
100D JNC Label1
100F INC BL
1011 NEG AX
1013 Label 1 MOV [1200], AX
1017 MOV [1202], BL
101B HLT

Tabulation:
Input Output
Address Data Address Data






3. Multiplication
Algorithm:
1. Clear DX register
2. Load the AX register pair with multiplicand
3. Load the CX register pair with multiplier
4. Multiply multiplicand and multiplier
5. Store the higher byte of product(from DX register pair) in memory specified
6. Store the lower byte of product(from AX register pair) in memory specified
7. Stop
8.
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV DX, 0000H
1004 MOV AX, 00FFH
1008 MOV CX, 0002H
100C MUL CX
100E MOV [1200], AX
1012 MOV [1202], DX
1016 HLT
Tabulation:
Input Output
Address Data Address Data






4. Division:
Algorithm
1. Clear DX register
2. Load the AX register pair with dividend
3. Load the CX register pair with divisor
4. Dividend divided by divisor
5. Store the quotient (from AX register pair) in memory specified
6. Store the remainder (from DX register pair) in memory specified
7. Stop
Program:
Address Label Mnemonics
1000 MOV DX, 0000H
1004 MOV AX, 0008H
1008 MOV CX, 0004H
100C DIV CX
100E MOV [1200], AX
1012 MOV [1202], DX
1016 HLT

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


Result:
Thus Assembly language program are written to perform arithmetic operation using 8086 microprocessor.
They are executed using 8086 processor and the outputs are verified.
Outcome:
At the end of this experiment the students able to write ALP programs for Arithmetic and Logical operations.

1. Write the size of the data bus of 8086.
2. Write the size of the address bus of 8086.
3. What is meant by physical addressing in 8086?
4. What is meant by an Opcode?
5. What is meant by an Operand?
6. What is meant by a Mnemonics?
7. What are the other possibilities of writing ADD, SUB and MUL instructions in other addressing modes?
8. What is the difference between microprocessor and microcontroller?
9. What is meant by LATCH?
10. What is the difference between primary & secondary storage device?
11. What is the difference between static and dynamic RAM?
12. What is an interrupt?
13. Differentiate between RAM and ROM?
14. Define ? Compiler
15. Define ? Flag
16. Define ? Stack
17. How clock signal is generated in 8086 microprocessor?
18. State the functions of queue status line QS0 and QS1 in 8086 microprocessor.
19. What is the purpose of BIU& EU?
20. List out the two examples of assembler directives.

Viva ? voce
15 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Applications:
1. barrel shifters
2. Multiple-precision arithmetic
3. Calculation pipeline
4. binary multipliers
5. Calculation in a single clock

16 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.2 DECIMAL ARITHMETIC AND CODE CONVERSION
Aim:
To write an Assembly Language Program to perform Code conversion and Decimal Arithmetic operations
and to execute using 8086 microprocessor
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
Decimal Arithmetic:
1. Using DAA
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Clear the CL reg.
4. Add the contents of AL and BL.
5. Adjust decimal accumulator after addition.
6. Store the result.
17 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 MOV CL, 00
100B ADD AL,BL
100D DAA
100E JNC L1
1010 INC CL
1012 L1 MOV [1150], AL
1016 MOV [1151], CL
101A HLT

Tabulation:
Input Output
Address Data Address Data


2. Using AAM
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Multiply the contents of AL and BL.
4. Adjust decimal accumulator after multiplication.
5. Store the result.
Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 MUL BL
100A AAM
100C MOV [1150], AH
1010 MOV [1151], AL
1014 HLT

18 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


3. Using DAS
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Subtract the contents of BL from AL.
4. Adjust decimal accumulator after subtraction.
5. Store the result.
Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 SUB AL,BL
100A DAS
100B MOV [1150], AL
100F HLT
Tabulation:
Input Output
Address Data Address Data


Code Conversion:
1. Binary to BCD
Algorithm:
1. Get the input and store in AL.
2. Clear the carry flag.
3. Rotate right the bits of input.
4. Find logical XOR between input and shifted input.
5. Store the result.
19 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 XOR AX,AX
1002 XOR CX,CX
1004 MOV BX,000B
1008 L2 CMP BX,00
100C JZ L1
100E DEC BX
100F MOV AL,CL
1011 ADD AL,01
1014 DAA
1015 MOV CL,AL
1017 MOV AL,CH
1019 ADC AL,00
101C DAA
101D MOV CH,AL
101F JMP L2
1022 MOV [1150],CX
1026 HLT
Tabulation:
Input Output
Address Data Address Data




2. Binary to Gray
Algorithm:
1. Get the input and store in AL.
2. Clear the carry flag.
3. Rotate right the bits of input.
4. Find logical XOR between input and shifted input.
5. Store the result.

20 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, AL
1006 CLC
1007 MOV CL,01
100A RCR AL,CL
100C XOR BL,AL
100E MOV [1150],BL
1012 HLT
Tabulation:
Input Output
Address Data Address Data


Result:
Thus an Assembly Language Program for code conversion and decimal arithmetic operations is written. The
program is executed using 8086 and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts of code conversions and
decimal arithmetic operations.








21 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


1. Write the function of the following 8085 instructions: JP, JPE, JPO, and JNZ.
2. What is the purpose of the following commands in 8086?
a) AAD
b) RCL
3. List out the addressing modes in 8086.
4. List out the various string instructions that are available in 8086.
5. What are the 8086 instructions used for BCD arithmetic?
6. What flags get affected after executing ADD instruction?
7. Which instruction is used to add immediate data?
8. What is BCD code? Where it is used?
9. What is ASCII code? Where it is used?
10. What is the difference between carry flag and overflow flag?
11. What are the special function register associated with interrupts?
12. List the flags affected by arithmetic instructions.
13. After executing ADDC instruction, what flags get affected?
14. How many bytes the instruction ADDC will add?
15. Name the signals used by the processor to communicate with an I/O processor
16. What is the function of IP?
17. What is the use of base pointer register?
18. Mention the index registers of 8086.
19. How many memory locations are available in 8086 microprocessor?
20. What are the flags in 8086? What are the various interrupts in 8086?
Applications:
1. Programmable calculators
2. Counting system using counts the tennis ball
3. Detecting and Correcting an Error with the Hamming Code
4. Power tool
5. Radio clocks
Viva ? voce
22 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.3 MOVE A DATA BLOCK WITHOUT OVERLAP
Aim:
To write an assembly language program to move a block of data to another memory location and execute it
using 8086
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Algorithm:
1. Initialize the source and destination memory location to SI and DI register
2. Initialize the counter (CL register)
3. Move the data to designation memory through AL register
4. Decrement the count
5. Check for zero flag and if zero flag is set go to next step
6. else go to step 3
7. Stop
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
23 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


Program:
Address Label Mnemonics
1000 MOV CL, 08
1003 MOV SI, 1200
1007 MOV DI, 1300
100B L1 LOD SB
100C MOV [DI], AL
100E INC DI
100F DEC CL
1011 JNZ L1
1013 HLT

Tabulation:
Input Output
Address Data Address Data




Result:
Thus an Assembly Language Program for moving data to another location is written the program is
executed using 8086 and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts and write the ALP program for
moving data to another location.



24 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00



1. List out the Flag manipulation instruction.
2. Define ? Variables
3. Define ? Segment Override Prefix
4. How is the memory segment accessed by 8086 microprocessor identified?
5. List out the advantages of using Direct Memory Access (DMA).
6. What is BIOS function call in 8086? (May 2012)
7. List out the difference between procedures and Macros.
8. What is meant by maskable interrupts& non-maskable interrupts?
9. What is the Maximum clock frequency in 8086?
10. Which Stack is used in 8086?
11. Define ? Pipeline (Dec 2011)
12. How many address lines are available in 8086? What is the maximum address possible?
13. What is an assembler?( May 2012)
14. What is the purpose of LEA instruction in 8086? (May 2012)
15. Give the function of index and pointers in 8086.
16. What are the different instruction set of 8086?
17. Give the various addressing modes in 8086.
18. Give the differences between JUMP and LOOP instruction.
19. Give the physical address formation of any two addressing mode.
20. Give the use of ?ASSUME? in 8086 programming.
Applications:
1. Priority Encoder
2. DVD players
3. Cellular telephones
4. Household appliances
5. Car equipment
Viva ? voce
25 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.4 MATRIX OPERATIONS
Aim:
To write an assembly language program to perform matrix addition and to execute it using 8086
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Algorithm:
1. Get the size (count) of the matrix
2. Initialize SI pointer for storing first matrix
3. Initialize DI pointer for storing second matrix
4. Move the contents pointed by SI pointer to accumulator
5. Move the contents pointed by DI pointer BL register
6. Add the contents of accumulator and BL register
7. Store result in the address pointed by DI pointer
8. Increment DI and SI pointer by 1 and Decrement count by 1
9. Check for zero. If no zero jump to step 4 else go to step 11
10. Stop the execution
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result

26 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV CL, 09
1003 MOV SI, 1100
1007 MOV DI, 1200
100B L1 MOV AL, [SI]
100D MOV BL, [DI]
100F ADD AL, BL
1011 MOV [DI], AL
1013 INC SI
1014 INC DI
1015 DEC CL
1017 JNZ L1
1019 HLT

Tabulation:
Input Output
Address Data Address Data



Result:
Thus an assembly language program for matrix addition was written. It is executed using 8086
microprocessor and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts of moving and adding the group
of data from one location to another location.







27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


1. Write an ALP for 8086 to multiply two 16 bit unsigned numbers.
2. What is an accumulator?
3. List out the segment register available in 8086.
4. List out any four program control instructions that are available in 8086.
5. What is program counter?
6. Give any four logical instructions in 8086.
7. How many memory locations are available in 8086 microprocessor?
8. What are the general purposes registers in 8086?
9. What are the functional units in 8086?
10. How much memory location allotted for the particular segments registers in 8086?
11. When the 8086 processor is in minimum mode and maximum mode?
12. Define ? Segment Override Prefix.
13. Define ? Macro and Procedure
14. Define ? Assembler and assembler directives
15. Define ? Compiler and Linker
16. What is meant by modular programming?
17. Explain the uses of PUSH and POP instruction.
18. Explain the uses of CALL and RET instruction.
19. Identify the addressing modes in the following instructions.
AND AL, BL
SUB AL, 24H
MOV AL, (BP)
MOV CX, 1245H
20. What are the 8086 instructions used for BCD arithmetic?

Applications:
1. Toys
2. Light switches and dimmers
3. Electrical circuit breakers
4. Smoke alarms
5. Battery packs


Viva ? voce
28 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.5 SEARCHING AND SORTING A STRING IN A
GIVEN ARRAY
a) Searching a String in a Given Array:
Aim:
To write an assembly language program to search a string in the given array and to execute it using 8086
kit.
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Algorithm:
1. Initialize the source and destination memory in SI and DI register
2. Initialize the count (CL) and Load the string values to any register (DL)
3. Move string to AL register and Compare the register (DL and AL)
4. Check for zero flag and if it is set jump to step 7 else go to step 9
5. Store the value of AL register
6. Increment DI register by one, Increment SI register by one and Decrement CL register by one
7. Check for zero flag and if it is set jump to step 12 else go to step 4
8. Stop the execution
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Type the Assembly Language Program
6. Press ?RESET? key
To executive the program
7. Press ?GO?
8. Type the starting address to execute the program
9. Press ?RESET? key
To verify the result
29 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

10. Type ?SB(Substitute Byte)?
11. Enter the output address location to check the result
Program:
Address Label Mnemonics
1000 MOV DI, 1300
1004 MOV SI, 1200
1008 MOV CL, 06
100B MOV DL, 02
100E L1 MOV AL, [SI]
1010 CMP DL, AL
1012 JNZ L2
1014 MOV [DI], AL
1016 INC DI
1017 L2 INC SI
1018 DEC CL
101A JNZ L1
101C HLT

Tabulation:
Input Output
Address Data Address Data


Result:
Thus an assembly language program to search a string in the string in the given array is written. The
program is executed using 8086 and the output is verified.






30 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

b) Sorting an Array of Data Using 8086:
Aim:
To write an assembly language program to sort an array of data in ascending and descending order and
execute it using 8086 kit
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
1. Ascending Order:
Algorithm:
1. Set SI as pointer for array
2. Set CL as outer loop counter
3. Initialize array pointer
4. Set CH as inner loop counter
5. Increment array pointer
6. Get the first element of array
7. Increment array pointer and Compare the two elements
FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING


EC6513 ? MICROPROCESSOR AND MICROCONTROLLERLABORATORY


V SEMESTER - R 2013










Name : _______________________________________
Register No. : _______________________________________
Section : _______________________________________



LABORATORY MANUAL
2 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY


C01 - To learn the working of ARM processor
C02 - To introduce ALP concepts and features
C03 - To write ALP for arithmetic and logical operations in 8086 and 8051
C04 - To differentiate Serial and Parallel Interface
C05 - To interface different I/Os with Microprocessors
C06 - To be familiar with MASM
.




1. Write programs in ARM for a specific Application
2. Write ALP Programs for fixed and Floating Point and Arithmetic
3. Interface different I/Os with processor and Generate waveforms using Microprocessors
4. Execute Programs in 8051
5. Assess the performance of optical devices: light sources, fibers and detectors from both physical and system
point of view

INTRODUCTION
This course illustrates the concepts covered in course CS6412 and provides students with hands-on
experience in Assembly language programs.
PREREQUISITE:
1. Digital Electronics
EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
Lecture
No./Session No.
Name of the Experiment
Course
objectives
Proposed
date

1,2,3
Introduction to lab
CO1

CYCLE I - 8086 PROGRAMS USING KITS AND MASM
4,5,6 Basic arithmetic and Logical operations CO2
COURSE OBJECTIVES
COURSE OUTCOMES
3 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00













7,8,9 Decimal arithmetic and Code conversion CO3
10,11,12
Move a data block without overlap
CO3
Matrix operations
13,14,15 Searching and Sorting a sting in a given array CO2
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
16,17,18 D/A interface and Waveform Generation CO4
19,20,21 A/D interface CO5
22,23,24 Key board and Display CO5
25,26,27
Stepper motor control CO2
Traffic light control CO5
28,29,30
Digital clock CO6
Serial interface and Parallel interface CO4
CYCLE III - 8051 PROGRAMS USING KITS AND MASM
31,32,33 Basic arithmetic and Logical operations CO1
34,35,36
Square and Cube program, Find 2?s complement of a number
CO5
Unpacked BCD to ASCII
37,38,39
Password checking and Print RAM size with system date
CO6
Counters and Time Delay
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
40,41,42 Sorting of an array using 8051 CO2
43,44,45
Separate odd and even numbers using 8086


CO3
Sum of N consecutive numbers using 8086
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00




College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING




To impart professional education integrated with human values to the younger generation, so as to shape
them as proficient and dedicated engineers, capable of providing comprehensive solutions to the challenges in
deploying technology for the service of humanity



? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices


VISION
MISSION
VISION
MISSION
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of
engineering that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this
enables to find solutions for real time problem in industry and organization and to design products
requiring interdisciplinary skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up
their communication skills, individual leadership and supportive qualities and to develop them to adapt and
work in ever changing technologies
5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees











6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer
Science and Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the
career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both
verbal and written forms
i) To work in a team as team member or a leader and make unique contributions and work with
coordination
j) To engage lifelong learning and exhibit their technical skills
k) To develop and manage projects in multidisciplinary environments










7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER
LABORATORY
SYLLABUS

? To learn the working of ARM processor
? To introduce ALP concepts and features
? To write ALP for arithmetic and logical operations in 8086 and 8051
? To differentiate Serial and Parallel Interface
? To interface different I/Os with Microprocessors
? To be familiar with MASM
LIST OF EXPERIMENTS:
8086 Programs using kits and MASM
1. Basic arithmetic and Logical operations
2. Move a data block without overlap
3. Code conversion, decimal arithmetic and Matrix operations.
4. Floating point operations, string manipulations, sorting and searching
5. Password checking, Print RAM size and system date
6. Counters and Time Delay
Peripherals and Interfacing Experiments
7. Traffic light control
8. Stepper motor control
9. Digital clock
10. Key board and Display
11. Printer status
12. Serial interface and Parallel interface
13. A/D and D/A interface and Waveform Generation 8051
Experiments using kits and MASM
14. Basic arithmetic and Logical operations
15. Square and Cube program, Find 2 ?s complement of a number
16. Unpacked BCD to ASCII

? Write programs in ARM for a specific Application
? Write ALP Programs for fixed and Floating Point and Arithmetic
? Interface different I/Os with processor and Generate waveforms using Microprocessors
? Execute Programs in 8051
? Assess the performance of optical devices: light sources, fibers and detectors from both physical and
system point of view


COURSE OUTCOMES
COURSE OBJECTIVES
8 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 - 8086 PROGRAMS USING KITS AND MASM
1 Basic arithmetic and Logical operations 10
2 Decimal arithmetic and Code conversion 15
3 Move a data block without overlap 21
4 Matrix operations 24
5 Searching and Sorting a sting in a given array 27
6 Password checking and Print RAM size with system date 33
7 Counters and Time Delay 36
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
8 Stepper motor control 39
9 Traffic light control 42
10 Digital clock 47
11 Serial interface and Parallel interface 50
12 A/D interface 54
13 Key board and Display 57
14 D/A interface and Waveform Generation 60
CYCLE 3 - 8051 PROGRAMS USING KITS AND MASM
15 Basic arithmetic and Logical operations 64
16 Square and Cube program, Find 2?s complement of a number 69
17 Unpacked BCD to ASCII 71
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
18 Sorting of an array using 8051 74
19 Separate odd and even numbers using 8086 77
20 Sum of N consecutive numbers using 8086 80

9 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.1 BASIC ARITHMETIC AND LOGICAL OPERATIONS

Aim:
To write an Assembly Language Program to perform Arithmetic operation and to execute using 8086
microprocessor
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
Arithmetic Operation:
1. Addition:
Algorithm:
1. Clear BL register to store carry
2. Get the addend in AX register pair
3. Get the Augend in CX register pair
4. Add Augend and addend
5. Check for carry, If it is one go to step 6 else go to step 7
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

6. Increments carry (BL register by 1)
7. Store the sum in memory from AX register pair
8. Store the carry in memory from BL register
9. Stop
Program:
Address
Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 1010H
1007 MOV CX, 2020H
100B CLC
100C ADD AX, CX
100E JNC Label1
1010 INC BL
1012 Label 1 MOV [1200], AX
1016 MOV [1202], BL
101A HLT
Precaution:
Make sure that all the machine codes should be as per the specified in the program.
Tabulation:
Input Output
Address Data Address Data








2. Subtraction:
Algorithm:
1. Clear BL register for storing borrow
2. Get the minuend in AX register pair
3. Get the subtrahend in CX register pair
4. Subtract minuend and subtrahend
5. Check borrow, if borrow is one go to step 6 else go to step 8
6. Increment borrow (BL register by 1)
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

7. Negate AX register
8. Store the difference from AX in memory
9. Story the borrow from BL in memory
10. Stop
Program:
Address Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 2024H
1007 MOV CX, 1010H
100B SUB AX, CX
100D JNC Label1
100F INC BL
1011 NEG AX
1013 Label 1 MOV [1200], AX
1017 MOV [1202], BL
101B HLT

Tabulation:
Input Output
Address Data Address Data






3. Multiplication
Algorithm:
1. Clear DX register
2. Load the AX register pair with multiplicand
3. Load the CX register pair with multiplier
4. Multiply multiplicand and multiplier
5. Store the higher byte of product(from DX register pair) in memory specified
6. Store the lower byte of product(from AX register pair) in memory specified
7. Stop
8.
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV DX, 0000H
1004 MOV AX, 00FFH
1008 MOV CX, 0002H
100C MUL CX
100E MOV [1200], AX
1012 MOV [1202], DX
1016 HLT
Tabulation:
Input Output
Address Data Address Data






4. Division:
Algorithm
1. Clear DX register
2. Load the AX register pair with dividend
3. Load the CX register pair with divisor
4. Dividend divided by divisor
5. Store the quotient (from AX register pair) in memory specified
6. Store the remainder (from DX register pair) in memory specified
7. Stop
Program:
Address Label Mnemonics
1000 MOV DX, 0000H
1004 MOV AX, 0008H
1008 MOV CX, 0004H
100C DIV CX
100E MOV [1200], AX
1012 MOV [1202], DX
1016 HLT

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


Result:
Thus Assembly language program are written to perform arithmetic operation using 8086 microprocessor.
They are executed using 8086 processor and the outputs are verified.
Outcome:
At the end of this experiment the students able to write ALP programs for Arithmetic and Logical operations.

1. Write the size of the data bus of 8086.
2. Write the size of the address bus of 8086.
3. What is meant by physical addressing in 8086?
4. What is meant by an Opcode?
5. What is meant by an Operand?
6. What is meant by a Mnemonics?
7. What are the other possibilities of writing ADD, SUB and MUL instructions in other addressing modes?
8. What is the difference between microprocessor and microcontroller?
9. What is meant by LATCH?
10. What is the difference between primary & secondary storage device?
11. What is the difference between static and dynamic RAM?
12. What is an interrupt?
13. Differentiate between RAM and ROM?
14. Define ? Compiler
15. Define ? Flag
16. Define ? Stack
17. How clock signal is generated in 8086 microprocessor?
18. State the functions of queue status line QS0 and QS1 in 8086 microprocessor.
19. What is the purpose of BIU& EU?
20. List out the two examples of assembler directives.

Viva ? voce
15 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Applications:
1. barrel shifters
2. Multiple-precision arithmetic
3. Calculation pipeline
4. binary multipliers
5. Calculation in a single clock

16 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.2 DECIMAL ARITHMETIC AND CODE CONVERSION
Aim:
To write an Assembly Language Program to perform Code conversion and Decimal Arithmetic operations
and to execute using 8086 microprocessor
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
Decimal Arithmetic:
1. Using DAA
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Clear the CL reg.
4. Add the contents of AL and BL.
5. Adjust decimal accumulator after addition.
6. Store the result.
17 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 MOV CL, 00
100B ADD AL,BL
100D DAA
100E JNC L1
1010 INC CL
1012 L1 MOV [1150], AL
1016 MOV [1151], CL
101A HLT

Tabulation:
Input Output
Address Data Address Data


2. Using AAM
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Multiply the contents of AL and BL.
4. Adjust decimal accumulator after multiplication.
5. Store the result.
Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 MUL BL
100A AAM
100C MOV [1150], AH
1010 MOV [1151], AL
1014 HLT

18 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


3. Using DAS
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Subtract the contents of BL from AL.
4. Adjust decimal accumulator after subtraction.
5. Store the result.
Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 SUB AL,BL
100A DAS
100B MOV [1150], AL
100F HLT
Tabulation:
Input Output
Address Data Address Data


Code Conversion:
1. Binary to BCD
Algorithm:
1. Get the input and store in AL.
2. Clear the carry flag.
3. Rotate right the bits of input.
4. Find logical XOR between input and shifted input.
5. Store the result.
19 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 XOR AX,AX
1002 XOR CX,CX
1004 MOV BX,000B
1008 L2 CMP BX,00
100C JZ L1
100E DEC BX
100F MOV AL,CL
1011 ADD AL,01
1014 DAA
1015 MOV CL,AL
1017 MOV AL,CH
1019 ADC AL,00
101C DAA
101D MOV CH,AL
101F JMP L2
1022 MOV [1150],CX
1026 HLT
Tabulation:
Input Output
Address Data Address Data




2. Binary to Gray
Algorithm:
1. Get the input and store in AL.
2. Clear the carry flag.
3. Rotate right the bits of input.
4. Find logical XOR between input and shifted input.
5. Store the result.

20 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, AL
1006 CLC
1007 MOV CL,01
100A RCR AL,CL
100C XOR BL,AL
100E MOV [1150],BL
1012 HLT
Tabulation:
Input Output
Address Data Address Data


Result:
Thus an Assembly Language Program for code conversion and decimal arithmetic operations is written. The
program is executed using 8086 and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts of code conversions and
decimal arithmetic operations.








21 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


1. Write the function of the following 8085 instructions: JP, JPE, JPO, and JNZ.
2. What is the purpose of the following commands in 8086?
a) AAD
b) RCL
3. List out the addressing modes in 8086.
4. List out the various string instructions that are available in 8086.
5. What are the 8086 instructions used for BCD arithmetic?
6. What flags get affected after executing ADD instruction?
7. Which instruction is used to add immediate data?
8. What is BCD code? Where it is used?
9. What is ASCII code? Where it is used?
10. What is the difference between carry flag and overflow flag?
11. What are the special function register associated with interrupts?
12. List the flags affected by arithmetic instructions.
13. After executing ADDC instruction, what flags get affected?
14. How many bytes the instruction ADDC will add?
15. Name the signals used by the processor to communicate with an I/O processor
16. What is the function of IP?
17. What is the use of base pointer register?
18. Mention the index registers of 8086.
19. How many memory locations are available in 8086 microprocessor?
20. What are the flags in 8086? What are the various interrupts in 8086?
Applications:
1. Programmable calculators
2. Counting system using counts the tennis ball
3. Detecting and Correcting an Error with the Hamming Code
4. Power tool
5. Radio clocks
Viva ? voce
22 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.3 MOVE A DATA BLOCK WITHOUT OVERLAP
Aim:
To write an assembly language program to move a block of data to another memory location and execute it
using 8086
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Algorithm:
1. Initialize the source and destination memory location to SI and DI register
2. Initialize the counter (CL register)
3. Move the data to designation memory through AL register
4. Decrement the count
5. Check for zero flag and if zero flag is set go to next step
6. else go to step 3
7. Stop
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
23 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


Program:
Address Label Mnemonics
1000 MOV CL, 08
1003 MOV SI, 1200
1007 MOV DI, 1300
100B L1 LOD SB
100C MOV [DI], AL
100E INC DI
100F DEC CL
1011 JNZ L1
1013 HLT

Tabulation:
Input Output
Address Data Address Data




Result:
Thus an Assembly Language Program for moving data to another location is written the program is
executed using 8086 and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts and write the ALP program for
moving data to another location.



24 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00



1. List out the Flag manipulation instruction.
2. Define ? Variables
3. Define ? Segment Override Prefix
4. How is the memory segment accessed by 8086 microprocessor identified?
5. List out the advantages of using Direct Memory Access (DMA).
6. What is BIOS function call in 8086? (May 2012)
7. List out the difference between procedures and Macros.
8. What is meant by maskable interrupts& non-maskable interrupts?
9. What is the Maximum clock frequency in 8086?
10. Which Stack is used in 8086?
11. Define ? Pipeline (Dec 2011)
12. How many address lines are available in 8086? What is the maximum address possible?
13. What is an assembler?( May 2012)
14. What is the purpose of LEA instruction in 8086? (May 2012)
15. Give the function of index and pointers in 8086.
16. What are the different instruction set of 8086?
17. Give the various addressing modes in 8086.
18. Give the differences between JUMP and LOOP instruction.
19. Give the physical address formation of any two addressing mode.
20. Give the use of ?ASSUME? in 8086 programming.
Applications:
1. Priority Encoder
2. DVD players
3. Cellular telephones
4. Household appliances
5. Car equipment
Viva ? voce
25 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.4 MATRIX OPERATIONS
Aim:
To write an assembly language program to perform matrix addition and to execute it using 8086
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Algorithm:
1. Get the size (count) of the matrix
2. Initialize SI pointer for storing first matrix
3. Initialize DI pointer for storing second matrix
4. Move the contents pointed by SI pointer to accumulator
5. Move the contents pointed by DI pointer BL register
6. Add the contents of accumulator and BL register
7. Store result in the address pointed by DI pointer
8. Increment DI and SI pointer by 1 and Decrement count by 1
9. Check for zero. If no zero jump to step 4 else go to step 11
10. Stop the execution
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result

26 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV CL, 09
1003 MOV SI, 1100
1007 MOV DI, 1200
100B L1 MOV AL, [SI]
100D MOV BL, [DI]
100F ADD AL, BL
1011 MOV [DI], AL
1013 INC SI
1014 INC DI
1015 DEC CL
1017 JNZ L1
1019 HLT

Tabulation:
Input Output
Address Data Address Data



Result:
Thus an assembly language program for matrix addition was written. It is executed using 8086
microprocessor and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts of moving and adding the group
of data from one location to another location.







27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


1. Write an ALP for 8086 to multiply two 16 bit unsigned numbers.
2. What is an accumulator?
3. List out the segment register available in 8086.
4. List out any four program control instructions that are available in 8086.
5. What is program counter?
6. Give any four logical instructions in 8086.
7. How many memory locations are available in 8086 microprocessor?
8. What are the general purposes registers in 8086?
9. What are the functional units in 8086?
10. How much memory location allotted for the particular segments registers in 8086?
11. When the 8086 processor is in minimum mode and maximum mode?
12. Define ? Segment Override Prefix.
13. Define ? Macro and Procedure
14. Define ? Assembler and assembler directives
15. Define ? Compiler and Linker
16. What is meant by modular programming?
17. Explain the uses of PUSH and POP instruction.
18. Explain the uses of CALL and RET instruction.
19. Identify the addressing modes in the following instructions.
AND AL, BL
SUB AL, 24H
MOV AL, (BP)
MOV CX, 1245H
20. What are the 8086 instructions used for BCD arithmetic?

Applications:
1. Toys
2. Light switches and dimmers
3. Electrical circuit breakers
4. Smoke alarms
5. Battery packs


Viva ? voce
28 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.5 SEARCHING AND SORTING A STRING IN A
GIVEN ARRAY
a) Searching a String in a Given Array:
Aim:
To write an assembly language program to search a string in the given array and to execute it using 8086
kit.
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Algorithm:
1. Initialize the source and destination memory in SI and DI register
2. Initialize the count (CL) and Load the string values to any register (DL)
3. Move string to AL register and Compare the register (DL and AL)
4. Check for zero flag and if it is set jump to step 7 else go to step 9
5. Store the value of AL register
6. Increment DI register by one, Increment SI register by one and Decrement CL register by one
7. Check for zero flag and if it is set jump to step 12 else go to step 4
8. Stop the execution
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Type the Assembly Language Program
6. Press ?RESET? key
To executive the program
7. Press ?GO?
8. Type the starting address to execute the program
9. Press ?RESET? key
To verify the result
29 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

10. Type ?SB(Substitute Byte)?
11. Enter the output address location to check the result
Program:
Address Label Mnemonics
1000 MOV DI, 1300
1004 MOV SI, 1200
1008 MOV CL, 06
100B MOV DL, 02
100E L1 MOV AL, [SI]
1010 CMP DL, AL
1012 JNZ L2
1014 MOV [DI], AL
1016 INC DI
1017 L2 INC SI
1018 DEC CL
101A JNZ L1
101C HLT

Tabulation:
Input Output
Address Data Address Data


Result:
Thus an assembly language program to search a string in the string in the given array is written. The
program is executed using 8086 and the output is verified.






30 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

b) Sorting an Array of Data Using 8086:
Aim:
To write an assembly language program to sort an array of data in ascending and descending order and
execute it using 8086 kit
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
1. Ascending Order:
Algorithm:
1. Set SI as pointer for array
2. Set CL as outer loop counter
3. Initialize array pointer
4. Set CH as inner loop counter
5. Increment array pointer
6. Get the first element of array
7. Increment array pointer and Compare the two elements
31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

8. Checks carry flag. If carry flag is set go to step 11 else go to step 10
9. Swap the content of the memory location
10. Decrement the inner loop counter
11. Check zero flag. If it is set go to step 13 else go to step 7
12. Decrement outer loop counter
13. Check zero flag. If it is set go to step 15 else go to step 3 and stop
Program:
Address Label Mnemonics
1000 MOV SI, 1100H
1004 MOV CL, [SI]
1006 DEC CL
008 Repeat MOV SI, 1100H
100C MOV CH, [SI]
100E DEC CH
1010 INC SI
1011 Rep MOV AL, [SI]
1013 INC SI
1014 CMP AL, [SI]
1016 JC Ahead
1018 XCHG AL, [SI]
101A XCHG AL, [SI-1]
101D Ahead DEC CH
101F JNZ Rep
1021 DEC CL
1023 JNZ Repeat
1025 HLT
Tabulation:
Input Output
Address Data Address Data



FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING


EC6513 ? MICROPROCESSOR AND MICROCONTROLLERLABORATORY


V SEMESTER - R 2013










Name : _______________________________________
Register No. : _______________________________________
Section : _______________________________________



LABORATORY MANUAL
2 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY


C01 - To learn the working of ARM processor
C02 - To introduce ALP concepts and features
C03 - To write ALP for arithmetic and logical operations in 8086 and 8051
C04 - To differentiate Serial and Parallel Interface
C05 - To interface different I/Os with Microprocessors
C06 - To be familiar with MASM
.




1. Write programs in ARM for a specific Application
2. Write ALP Programs for fixed and Floating Point and Arithmetic
3. Interface different I/Os with processor and Generate waveforms using Microprocessors
4. Execute Programs in 8051
5. Assess the performance of optical devices: light sources, fibers and detectors from both physical and system
point of view

INTRODUCTION
This course illustrates the concepts covered in course CS6412 and provides students with hands-on
experience in Assembly language programs.
PREREQUISITE:
1. Digital Electronics
EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
Lecture
No./Session No.
Name of the Experiment
Course
objectives
Proposed
date

1,2,3
Introduction to lab
CO1

CYCLE I - 8086 PROGRAMS USING KITS AND MASM
4,5,6 Basic arithmetic and Logical operations CO2
COURSE OBJECTIVES
COURSE OUTCOMES
3 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00













7,8,9 Decimal arithmetic and Code conversion CO3
10,11,12
Move a data block without overlap
CO3
Matrix operations
13,14,15 Searching and Sorting a sting in a given array CO2
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
16,17,18 D/A interface and Waveform Generation CO4
19,20,21 A/D interface CO5
22,23,24 Key board and Display CO5
25,26,27
Stepper motor control CO2
Traffic light control CO5
28,29,30
Digital clock CO6
Serial interface and Parallel interface CO4
CYCLE III - 8051 PROGRAMS USING KITS AND MASM
31,32,33 Basic arithmetic and Logical operations CO1
34,35,36
Square and Cube program, Find 2?s complement of a number
CO5
Unpacked BCD to ASCII
37,38,39
Password checking and Print RAM size with system date
CO6
Counters and Time Delay
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
40,41,42 Sorting of an array using 8051 CO2
43,44,45
Separate odd and even numbers using 8086


CO3
Sum of N consecutive numbers using 8086
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00




College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING




To impart professional education integrated with human values to the younger generation, so as to shape
them as proficient and dedicated engineers, capable of providing comprehensive solutions to the challenges in
deploying technology for the service of humanity



? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices


VISION
MISSION
VISION
MISSION
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of
engineering that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this
enables to find solutions for real time problem in industry and organization and to design products
requiring interdisciplinary skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up
their communication skills, individual leadership and supportive qualities and to develop them to adapt and
work in ever changing technologies
5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees











6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer
Science and Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the
career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both
verbal and written forms
i) To work in a team as team member or a leader and make unique contributions and work with
coordination
j) To engage lifelong learning and exhibit their technical skills
k) To develop and manage projects in multidisciplinary environments










7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER
LABORATORY
SYLLABUS

? To learn the working of ARM processor
? To introduce ALP concepts and features
? To write ALP for arithmetic and logical operations in 8086 and 8051
? To differentiate Serial and Parallel Interface
? To interface different I/Os with Microprocessors
? To be familiar with MASM
LIST OF EXPERIMENTS:
8086 Programs using kits and MASM
1. Basic arithmetic and Logical operations
2. Move a data block without overlap
3. Code conversion, decimal arithmetic and Matrix operations.
4. Floating point operations, string manipulations, sorting and searching
5. Password checking, Print RAM size and system date
6. Counters and Time Delay
Peripherals and Interfacing Experiments
7. Traffic light control
8. Stepper motor control
9. Digital clock
10. Key board and Display
11. Printer status
12. Serial interface and Parallel interface
13. A/D and D/A interface and Waveform Generation 8051
Experiments using kits and MASM
14. Basic arithmetic and Logical operations
15. Square and Cube program, Find 2 ?s complement of a number
16. Unpacked BCD to ASCII

? Write programs in ARM for a specific Application
? Write ALP Programs for fixed and Floating Point and Arithmetic
? Interface different I/Os with processor and Generate waveforms using Microprocessors
? Execute Programs in 8051
? Assess the performance of optical devices: light sources, fibers and detectors from both physical and
system point of view


COURSE OUTCOMES
COURSE OBJECTIVES
8 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 - 8086 PROGRAMS USING KITS AND MASM
1 Basic arithmetic and Logical operations 10
2 Decimal arithmetic and Code conversion 15
3 Move a data block without overlap 21
4 Matrix operations 24
5 Searching and Sorting a sting in a given array 27
6 Password checking and Print RAM size with system date 33
7 Counters and Time Delay 36
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
8 Stepper motor control 39
9 Traffic light control 42
10 Digital clock 47
11 Serial interface and Parallel interface 50
12 A/D interface 54
13 Key board and Display 57
14 D/A interface and Waveform Generation 60
CYCLE 3 - 8051 PROGRAMS USING KITS AND MASM
15 Basic arithmetic and Logical operations 64
16 Square and Cube program, Find 2?s complement of a number 69
17 Unpacked BCD to ASCII 71
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
18 Sorting of an array using 8051 74
19 Separate odd and even numbers using 8086 77
20 Sum of N consecutive numbers using 8086 80

9 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.1 BASIC ARITHMETIC AND LOGICAL OPERATIONS

Aim:
To write an Assembly Language Program to perform Arithmetic operation and to execute using 8086
microprocessor
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
Arithmetic Operation:
1. Addition:
Algorithm:
1. Clear BL register to store carry
2. Get the addend in AX register pair
3. Get the Augend in CX register pair
4. Add Augend and addend
5. Check for carry, If it is one go to step 6 else go to step 7
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

6. Increments carry (BL register by 1)
7. Store the sum in memory from AX register pair
8. Store the carry in memory from BL register
9. Stop
Program:
Address
Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 1010H
1007 MOV CX, 2020H
100B CLC
100C ADD AX, CX
100E JNC Label1
1010 INC BL
1012 Label 1 MOV [1200], AX
1016 MOV [1202], BL
101A HLT
Precaution:
Make sure that all the machine codes should be as per the specified in the program.
Tabulation:
Input Output
Address Data Address Data








2. Subtraction:
Algorithm:
1. Clear BL register for storing borrow
2. Get the minuend in AX register pair
3. Get the subtrahend in CX register pair
4. Subtract minuend and subtrahend
5. Check borrow, if borrow is one go to step 6 else go to step 8
6. Increment borrow (BL register by 1)
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

7. Negate AX register
8. Store the difference from AX in memory
9. Story the borrow from BL in memory
10. Stop
Program:
Address Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 2024H
1007 MOV CX, 1010H
100B SUB AX, CX
100D JNC Label1
100F INC BL
1011 NEG AX
1013 Label 1 MOV [1200], AX
1017 MOV [1202], BL
101B HLT

Tabulation:
Input Output
Address Data Address Data






3. Multiplication
Algorithm:
1. Clear DX register
2. Load the AX register pair with multiplicand
3. Load the CX register pair with multiplier
4. Multiply multiplicand and multiplier
5. Store the higher byte of product(from DX register pair) in memory specified
6. Store the lower byte of product(from AX register pair) in memory specified
7. Stop
8.
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV DX, 0000H
1004 MOV AX, 00FFH
1008 MOV CX, 0002H
100C MUL CX
100E MOV [1200], AX
1012 MOV [1202], DX
1016 HLT
Tabulation:
Input Output
Address Data Address Data






4. Division:
Algorithm
1. Clear DX register
2. Load the AX register pair with dividend
3. Load the CX register pair with divisor
4. Dividend divided by divisor
5. Store the quotient (from AX register pair) in memory specified
6. Store the remainder (from DX register pair) in memory specified
7. Stop
Program:
Address Label Mnemonics
1000 MOV DX, 0000H
1004 MOV AX, 0008H
1008 MOV CX, 0004H
100C DIV CX
100E MOV [1200], AX
1012 MOV [1202], DX
1016 HLT

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


Result:
Thus Assembly language program are written to perform arithmetic operation using 8086 microprocessor.
They are executed using 8086 processor and the outputs are verified.
Outcome:
At the end of this experiment the students able to write ALP programs for Arithmetic and Logical operations.

1. Write the size of the data bus of 8086.
2. Write the size of the address bus of 8086.
3. What is meant by physical addressing in 8086?
4. What is meant by an Opcode?
5. What is meant by an Operand?
6. What is meant by a Mnemonics?
7. What are the other possibilities of writing ADD, SUB and MUL instructions in other addressing modes?
8. What is the difference between microprocessor and microcontroller?
9. What is meant by LATCH?
10. What is the difference between primary & secondary storage device?
11. What is the difference between static and dynamic RAM?
12. What is an interrupt?
13. Differentiate between RAM and ROM?
14. Define ? Compiler
15. Define ? Flag
16. Define ? Stack
17. How clock signal is generated in 8086 microprocessor?
18. State the functions of queue status line QS0 and QS1 in 8086 microprocessor.
19. What is the purpose of BIU& EU?
20. List out the two examples of assembler directives.

Viva ? voce
15 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Applications:
1. barrel shifters
2. Multiple-precision arithmetic
3. Calculation pipeline
4. binary multipliers
5. Calculation in a single clock

16 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.2 DECIMAL ARITHMETIC AND CODE CONVERSION
Aim:
To write an Assembly Language Program to perform Code conversion and Decimal Arithmetic operations
and to execute using 8086 microprocessor
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
Decimal Arithmetic:
1. Using DAA
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Clear the CL reg.
4. Add the contents of AL and BL.
5. Adjust decimal accumulator after addition.
6. Store the result.
17 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 MOV CL, 00
100B ADD AL,BL
100D DAA
100E JNC L1
1010 INC CL
1012 L1 MOV [1150], AL
1016 MOV [1151], CL
101A HLT

Tabulation:
Input Output
Address Data Address Data


2. Using AAM
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Multiply the contents of AL and BL.
4. Adjust decimal accumulator after multiplication.
5. Store the result.
Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 MUL BL
100A AAM
100C MOV [1150], AH
1010 MOV [1151], AL
1014 HLT

18 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


3. Using DAS
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Subtract the contents of BL from AL.
4. Adjust decimal accumulator after subtraction.
5. Store the result.
Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 SUB AL,BL
100A DAS
100B MOV [1150], AL
100F HLT
Tabulation:
Input Output
Address Data Address Data


Code Conversion:
1. Binary to BCD
Algorithm:
1. Get the input and store in AL.
2. Clear the carry flag.
3. Rotate right the bits of input.
4. Find logical XOR between input and shifted input.
5. Store the result.
19 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 XOR AX,AX
1002 XOR CX,CX
1004 MOV BX,000B
1008 L2 CMP BX,00
100C JZ L1
100E DEC BX
100F MOV AL,CL
1011 ADD AL,01
1014 DAA
1015 MOV CL,AL
1017 MOV AL,CH
1019 ADC AL,00
101C DAA
101D MOV CH,AL
101F JMP L2
1022 MOV [1150],CX
1026 HLT
Tabulation:
Input Output
Address Data Address Data




2. Binary to Gray
Algorithm:
1. Get the input and store in AL.
2. Clear the carry flag.
3. Rotate right the bits of input.
4. Find logical XOR between input and shifted input.
5. Store the result.

20 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, AL
1006 CLC
1007 MOV CL,01
100A RCR AL,CL
100C XOR BL,AL
100E MOV [1150],BL
1012 HLT
Tabulation:
Input Output
Address Data Address Data


Result:
Thus an Assembly Language Program for code conversion and decimal arithmetic operations is written. The
program is executed using 8086 and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts of code conversions and
decimal arithmetic operations.








21 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


1. Write the function of the following 8085 instructions: JP, JPE, JPO, and JNZ.
2. What is the purpose of the following commands in 8086?
a) AAD
b) RCL
3. List out the addressing modes in 8086.
4. List out the various string instructions that are available in 8086.
5. What are the 8086 instructions used for BCD arithmetic?
6. What flags get affected after executing ADD instruction?
7. Which instruction is used to add immediate data?
8. What is BCD code? Where it is used?
9. What is ASCII code? Where it is used?
10. What is the difference between carry flag and overflow flag?
11. What are the special function register associated with interrupts?
12. List the flags affected by arithmetic instructions.
13. After executing ADDC instruction, what flags get affected?
14. How many bytes the instruction ADDC will add?
15. Name the signals used by the processor to communicate with an I/O processor
16. What is the function of IP?
17. What is the use of base pointer register?
18. Mention the index registers of 8086.
19. How many memory locations are available in 8086 microprocessor?
20. What are the flags in 8086? What are the various interrupts in 8086?
Applications:
1. Programmable calculators
2. Counting system using counts the tennis ball
3. Detecting and Correcting an Error with the Hamming Code
4. Power tool
5. Radio clocks
Viva ? voce
22 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.3 MOVE A DATA BLOCK WITHOUT OVERLAP
Aim:
To write an assembly language program to move a block of data to another memory location and execute it
using 8086
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Algorithm:
1. Initialize the source and destination memory location to SI and DI register
2. Initialize the counter (CL register)
3. Move the data to designation memory through AL register
4. Decrement the count
5. Check for zero flag and if zero flag is set go to next step
6. else go to step 3
7. Stop
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
23 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


Program:
Address Label Mnemonics
1000 MOV CL, 08
1003 MOV SI, 1200
1007 MOV DI, 1300
100B L1 LOD SB
100C MOV [DI], AL
100E INC DI
100F DEC CL
1011 JNZ L1
1013 HLT

Tabulation:
Input Output
Address Data Address Data




Result:
Thus an Assembly Language Program for moving data to another location is written the program is
executed using 8086 and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts and write the ALP program for
moving data to another location.



24 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00



1. List out the Flag manipulation instruction.
2. Define ? Variables
3. Define ? Segment Override Prefix
4. How is the memory segment accessed by 8086 microprocessor identified?
5. List out the advantages of using Direct Memory Access (DMA).
6. What is BIOS function call in 8086? (May 2012)
7. List out the difference between procedures and Macros.
8. What is meant by maskable interrupts& non-maskable interrupts?
9. What is the Maximum clock frequency in 8086?
10. Which Stack is used in 8086?
11. Define ? Pipeline (Dec 2011)
12. How many address lines are available in 8086? What is the maximum address possible?
13. What is an assembler?( May 2012)
14. What is the purpose of LEA instruction in 8086? (May 2012)
15. Give the function of index and pointers in 8086.
16. What are the different instruction set of 8086?
17. Give the various addressing modes in 8086.
18. Give the differences between JUMP and LOOP instruction.
19. Give the physical address formation of any two addressing mode.
20. Give the use of ?ASSUME? in 8086 programming.
Applications:
1. Priority Encoder
2. DVD players
3. Cellular telephones
4. Household appliances
5. Car equipment
Viva ? voce
25 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.4 MATRIX OPERATIONS
Aim:
To write an assembly language program to perform matrix addition and to execute it using 8086
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Algorithm:
1. Get the size (count) of the matrix
2. Initialize SI pointer for storing first matrix
3. Initialize DI pointer for storing second matrix
4. Move the contents pointed by SI pointer to accumulator
5. Move the contents pointed by DI pointer BL register
6. Add the contents of accumulator and BL register
7. Store result in the address pointed by DI pointer
8. Increment DI and SI pointer by 1 and Decrement count by 1
9. Check for zero. If no zero jump to step 4 else go to step 11
10. Stop the execution
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result

26 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV CL, 09
1003 MOV SI, 1100
1007 MOV DI, 1200
100B L1 MOV AL, [SI]
100D MOV BL, [DI]
100F ADD AL, BL
1011 MOV [DI], AL
1013 INC SI
1014 INC DI
1015 DEC CL
1017 JNZ L1
1019 HLT

Tabulation:
Input Output
Address Data Address Data



Result:
Thus an assembly language program for matrix addition was written. It is executed using 8086
microprocessor and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts of moving and adding the group
of data from one location to another location.







27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


1. Write an ALP for 8086 to multiply two 16 bit unsigned numbers.
2. What is an accumulator?
3. List out the segment register available in 8086.
4. List out any four program control instructions that are available in 8086.
5. What is program counter?
6. Give any four logical instructions in 8086.
7. How many memory locations are available in 8086 microprocessor?
8. What are the general purposes registers in 8086?
9. What are the functional units in 8086?
10. How much memory location allotted for the particular segments registers in 8086?
11. When the 8086 processor is in minimum mode and maximum mode?
12. Define ? Segment Override Prefix.
13. Define ? Macro and Procedure
14. Define ? Assembler and assembler directives
15. Define ? Compiler and Linker
16. What is meant by modular programming?
17. Explain the uses of PUSH and POP instruction.
18. Explain the uses of CALL and RET instruction.
19. Identify the addressing modes in the following instructions.
AND AL, BL
SUB AL, 24H
MOV AL, (BP)
MOV CX, 1245H
20. What are the 8086 instructions used for BCD arithmetic?

Applications:
1. Toys
2. Light switches and dimmers
3. Electrical circuit breakers
4. Smoke alarms
5. Battery packs


Viva ? voce
28 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.5 SEARCHING AND SORTING A STRING IN A
GIVEN ARRAY
a) Searching a String in a Given Array:
Aim:
To write an assembly language program to search a string in the given array and to execute it using 8086
kit.
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Algorithm:
1. Initialize the source and destination memory in SI and DI register
2. Initialize the count (CL) and Load the string values to any register (DL)
3. Move string to AL register and Compare the register (DL and AL)
4. Check for zero flag and if it is set jump to step 7 else go to step 9
5. Store the value of AL register
6. Increment DI register by one, Increment SI register by one and Decrement CL register by one
7. Check for zero flag and if it is set jump to step 12 else go to step 4
8. Stop the execution
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Type the Assembly Language Program
6. Press ?RESET? key
To executive the program
7. Press ?GO?
8. Type the starting address to execute the program
9. Press ?RESET? key
To verify the result
29 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

10. Type ?SB(Substitute Byte)?
11. Enter the output address location to check the result
Program:
Address Label Mnemonics
1000 MOV DI, 1300
1004 MOV SI, 1200
1008 MOV CL, 06
100B MOV DL, 02
100E L1 MOV AL, [SI]
1010 CMP DL, AL
1012 JNZ L2
1014 MOV [DI], AL
1016 INC DI
1017 L2 INC SI
1018 DEC CL
101A JNZ L1
101C HLT

Tabulation:
Input Output
Address Data Address Data


Result:
Thus an assembly language program to search a string in the string in the given array is written. The
program is executed using 8086 and the output is verified.






30 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

b) Sorting an Array of Data Using 8086:
Aim:
To write an assembly language program to sort an array of data in ascending and descending order and
execute it using 8086 kit
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
1. Ascending Order:
Algorithm:
1. Set SI as pointer for array
2. Set CL as outer loop counter
3. Initialize array pointer
4. Set CH as inner loop counter
5. Increment array pointer
6. Get the first element of array
7. Increment array pointer and Compare the two elements
31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

8. Checks carry flag. If carry flag is set go to step 11 else go to step 10
9. Swap the content of the memory location
10. Decrement the inner loop counter
11. Check zero flag. If it is set go to step 13 else go to step 7
12. Decrement outer loop counter
13. Check zero flag. If it is set go to step 15 else go to step 3 and stop
Program:
Address Label Mnemonics
1000 MOV SI, 1100H
1004 MOV CL, [SI]
1006 DEC CL
008 Repeat MOV SI, 1100H
100C MOV CH, [SI]
100E DEC CH
1010 INC SI
1011 Rep MOV AL, [SI]
1013 INC SI
1014 CMP AL, [SI]
1016 JC Ahead
1018 XCHG AL, [SI]
101A XCHG AL, [SI-1]
101D Ahead DEC CH
101F JNZ Rep
1021 DEC CL
1023 JNZ Repeat
1025 HLT
Tabulation:
Input Output
Address Data Address Data



32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

2. Descending Order:
Algorithm:
1. Set SI as pointer for array
2. Set CL as outer loop counter
3. Initialize array pointer
4. Set CH as inner loop counter
5. Increment array pointer Get the first element of array
6. Increment array pointer
7. Compare the two elements
8. Checks carry flag. If carry flag is set go to step 11 else go to step 10
9. Swap the content of the memory location
10. Decrement the inner loop counter
11. Check zero flag. If it is set go to step 13 else go to step 7
12. Decrement outer loop counter
13. Check zero flag. If it is set go to step 15 else go to step 3
14. Stop
Program:
Address Label Mnemonics
1000 MOV SI, 1100H
1004 MOV CL, [SI]
1006 DEC CL
1008 Repeat MOV SI, 1100H
100C MOV CH, [SI]
100E DEC CH
1010 INC SI
1011 Rep MOV AL, [SI]
1013 INC SI
1014 CMP AL, [SI]
1016 JNC Ahead
1018 XCHG AL, [SI]
101A XCHG AL, [SI-1]
101D Ahead DEC CH
101F JNZ Rep
1021 DEC CL
1023 JNZ Repeat
1025 HLT

FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING


EC6513 ? MICROPROCESSOR AND MICROCONTROLLERLABORATORY


V SEMESTER - R 2013










Name : _______________________________________
Register No. : _______________________________________
Section : _______________________________________



LABORATORY MANUAL
2 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY


C01 - To learn the working of ARM processor
C02 - To introduce ALP concepts and features
C03 - To write ALP for arithmetic and logical operations in 8086 and 8051
C04 - To differentiate Serial and Parallel Interface
C05 - To interface different I/Os with Microprocessors
C06 - To be familiar with MASM
.




1. Write programs in ARM for a specific Application
2. Write ALP Programs for fixed and Floating Point and Arithmetic
3. Interface different I/Os with processor and Generate waveforms using Microprocessors
4. Execute Programs in 8051
5. Assess the performance of optical devices: light sources, fibers and detectors from both physical and system
point of view

INTRODUCTION
This course illustrates the concepts covered in course CS6412 and provides students with hands-on
experience in Assembly language programs.
PREREQUISITE:
1. Digital Electronics
EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
Lecture
No./Session No.
Name of the Experiment
Course
objectives
Proposed
date

1,2,3
Introduction to lab
CO1

CYCLE I - 8086 PROGRAMS USING KITS AND MASM
4,5,6 Basic arithmetic and Logical operations CO2
COURSE OBJECTIVES
COURSE OUTCOMES
3 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00













7,8,9 Decimal arithmetic and Code conversion CO3
10,11,12
Move a data block without overlap
CO3
Matrix operations
13,14,15 Searching and Sorting a sting in a given array CO2
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
16,17,18 D/A interface and Waveform Generation CO4
19,20,21 A/D interface CO5
22,23,24 Key board and Display CO5
25,26,27
Stepper motor control CO2
Traffic light control CO5
28,29,30
Digital clock CO6
Serial interface and Parallel interface CO4
CYCLE III - 8051 PROGRAMS USING KITS AND MASM
31,32,33 Basic arithmetic and Logical operations CO1
34,35,36
Square and Cube program, Find 2?s complement of a number
CO5
Unpacked BCD to ASCII
37,38,39
Password checking and Print RAM size with system date
CO6
Counters and Time Delay
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
40,41,42 Sorting of an array using 8051 CO2
43,44,45
Separate odd and even numbers using 8086


CO3
Sum of N consecutive numbers using 8086
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00




College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING




To impart professional education integrated with human values to the younger generation, so as to shape
them as proficient and dedicated engineers, capable of providing comprehensive solutions to the challenges in
deploying technology for the service of humanity



? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices


VISION
MISSION
VISION
MISSION
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of
engineering that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this
enables to find solutions for real time problem in industry and organization and to design products
requiring interdisciplinary skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up
their communication skills, individual leadership and supportive qualities and to develop them to adapt and
work in ever changing technologies
5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees











6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer
Science and Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the
career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both
verbal and written forms
i) To work in a team as team member or a leader and make unique contributions and work with
coordination
j) To engage lifelong learning and exhibit their technical skills
k) To develop and manage projects in multidisciplinary environments










7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER
LABORATORY
SYLLABUS

? To learn the working of ARM processor
? To introduce ALP concepts and features
? To write ALP for arithmetic and logical operations in 8086 and 8051
? To differentiate Serial and Parallel Interface
? To interface different I/Os with Microprocessors
? To be familiar with MASM
LIST OF EXPERIMENTS:
8086 Programs using kits and MASM
1. Basic arithmetic and Logical operations
2. Move a data block without overlap
3. Code conversion, decimal arithmetic and Matrix operations.
4. Floating point operations, string manipulations, sorting and searching
5. Password checking, Print RAM size and system date
6. Counters and Time Delay
Peripherals and Interfacing Experiments
7. Traffic light control
8. Stepper motor control
9. Digital clock
10. Key board and Display
11. Printer status
12. Serial interface and Parallel interface
13. A/D and D/A interface and Waveform Generation 8051
Experiments using kits and MASM
14. Basic arithmetic and Logical operations
15. Square and Cube program, Find 2 ?s complement of a number
16. Unpacked BCD to ASCII

? Write programs in ARM for a specific Application
? Write ALP Programs for fixed and Floating Point and Arithmetic
? Interface different I/Os with processor and Generate waveforms using Microprocessors
? Execute Programs in 8051
? Assess the performance of optical devices: light sources, fibers and detectors from both physical and
system point of view


COURSE OUTCOMES
COURSE OBJECTIVES
8 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 - 8086 PROGRAMS USING KITS AND MASM
1 Basic arithmetic and Logical operations 10
2 Decimal arithmetic and Code conversion 15
3 Move a data block without overlap 21
4 Matrix operations 24
5 Searching and Sorting a sting in a given array 27
6 Password checking and Print RAM size with system date 33
7 Counters and Time Delay 36
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
8 Stepper motor control 39
9 Traffic light control 42
10 Digital clock 47
11 Serial interface and Parallel interface 50
12 A/D interface 54
13 Key board and Display 57
14 D/A interface and Waveform Generation 60
CYCLE 3 - 8051 PROGRAMS USING KITS AND MASM
15 Basic arithmetic and Logical operations 64
16 Square and Cube program, Find 2?s complement of a number 69
17 Unpacked BCD to ASCII 71
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
18 Sorting of an array using 8051 74
19 Separate odd and even numbers using 8086 77
20 Sum of N consecutive numbers using 8086 80

9 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.1 BASIC ARITHMETIC AND LOGICAL OPERATIONS

Aim:
To write an Assembly Language Program to perform Arithmetic operation and to execute using 8086
microprocessor
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
Arithmetic Operation:
1. Addition:
Algorithm:
1. Clear BL register to store carry
2. Get the addend in AX register pair
3. Get the Augend in CX register pair
4. Add Augend and addend
5. Check for carry, If it is one go to step 6 else go to step 7
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

6. Increments carry (BL register by 1)
7. Store the sum in memory from AX register pair
8. Store the carry in memory from BL register
9. Stop
Program:
Address
Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 1010H
1007 MOV CX, 2020H
100B CLC
100C ADD AX, CX
100E JNC Label1
1010 INC BL
1012 Label 1 MOV [1200], AX
1016 MOV [1202], BL
101A HLT
Precaution:
Make sure that all the machine codes should be as per the specified in the program.
Tabulation:
Input Output
Address Data Address Data








2. Subtraction:
Algorithm:
1. Clear BL register for storing borrow
2. Get the minuend in AX register pair
3. Get the subtrahend in CX register pair
4. Subtract minuend and subtrahend
5. Check borrow, if borrow is one go to step 6 else go to step 8
6. Increment borrow (BL register by 1)
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

7. Negate AX register
8. Store the difference from AX in memory
9. Story the borrow from BL in memory
10. Stop
Program:
Address Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 2024H
1007 MOV CX, 1010H
100B SUB AX, CX
100D JNC Label1
100F INC BL
1011 NEG AX
1013 Label 1 MOV [1200], AX
1017 MOV [1202], BL
101B HLT

Tabulation:
Input Output
Address Data Address Data






3. Multiplication
Algorithm:
1. Clear DX register
2. Load the AX register pair with multiplicand
3. Load the CX register pair with multiplier
4. Multiply multiplicand and multiplier
5. Store the higher byte of product(from DX register pair) in memory specified
6. Store the lower byte of product(from AX register pair) in memory specified
7. Stop
8.
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV DX, 0000H
1004 MOV AX, 00FFH
1008 MOV CX, 0002H
100C MUL CX
100E MOV [1200], AX
1012 MOV [1202], DX
1016 HLT
Tabulation:
Input Output
Address Data Address Data






4. Division:
Algorithm
1. Clear DX register
2. Load the AX register pair with dividend
3. Load the CX register pair with divisor
4. Dividend divided by divisor
5. Store the quotient (from AX register pair) in memory specified
6. Store the remainder (from DX register pair) in memory specified
7. Stop
Program:
Address Label Mnemonics
1000 MOV DX, 0000H
1004 MOV AX, 0008H
1008 MOV CX, 0004H
100C DIV CX
100E MOV [1200], AX
1012 MOV [1202], DX
1016 HLT

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


Result:
Thus Assembly language program are written to perform arithmetic operation using 8086 microprocessor.
They are executed using 8086 processor and the outputs are verified.
Outcome:
At the end of this experiment the students able to write ALP programs for Arithmetic and Logical operations.

1. Write the size of the data bus of 8086.
2. Write the size of the address bus of 8086.
3. What is meant by physical addressing in 8086?
4. What is meant by an Opcode?
5. What is meant by an Operand?
6. What is meant by a Mnemonics?
7. What are the other possibilities of writing ADD, SUB and MUL instructions in other addressing modes?
8. What is the difference between microprocessor and microcontroller?
9. What is meant by LATCH?
10. What is the difference between primary & secondary storage device?
11. What is the difference between static and dynamic RAM?
12. What is an interrupt?
13. Differentiate between RAM and ROM?
14. Define ? Compiler
15. Define ? Flag
16. Define ? Stack
17. How clock signal is generated in 8086 microprocessor?
18. State the functions of queue status line QS0 and QS1 in 8086 microprocessor.
19. What is the purpose of BIU& EU?
20. List out the two examples of assembler directives.

Viva ? voce
15 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Applications:
1. barrel shifters
2. Multiple-precision arithmetic
3. Calculation pipeline
4. binary multipliers
5. Calculation in a single clock

16 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.2 DECIMAL ARITHMETIC AND CODE CONVERSION
Aim:
To write an Assembly Language Program to perform Code conversion and Decimal Arithmetic operations
and to execute using 8086 microprocessor
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
Decimal Arithmetic:
1. Using DAA
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Clear the CL reg.
4. Add the contents of AL and BL.
5. Adjust decimal accumulator after addition.
6. Store the result.
17 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 MOV CL, 00
100B ADD AL,BL
100D DAA
100E JNC L1
1010 INC CL
1012 L1 MOV [1150], AL
1016 MOV [1151], CL
101A HLT

Tabulation:
Input Output
Address Data Address Data


2. Using AAM
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Multiply the contents of AL and BL.
4. Adjust decimal accumulator after multiplication.
5. Store the result.
Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 MUL BL
100A AAM
100C MOV [1150], AH
1010 MOV [1151], AL
1014 HLT

18 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


3. Using DAS
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Subtract the contents of BL from AL.
4. Adjust decimal accumulator after subtraction.
5. Store the result.
Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 SUB AL,BL
100A DAS
100B MOV [1150], AL
100F HLT
Tabulation:
Input Output
Address Data Address Data


Code Conversion:
1. Binary to BCD
Algorithm:
1. Get the input and store in AL.
2. Clear the carry flag.
3. Rotate right the bits of input.
4. Find logical XOR between input and shifted input.
5. Store the result.
19 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 XOR AX,AX
1002 XOR CX,CX
1004 MOV BX,000B
1008 L2 CMP BX,00
100C JZ L1
100E DEC BX
100F MOV AL,CL
1011 ADD AL,01
1014 DAA
1015 MOV CL,AL
1017 MOV AL,CH
1019 ADC AL,00
101C DAA
101D MOV CH,AL
101F JMP L2
1022 MOV [1150],CX
1026 HLT
Tabulation:
Input Output
Address Data Address Data




2. Binary to Gray
Algorithm:
1. Get the input and store in AL.
2. Clear the carry flag.
3. Rotate right the bits of input.
4. Find logical XOR between input and shifted input.
5. Store the result.

20 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, AL
1006 CLC
1007 MOV CL,01
100A RCR AL,CL
100C XOR BL,AL
100E MOV [1150],BL
1012 HLT
Tabulation:
Input Output
Address Data Address Data


Result:
Thus an Assembly Language Program for code conversion and decimal arithmetic operations is written. The
program is executed using 8086 and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts of code conversions and
decimal arithmetic operations.








21 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


1. Write the function of the following 8085 instructions: JP, JPE, JPO, and JNZ.
2. What is the purpose of the following commands in 8086?
a) AAD
b) RCL
3. List out the addressing modes in 8086.
4. List out the various string instructions that are available in 8086.
5. What are the 8086 instructions used for BCD arithmetic?
6. What flags get affected after executing ADD instruction?
7. Which instruction is used to add immediate data?
8. What is BCD code? Where it is used?
9. What is ASCII code? Where it is used?
10. What is the difference between carry flag and overflow flag?
11. What are the special function register associated with interrupts?
12. List the flags affected by arithmetic instructions.
13. After executing ADDC instruction, what flags get affected?
14. How many bytes the instruction ADDC will add?
15. Name the signals used by the processor to communicate with an I/O processor
16. What is the function of IP?
17. What is the use of base pointer register?
18. Mention the index registers of 8086.
19. How many memory locations are available in 8086 microprocessor?
20. What are the flags in 8086? What are the various interrupts in 8086?
Applications:
1. Programmable calculators
2. Counting system using counts the tennis ball
3. Detecting and Correcting an Error with the Hamming Code
4. Power tool
5. Radio clocks
Viva ? voce
22 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.3 MOVE A DATA BLOCK WITHOUT OVERLAP
Aim:
To write an assembly language program to move a block of data to another memory location and execute it
using 8086
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Algorithm:
1. Initialize the source and destination memory location to SI and DI register
2. Initialize the counter (CL register)
3. Move the data to designation memory through AL register
4. Decrement the count
5. Check for zero flag and if zero flag is set go to next step
6. else go to step 3
7. Stop
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
23 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


Program:
Address Label Mnemonics
1000 MOV CL, 08
1003 MOV SI, 1200
1007 MOV DI, 1300
100B L1 LOD SB
100C MOV [DI], AL
100E INC DI
100F DEC CL
1011 JNZ L1
1013 HLT

Tabulation:
Input Output
Address Data Address Data




Result:
Thus an Assembly Language Program for moving data to another location is written the program is
executed using 8086 and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts and write the ALP program for
moving data to another location.



24 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00



1. List out the Flag manipulation instruction.
2. Define ? Variables
3. Define ? Segment Override Prefix
4. How is the memory segment accessed by 8086 microprocessor identified?
5. List out the advantages of using Direct Memory Access (DMA).
6. What is BIOS function call in 8086? (May 2012)
7. List out the difference between procedures and Macros.
8. What is meant by maskable interrupts& non-maskable interrupts?
9. What is the Maximum clock frequency in 8086?
10. Which Stack is used in 8086?
11. Define ? Pipeline (Dec 2011)
12. How many address lines are available in 8086? What is the maximum address possible?
13. What is an assembler?( May 2012)
14. What is the purpose of LEA instruction in 8086? (May 2012)
15. Give the function of index and pointers in 8086.
16. What are the different instruction set of 8086?
17. Give the various addressing modes in 8086.
18. Give the differences between JUMP and LOOP instruction.
19. Give the physical address formation of any two addressing mode.
20. Give the use of ?ASSUME? in 8086 programming.
Applications:
1. Priority Encoder
2. DVD players
3. Cellular telephones
4. Household appliances
5. Car equipment
Viva ? voce
25 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.4 MATRIX OPERATIONS
Aim:
To write an assembly language program to perform matrix addition and to execute it using 8086
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Algorithm:
1. Get the size (count) of the matrix
2. Initialize SI pointer for storing first matrix
3. Initialize DI pointer for storing second matrix
4. Move the contents pointed by SI pointer to accumulator
5. Move the contents pointed by DI pointer BL register
6. Add the contents of accumulator and BL register
7. Store result in the address pointed by DI pointer
8. Increment DI and SI pointer by 1 and Decrement count by 1
9. Check for zero. If no zero jump to step 4 else go to step 11
10. Stop the execution
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result

26 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV CL, 09
1003 MOV SI, 1100
1007 MOV DI, 1200
100B L1 MOV AL, [SI]
100D MOV BL, [DI]
100F ADD AL, BL
1011 MOV [DI], AL
1013 INC SI
1014 INC DI
1015 DEC CL
1017 JNZ L1
1019 HLT

Tabulation:
Input Output
Address Data Address Data



Result:
Thus an assembly language program for matrix addition was written. It is executed using 8086
microprocessor and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts of moving and adding the group
of data from one location to another location.







27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


1. Write an ALP for 8086 to multiply two 16 bit unsigned numbers.
2. What is an accumulator?
3. List out the segment register available in 8086.
4. List out any four program control instructions that are available in 8086.
5. What is program counter?
6. Give any four logical instructions in 8086.
7. How many memory locations are available in 8086 microprocessor?
8. What are the general purposes registers in 8086?
9. What are the functional units in 8086?
10. How much memory location allotted for the particular segments registers in 8086?
11. When the 8086 processor is in minimum mode and maximum mode?
12. Define ? Segment Override Prefix.
13. Define ? Macro and Procedure
14. Define ? Assembler and assembler directives
15. Define ? Compiler and Linker
16. What is meant by modular programming?
17. Explain the uses of PUSH and POP instruction.
18. Explain the uses of CALL and RET instruction.
19. Identify the addressing modes in the following instructions.
AND AL, BL
SUB AL, 24H
MOV AL, (BP)
MOV CX, 1245H
20. What are the 8086 instructions used for BCD arithmetic?

Applications:
1. Toys
2. Light switches and dimmers
3. Electrical circuit breakers
4. Smoke alarms
5. Battery packs


Viva ? voce
28 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.5 SEARCHING AND SORTING A STRING IN A
GIVEN ARRAY
a) Searching a String in a Given Array:
Aim:
To write an assembly language program to search a string in the given array and to execute it using 8086
kit.
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Algorithm:
1. Initialize the source and destination memory in SI and DI register
2. Initialize the count (CL) and Load the string values to any register (DL)
3. Move string to AL register and Compare the register (DL and AL)
4. Check for zero flag and if it is set jump to step 7 else go to step 9
5. Store the value of AL register
6. Increment DI register by one, Increment SI register by one and Decrement CL register by one
7. Check for zero flag and if it is set jump to step 12 else go to step 4
8. Stop the execution
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Type the Assembly Language Program
6. Press ?RESET? key
To executive the program
7. Press ?GO?
8. Type the starting address to execute the program
9. Press ?RESET? key
To verify the result
29 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

10. Type ?SB(Substitute Byte)?
11. Enter the output address location to check the result
Program:
Address Label Mnemonics
1000 MOV DI, 1300
1004 MOV SI, 1200
1008 MOV CL, 06
100B MOV DL, 02
100E L1 MOV AL, [SI]
1010 CMP DL, AL
1012 JNZ L2
1014 MOV [DI], AL
1016 INC DI
1017 L2 INC SI
1018 DEC CL
101A JNZ L1
101C HLT

Tabulation:
Input Output
Address Data Address Data


Result:
Thus an assembly language program to search a string in the string in the given array is written. The
program is executed using 8086 and the output is verified.






30 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

b) Sorting an Array of Data Using 8086:
Aim:
To write an assembly language program to sort an array of data in ascending and descending order and
execute it using 8086 kit
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
1. Ascending Order:
Algorithm:
1. Set SI as pointer for array
2. Set CL as outer loop counter
3. Initialize array pointer
4. Set CH as inner loop counter
5. Increment array pointer
6. Get the first element of array
7. Increment array pointer and Compare the two elements
31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

8. Checks carry flag. If carry flag is set go to step 11 else go to step 10
9. Swap the content of the memory location
10. Decrement the inner loop counter
11. Check zero flag. If it is set go to step 13 else go to step 7
12. Decrement outer loop counter
13. Check zero flag. If it is set go to step 15 else go to step 3 and stop
Program:
Address Label Mnemonics
1000 MOV SI, 1100H
1004 MOV CL, [SI]
1006 DEC CL
008 Repeat MOV SI, 1100H
100C MOV CH, [SI]
100E DEC CH
1010 INC SI
1011 Rep MOV AL, [SI]
1013 INC SI
1014 CMP AL, [SI]
1016 JC Ahead
1018 XCHG AL, [SI]
101A XCHG AL, [SI-1]
101D Ahead DEC CH
101F JNZ Rep
1021 DEC CL
1023 JNZ Repeat
1025 HLT
Tabulation:
Input Output
Address Data Address Data



32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

2. Descending Order:
Algorithm:
1. Set SI as pointer for array
2. Set CL as outer loop counter
3. Initialize array pointer
4. Set CH as inner loop counter
5. Increment array pointer Get the first element of array
6. Increment array pointer
7. Compare the two elements
8. Checks carry flag. If carry flag is set go to step 11 else go to step 10
9. Swap the content of the memory location
10. Decrement the inner loop counter
11. Check zero flag. If it is set go to step 13 else go to step 7
12. Decrement outer loop counter
13. Check zero flag. If it is set go to step 15 else go to step 3
14. Stop
Program:
Address Label Mnemonics
1000 MOV SI, 1100H
1004 MOV CL, [SI]
1006 DEC CL
1008 Repeat MOV SI, 1100H
100C MOV CH, [SI]
100E DEC CH
1010 INC SI
1011 Rep MOV AL, [SI]
1013 INC SI
1014 CMP AL, [SI]
1016 JNC Ahead
1018 XCHG AL, [SI]
101A XCHG AL, [SI-1]
101D Ahead DEC CH
101F JNZ Rep
1021 DEC CL
1023 JNZ Repeat
1025 HLT

33 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


Result:
Thus an assembly language program is written to sort an array of data in ascending and descending order.
The program is executed using 8086 and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts and write the Assembly
Language Program for Searching and Sorting.

1. What is the relation between 8086 processor frequency & crystal Frequency?
2. What is the position of the stack pointer after the POP instruction?
3. Compare CALL and JMP instructions.
4. Define ? Baud Rate
5. What is the size of instruction queue in 8086?
6. Compare JNC and JMP instructions.
7. What happens when HLT instruction is executed in processor?
8. What is the maximum internal clock frequency of 8086 processor?
9. What are the functions of BIU?
10. Write an ALP program to search a number 05 from a given array.
11. What is cache memory?
12. Can ROM be used as stack?
13. What are the 8086 instructions used for BCD arithmetic?
14. What are the 8086 instructions used for ASCII arithmetic?
15. List the various string instructions available in 8086.
16. How will carry and zero flags reflect the result of instruction CMP BX, CX?
17. Give any four miscellaneous instructions in 16-bit Microprocessor
18. List the flags in 8086 and state its functions.
19. What is the purpose of segment registers in 8086?
20. What is virtual addressing mode?

Viva ? voce
FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING


EC6513 ? MICROPROCESSOR AND MICROCONTROLLERLABORATORY


V SEMESTER - R 2013










Name : _______________________________________
Register No. : _______________________________________
Section : _______________________________________



LABORATORY MANUAL
2 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY


C01 - To learn the working of ARM processor
C02 - To introduce ALP concepts and features
C03 - To write ALP for arithmetic and logical operations in 8086 and 8051
C04 - To differentiate Serial and Parallel Interface
C05 - To interface different I/Os with Microprocessors
C06 - To be familiar with MASM
.




1. Write programs in ARM for a specific Application
2. Write ALP Programs for fixed and Floating Point and Arithmetic
3. Interface different I/Os with processor and Generate waveforms using Microprocessors
4. Execute Programs in 8051
5. Assess the performance of optical devices: light sources, fibers and detectors from both physical and system
point of view

INTRODUCTION
This course illustrates the concepts covered in course CS6412 and provides students with hands-on
experience in Assembly language programs.
PREREQUISITE:
1. Digital Electronics
EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
Lecture
No./Session No.
Name of the Experiment
Course
objectives
Proposed
date

1,2,3
Introduction to lab
CO1

CYCLE I - 8086 PROGRAMS USING KITS AND MASM
4,5,6 Basic arithmetic and Logical operations CO2
COURSE OBJECTIVES
COURSE OUTCOMES
3 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00













7,8,9 Decimal arithmetic and Code conversion CO3
10,11,12
Move a data block without overlap
CO3
Matrix operations
13,14,15 Searching and Sorting a sting in a given array CO2
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
16,17,18 D/A interface and Waveform Generation CO4
19,20,21 A/D interface CO5
22,23,24 Key board and Display CO5
25,26,27
Stepper motor control CO2
Traffic light control CO5
28,29,30
Digital clock CO6
Serial interface and Parallel interface CO4
CYCLE III - 8051 PROGRAMS USING KITS AND MASM
31,32,33 Basic arithmetic and Logical operations CO1
34,35,36
Square and Cube program, Find 2?s complement of a number
CO5
Unpacked BCD to ASCII
37,38,39
Password checking and Print RAM size with system date
CO6
Counters and Time Delay
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
40,41,42 Sorting of an array using 8051 CO2
43,44,45
Separate odd and even numbers using 8086


CO3
Sum of N consecutive numbers using 8086
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00




College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING




To impart professional education integrated with human values to the younger generation, so as to shape
them as proficient and dedicated engineers, capable of providing comprehensive solutions to the challenges in
deploying technology for the service of humanity



? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices


VISION
MISSION
VISION
MISSION
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of
engineering that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this
enables to find solutions for real time problem in industry and organization and to design products
requiring interdisciplinary skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up
their communication skills, individual leadership and supportive qualities and to develop them to adapt and
work in ever changing technologies
5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees











6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer
Science and Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the
career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both
verbal and written forms
i) To work in a team as team member or a leader and make unique contributions and work with
coordination
j) To engage lifelong learning and exhibit their technical skills
k) To develop and manage projects in multidisciplinary environments










7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER
LABORATORY
SYLLABUS

? To learn the working of ARM processor
? To introduce ALP concepts and features
? To write ALP for arithmetic and logical operations in 8086 and 8051
? To differentiate Serial and Parallel Interface
? To interface different I/Os with Microprocessors
? To be familiar with MASM
LIST OF EXPERIMENTS:
8086 Programs using kits and MASM
1. Basic arithmetic and Logical operations
2. Move a data block without overlap
3. Code conversion, decimal arithmetic and Matrix operations.
4. Floating point operations, string manipulations, sorting and searching
5. Password checking, Print RAM size and system date
6. Counters and Time Delay
Peripherals and Interfacing Experiments
7. Traffic light control
8. Stepper motor control
9. Digital clock
10. Key board and Display
11. Printer status
12. Serial interface and Parallel interface
13. A/D and D/A interface and Waveform Generation 8051
Experiments using kits and MASM
14. Basic arithmetic and Logical operations
15. Square and Cube program, Find 2 ?s complement of a number
16. Unpacked BCD to ASCII

? Write programs in ARM for a specific Application
? Write ALP Programs for fixed and Floating Point and Arithmetic
? Interface different I/Os with processor and Generate waveforms using Microprocessors
? Execute Programs in 8051
? Assess the performance of optical devices: light sources, fibers and detectors from both physical and
system point of view


COURSE OUTCOMES
COURSE OBJECTIVES
8 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 - 8086 PROGRAMS USING KITS AND MASM
1 Basic arithmetic and Logical operations 10
2 Decimal arithmetic and Code conversion 15
3 Move a data block without overlap 21
4 Matrix operations 24
5 Searching and Sorting a sting in a given array 27
6 Password checking and Print RAM size with system date 33
7 Counters and Time Delay 36
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
8 Stepper motor control 39
9 Traffic light control 42
10 Digital clock 47
11 Serial interface and Parallel interface 50
12 A/D interface 54
13 Key board and Display 57
14 D/A interface and Waveform Generation 60
CYCLE 3 - 8051 PROGRAMS USING KITS AND MASM
15 Basic arithmetic and Logical operations 64
16 Square and Cube program, Find 2?s complement of a number 69
17 Unpacked BCD to ASCII 71
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
18 Sorting of an array using 8051 74
19 Separate odd and even numbers using 8086 77
20 Sum of N consecutive numbers using 8086 80

9 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.1 BASIC ARITHMETIC AND LOGICAL OPERATIONS

Aim:
To write an Assembly Language Program to perform Arithmetic operation and to execute using 8086
microprocessor
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
Arithmetic Operation:
1. Addition:
Algorithm:
1. Clear BL register to store carry
2. Get the addend in AX register pair
3. Get the Augend in CX register pair
4. Add Augend and addend
5. Check for carry, If it is one go to step 6 else go to step 7
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

6. Increments carry (BL register by 1)
7. Store the sum in memory from AX register pair
8. Store the carry in memory from BL register
9. Stop
Program:
Address
Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 1010H
1007 MOV CX, 2020H
100B CLC
100C ADD AX, CX
100E JNC Label1
1010 INC BL
1012 Label 1 MOV [1200], AX
1016 MOV [1202], BL
101A HLT
Precaution:
Make sure that all the machine codes should be as per the specified in the program.
Tabulation:
Input Output
Address Data Address Data








2. Subtraction:
Algorithm:
1. Clear BL register for storing borrow
2. Get the minuend in AX register pair
3. Get the subtrahend in CX register pair
4. Subtract minuend and subtrahend
5. Check borrow, if borrow is one go to step 6 else go to step 8
6. Increment borrow (BL register by 1)
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

7. Negate AX register
8. Store the difference from AX in memory
9. Story the borrow from BL in memory
10. Stop
Program:
Address Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 2024H
1007 MOV CX, 1010H
100B SUB AX, CX
100D JNC Label1
100F INC BL
1011 NEG AX
1013 Label 1 MOV [1200], AX
1017 MOV [1202], BL
101B HLT

Tabulation:
Input Output
Address Data Address Data






3. Multiplication
Algorithm:
1. Clear DX register
2. Load the AX register pair with multiplicand
3. Load the CX register pair with multiplier
4. Multiply multiplicand and multiplier
5. Store the higher byte of product(from DX register pair) in memory specified
6. Store the lower byte of product(from AX register pair) in memory specified
7. Stop
8.
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV DX, 0000H
1004 MOV AX, 00FFH
1008 MOV CX, 0002H
100C MUL CX
100E MOV [1200], AX
1012 MOV [1202], DX
1016 HLT
Tabulation:
Input Output
Address Data Address Data






4. Division:
Algorithm
1. Clear DX register
2. Load the AX register pair with dividend
3. Load the CX register pair with divisor
4. Dividend divided by divisor
5. Store the quotient (from AX register pair) in memory specified
6. Store the remainder (from DX register pair) in memory specified
7. Stop
Program:
Address Label Mnemonics
1000 MOV DX, 0000H
1004 MOV AX, 0008H
1008 MOV CX, 0004H
100C DIV CX
100E MOV [1200], AX
1012 MOV [1202], DX
1016 HLT

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


Result:
Thus Assembly language program are written to perform arithmetic operation using 8086 microprocessor.
They are executed using 8086 processor and the outputs are verified.
Outcome:
At the end of this experiment the students able to write ALP programs for Arithmetic and Logical operations.

1. Write the size of the data bus of 8086.
2. Write the size of the address bus of 8086.
3. What is meant by physical addressing in 8086?
4. What is meant by an Opcode?
5. What is meant by an Operand?
6. What is meant by a Mnemonics?
7. What are the other possibilities of writing ADD, SUB and MUL instructions in other addressing modes?
8. What is the difference between microprocessor and microcontroller?
9. What is meant by LATCH?
10. What is the difference between primary & secondary storage device?
11. What is the difference between static and dynamic RAM?
12. What is an interrupt?
13. Differentiate between RAM and ROM?
14. Define ? Compiler
15. Define ? Flag
16. Define ? Stack
17. How clock signal is generated in 8086 microprocessor?
18. State the functions of queue status line QS0 and QS1 in 8086 microprocessor.
19. What is the purpose of BIU& EU?
20. List out the two examples of assembler directives.

Viva ? voce
15 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Applications:
1. barrel shifters
2. Multiple-precision arithmetic
3. Calculation pipeline
4. binary multipliers
5. Calculation in a single clock

16 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.2 DECIMAL ARITHMETIC AND CODE CONVERSION
Aim:
To write an Assembly Language Program to perform Code conversion and Decimal Arithmetic operations
and to execute using 8086 microprocessor
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
Decimal Arithmetic:
1. Using DAA
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Clear the CL reg.
4. Add the contents of AL and BL.
5. Adjust decimal accumulator after addition.
6. Store the result.
17 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 MOV CL, 00
100B ADD AL,BL
100D DAA
100E JNC L1
1010 INC CL
1012 L1 MOV [1150], AL
1016 MOV [1151], CL
101A HLT

Tabulation:
Input Output
Address Data Address Data


2. Using AAM
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Multiply the contents of AL and BL.
4. Adjust decimal accumulator after multiplication.
5. Store the result.
Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 MUL BL
100A AAM
100C MOV [1150], AH
1010 MOV [1151], AL
1014 HLT

18 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


3. Using DAS
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Subtract the contents of BL from AL.
4. Adjust decimal accumulator after subtraction.
5. Store the result.
Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 SUB AL,BL
100A DAS
100B MOV [1150], AL
100F HLT
Tabulation:
Input Output
Address Data Address Data


Code Conversion:
1. Binary to BCD
Algorithm:
1. Get the input and store in AL.
2. Clear the carry flag.
3. Rotate right the bits of input.
4. Find logical XOR between input and shifted input.
5. Store the result.
19 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 XOR AX,AX
1002 XOR CX,CX
1004 MOV BX,000B
1008 L2 CMP BX,00
100C JZ L1
100E DEC BX
100F MOV AL,CL
1011 ADD AL,01
1014 DAA
1015 MOV CL,AL
1017 MOV AL,CH
1019 ADC AL,00
101C DAA
101D MOV CH,AL
101F JMP L2
1022 MOV [1150],CX
1026 HLT
Tabulation:
Input Output
Address Data Address Data




2. Binary to Gray
Algorithm:
1. Get the input and store in AL.
2. Clear the carry flag.
3. Rotate right the bits of input.
4. Find logical XOR between input and shifted input.
5. Store the result.

20 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, AL
1006 CLC
1007 MOV CL,01
100A RCR AL,CL
100C XOR BL,AL
100E MOV [1150],BL
1012 HLT
Tabulation:
Input Output
Address Data Address Data


Result:
Thus an Assembly Language Program for code conversion and decimal arithmetic operations is written. The
program is executed using 8086 and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts of code conversions and
decimal arithmetic operations.








21 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


1. Write the function of the following 8085 instructions: JP, JPE, JPO, and JNZ.
2. What is the purpose of the following commands in 8086?
a) AAD
b) RCL
3. List out the addressing modes in 8086.
4. List out the various string instructions that are available in 8086.
5. What are the 8086 instructions used for BCD arithmetic?
6. What flags get affected after executing ADD instruction?
7. Which instruction is used to add immediate data?
8. What is BCD code? Where it is used?
9. What is ASCII code? Where it is used?
10. What is the difference between carry flag and overflow flag?
11. What are the special function register associated with interrupts?
12. List the flags affected by arithmetic instructions.
13. After executing ADDC instruction, what flags get affected?
14. How many bytes the instruction ADDC will add?
15. Name the signals used by the processor to communicate with an I/O processor
16. What is the function of IP?
17. What is the use of base pointer register?
18. Mention the index registers of 8086.
19. How many memory locations are available in 8086 microprocessor?
20. What are the flags in 8086? What are the various interrupts in 8086?
Applications:
1. Programmable calculators
2. Counting system using counts the tennis ball
3. Detecting and Correcting an Error with the Hamming Code
4. Power tool
5. Radio clocks
Viva ? voce
22 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.3 MOVE A DATA BLOCK WITHOUT OVERLAP
Aim:
To write an assembly language program to move a block of data to another memory location and execute it
using 8086
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Algorithm:
1. Initialize the source and destination memory location to SI and DI register
2. Initialize the counter (CL register)
3. Move the data to designation memory through AL register
4. Decrement the count
5. Check for zero flag and if zero flag is set go to next step
6. else go to step 3
7. Stop
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
23 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


Program:
Address Label Mnemonics
1000 MOV CL, 08
1003 MOV SI, 1200
1007 MOV DI, 1300
100B L1 LOD SB
100C MOV [DI], AL
100E INC DI
100F DEC CL
1011 JNZ L1
1013 HLT

Tabulation:
Input Output
Address Data Address Data




Result:
Thus an Assembly Language Program for moving data to another location is written the program is
executed using 8086 and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts and write the ALP program for
moving data to another location.



24 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00



1. List out the Flag manipulation instruction.
2. Define ? Variables
3. Define ? Segment Override Prefix
4. How is the memory segment accessed by 8086 microprocessor identified?
5. List out the advantages of using Direct Memory Access (DMA).
6. What is BIOS function call in 8086? (May 2012)
7. List out the difference between procedures and Macros.
8. What is meant by maskable interrupts& non-maskable interrupts?
9. What is the Maximum clock frequency in 8086?
10. Which Stack is used in 8086?
11. Define ? Pipeline (Dec 2011)
12. How many address lines are available in 8086? What is the maximum address possible?
13. What is an assembler?( May 2012)
14. What is the purpose of LEA instruction in 8086? (May 2012)
15. Give the function of index and pointers in 8086.
16. What are the different instruction set of 8086?
17. Give the various addressing modes in 8086.
18. Give the differences between JUMP and LOOP instruction.
19. Give the physical address formation of any two addressing mode.
20. Give the use of ?ASSUME? in 8086 programming.
Applications:
1. Priority Encoder
2. DVD players
3. Cellular telephones
4. Household appliances
5. Car equipment
Viva ? voce
25 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.4 MATRIX OPERATIONS
Aim:
To write an assembly language program to perform matrix addition and to execute it using 8086
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Algorithm:
1. Get the size (count) of the matrix
2. Initialize SI pointer for storing first matrix
3. Initialize DI pointer for storing second matrix
4. Move the contents pointed by SI pointer to accumulator
5. Move the contents pointed by DI pointer BL register
6. Add the contents of accumulator and BL register
7. Store result in the address pointed by DI pointer
8. Increment DI and SI pointer by 1 and Decrement count by 1
9. Check for zero. If no zero jump to step 4 else go to step 11
10. Stop the execution
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result

26 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV CL, 09
1003 MOV SI, 1100
1007 MOV DI, 1200
100B L1 MOV AL, [SI]
100D MOV BL, [DI]
100F ADD AL, BL
1011 MOV [DI], AL
1013 INC SI
1014 INC DI
1015 DEC CL
1017 JNZ L1
1019 HLT

Tabulation:
Input Output
Address Data Address Data



Result:
Thus an assembly language program for matrix addition was written. It is executed using 8086
microprocessor and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts of moving and adding the group
of data from one location to another location.







27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


1. Write an ALP for 8086 to multiply two 16 bit unsigned numbers.
2. What is an accumulator?
3. List out the segment register available in 8086.
4. List out any four program control instructions that are available in 8086.
5. What is program counter?
6. Give any four logical instructions in 8086.
7. How many memory locations are available in 8086 microprocessor?
8. What are the general purposes registers in 8086?
9. What are the functional units in 8086?
10. How much memory location allotted for the particular segments registers in 8086?
11. When the 8086 processor is in minimum mode and maximum mode?
12. Define ? Segment Override Prefix.
13. Define ? Macro and Procedure
14. Define ? Assembler and assembler directives
15. Define ? Compiler and Linker
16. What is meant by modular programming?
17. Explain the uses of PUSH and POP instruction.
18. Explain the uses of CALL and RET instruction.
19. Identify the addressing modes in the following instructions.
AND AL, BL
SUB AL, 24H
MOV AL, (BP)
MOV CX, 1245H
20. What are the 8086 instructions used for BCD arithmetic?

Applications:
1. Toys
2. Light switches and dimmers
3. Electrical circuit breakers
4. Smoke alarms
5. Battery packs


Viva ? voce
28 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.5 SEARCHING AND SORTING A STRING IN A
GIVEN ARRAY
a) Searching a String in a Given Array:
Aim:
To write an assembly language program to search a string in the given array and to execute it using 8086
kit.
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Algorithm:
1. Initialize the source and destination memory in SI and DI register
2. Initialize the count (CL) and Load the string values to any register (DL)
3. Move string to AL register and Compare the register (DL and AL)
4. Check for zero flag and if it is set jump to step 7 else go to step 9
5. Store the value of AL register
6. Increment DI register by one, Increment SI register by one and Decrement CL register by one
7. Check for zero flag and if it is set jump to step 12 else go to step 4
8. Stop the execution
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Type the Assembly Language Program
6. Press ?RESET? key
To executive the program
7. Press ?GO?
8. Type the starting address to execute the program
9. Press ?RESET? key
To verify the result
29 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

10. Type ?SB(Substitute Byte)?
11. Enter the output address location to check the result
Program:
Address Label Mnemonics
1000 MOV DI, 1300
1004 MOV SI, 1200
1008 MOV CL, 06
100B MOV DL, 02
100E L1 MOV AL, [SI]
1010 CMP DL, AL
1012 JNZ L2
1014 MOV [DI], AL
1016 INC DI
1017 L2 INC SI
1018 DEC CL
101A JNZ L1
101C HLT

Tabulation:
Input Output
Address Data Address Data


Result:
Thus an assembly language program to search a string in the string in the given array is written. The
program is executed using 8086 and the output is verified.






30 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

b) Sorting an Array of Data Using 8086:
Aim:
To write an assembly language program to sort an array of data in ascending and descending order and
execute it using 8086 kit
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
1. Ascending Order:
Algorithm:
1. Set SI as pointer for array
2. Set CL as outer loop counter
3. Initialize array pointer
4. Set CH as inner loop counter
5. Increment array pointer
6. Get the first element of array
7. Increment array pointer and Compare the two elements
31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

8. Checks carry flag. If carry flag is set go to step 11 else go to step 10
9. Swap the content of the memory location
10. Decrement the inner loop counter
11. Check zero flag. If it is set go to step 13 else go to step 7
12. Decrement outer loop counter
13. Check zero flag. If it is set go to step 15 else go to step 3 and stop
Program:
Address Label Mnemonics
1000 MOV SI, 1100H
1004 MOV CL, [SI]
1006 DEC CL
008 Repeat MOV SI, 1100H
100C MOV CH, [SI]
100E DEC CH
1010 INC SI
1011 Rep MOV AL, [SI]
1013 INC SI
1014 CMP AL, [SI]
1016 JC Ahead
1018 XCHG AL, [SI]
101A XCHG AL, [SI-1]
101D Ahead DEC CH
101F JNZ Rep
1021 DEC CL
1023 JNZ Repeat
1025 HLT
Tabulation:
Input Output
Address Data Address Data



32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

2. Descending Order:
Algorithm:
1. Set SI as pointer for array
2. Set CL as outer loop counter
3. Initialize array pointer
4. Set CH as inner loop counter
5. Increment array pointer Get the first element of array
6. Increment array pointer
7. Compare the two elements
8. Checks carry flag. If carry flag is set go to step 11 else go to step 10
9. Swap the content of the memory location
10. Decrement the inner loop counter
11. Check zero flag. If it is set go to step 13 else go to step 7
12. Decrement outer loop counter
13. Check zero flag. If it is set go to step 15 else go to step 3
14. Stop
Program:
Address Label Mnemonics
1000 MOV SI, 1100H
1004 MOV CL, [SI]
1006 DEC CL
1008 Repeat MOV SI, 1100H
100C MOV CH, [SI]
100E DEC CH
1010 INC SI
1011 Rep MOV AL, [SI]
1013 INC SI
1014 CMP AL, [SI]
1016 JNC Ahead
1018 XCHG AL, [SI]
101A XCHG AL, [SI-1]
101D Ahead DEC CH
101F JNZ Rep
1021 DEC CL
1023 JNZ Repeat
1025 HLT

33 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


Result:
Thus an assembly language program is written to sort an array of data in ascending and descending order.
The program is executed using 8086 and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts and write the Assembly
Language Program for Searching and Sorting.

1. What is the relation between 8086 processor frequency & crystal Frequency?
2. What is the position of the stack pointer after the POP instruction?
3. Compare CALL and JMP instructions.
4. Define ? Baud Rate
5. What is the size of instruction queue in 8086?
6. Compare JNC and JMP instructions.
7. What happens when HLT instruction is executed in processor?
8. What is the maximum internal clock frequency of 8086 processor?
9. What are the functions of BIU?
10. Write an ALP program to search a number 05 from a given array.
11. What is cache memory?
12. Can ROM be used as stack?
13. What are the 8086 instructions used for BCD arithmetic?
14. What are the 8086 instructions used for ASCII arithmetic?
15. List the various string instructions available in 8086.
16. How will carry and zero flags reflect the result of instruction CMP BX, CX?
17. Give any four miscellaneous instructions in 16-bit Microprocessor
18. List the flags in 8086 and state its functions.
19. What is the purpose of segment registers in 8086?
20. What is virtual addressing mode?

Viva ? voce
34 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Applications:
1. Car keys
2. Power tool
3. Home security system
4. Dishwashers
5. Washing machines
FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING


EC6513 ? MICROPROCESSOR AND MICROCONTROLLERLABORATORY


V SEMESTER - R 2013










Name : _______________________________________
Register No. : _______________________________________
Section : _______________________________________



LABORATORY MANUAL
2 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY


C01 - To learn the working of ARM processor
C02 - To introduce ALP concepts and features
C03 - To write ALP for arithmetic and logical operations in 8086 and 8051
C04 - To differentiate Serial and Parallel Interface
C05 - To interface different I/Os with Microprocessors
C06 - To be familiar with MASM
.




1. Write programs in ARM for a specific Application
2. Write ALP Programs for fixed and Floating Point and Arithmetic
3. Interface different I/Os with processor and Generate waveforms using Microprocessors
4. Execute Programs in 8051
5. Assess the performance of optical devices: light sources, fibers and detectors from both physical and system
point of view

INTRODUCTION
This course illustrates the concepts covered in course CS6412 and provides students with hands-on
experience in Assembly language programs.
PREREQUISITE:
1. Digital Electronics
EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
Lecture
No./Session No.
Name of the Experiment
Course
objectives
Proposed
date

1,2,3
Introduction to lab
CO1

CYCLE I - 8086 PROGRAMS USING KITS AND MASM
4,5,6 Basic arithmetic and Logical operations CO2
COURSE OBJECTIVES
COURSE OUTCOMES
3 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00













7,8,9 Decimal arithmetic and Code conversion CO3
10,11,12
Move a data block without overlap
CO3
Matrix operations
13,14,15 Searching and Sorting a sting in a given array CO2
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
16,17,18 D/A interface and Waveform Generation CO4
19,20,21 A/D interface CO5
22,23,24 Key board and Display CO5
25,26,27
Stepper motor control CO2
Traffic light control CO5
28,29,30
Digital clock CO6
Serial interface and Parallel interface CO4
CYCLE III - 8051 PROGRAMS USING KITS AND MASM
31,32,33 Basic arithmetic and Logical operations CO1
34,35,36
Square and Cube program, Find 2?s complement of a number
CO5
Unpacked BCD to ASCII
37,38,39
Password checking and Print RAM size with system date
CO6
Counters and Time Delay
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
40,41,42 Sorting of an array using 8051 CO2
43,44,45
Separate odd and even numbers using 8086


CO3
Sum of N consecutive numbers using 8086
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00




College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING




To impart professional education integrated with human values to the younger generation, so as to shape
them as proficient and dedicated engineers, capable of providing comprehensive solutions to the challenges in
deploying technology for the service of humanity



? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices


VISION
MISSION
VISION
MISSION
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of
engineering that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this
enables to find solutions for real time problem in industry and organization and to design products
requiring interdisciplinary skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up
their communication skills, individual leadership and supportive qualities and to develop them to adapt and
work in ever changing technologies
5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees











6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer
Science and Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the
career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both
verbal and written forms
i) To work in a team as team member or a leader and make unique contributions and work with
coordination
j) To engage lifelong learning and exhibit their technical skills
k) To develop and manage projects in multidisciplinary environments










7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER
LABORATORY
SYLLABUS

? To learn the working of ARM processor
? To introduce ALP concepts and features
? To write ALP for arithmetic and logical operations in 8086 and 8051
? To differentiate Serial and Parallel Interface
? To interface different I/Os with Microprocessors
? To be familiar with MASM
LIST OF EXPERIMENTS:
8086 Programs using kits and MASM
1. Basic arithmetic and Logical operations
2. Move a data block without overlap
3. Code conversion, decimal arithmetic and Matrix operations.
4. Floating point operations, string manipulations, sorting and searching
5. Password checking, Print RAM size and system date
6. Counters and Time Delay
Peripherals and Interfacing Experiments
7. Traffic light control
8. Stepper motor control
9. Digital clock
10. Key board and Display
11. Printer status
12. Serial interface and Parallel interface
13. A/D and D/A interface and Waveform Generation 8051
Experiments using kits and MASM
14. Basic arithmetic and Logical operations
15. Square and Cube program, Find 2 ?s complement of a number
16. Unpacked BCD to ASCII

? Write programs in ARM for a specific Application
? Write ALP Programs for fixed and Floating Point and Arithmetic
? Interface different I/Os with processor and Generate waveforms using Microprocessors
? Execute Programs in 8051
? Assess the performance of optical devices: light sources, fibers and detectors from both physical and
system point of view


COURSE OUTCOMES
COURSE OBJECTIVES
8 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 - 8086 PROGRAMS USING KITS AND MASM
1 Basic arithmetic and Logical operations 10
2 Decimal arithmetic and Code conversion 15
3 Move a data block without overlap 21
4 Matrix operations 24
5 Searching and Sorting a sting in a given array 27
6 Password checking and Print RAM size with system date 33
7 Counters and Time Delay 36
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
8 Stepper motor control 39
9 Traffic light control 42
10 Digital clock 47
11 Serial interface and Parallel interface 50
12 A/D interface 54
13 Key board and Display 57
14 D/A interface and Waveform Generation 60
CYCLE 3 - 8051 PROGRAMS USING KITS AND MASM
15 Basic arithmetic and Logical operations 64
16 Square and Cube program, Find 2?s complement of a number 69
17 Unpacked BCD to ASCII 71
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
18 Sorting of an array using 8051 74
19 Separate odd and even numbers using 8086 77
20 Sum of N consecutive numbers using 8086 80

9 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.1 BASIC ARITHMETIC AND LOGICAL OPERATIONS

Aim:
To write an Assembly Language Program to perform Arithmetic operation and to execute using 8086
microprocessor
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
Arithmetic Operation:
1. Addition:
Algorithm:
1. Clear BL register to store carry
2. Get the addend in AX register pair
3. Get the Augend in CX register pair
4. Add Augend and addend
5. Check for carry, If it is one go to step 6 else go to step 7
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

6. Increments carry (BL register by 1)
7. Store the sum in memory from AX register pair
8. Store the carry in memory from BL register
9. Stop
Program:
Address
Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 1010H
1007 MOV CX, 2020H
100B CLC
100C ADD AX, CX
100E JNC Label1
1010 INC BL
1012 Label 1 MOV [1200], AX
1016 MOV [1202], BL
101A HLT
Precaution:
Make sure that all the machine codes should be as per the specified in the program.
Tabulation:
Input Output
Address Data Address Data








2. Subtraction:
Algorithm:
1. Clear BL register for storing borrow
2. Get the minuend in AX register pair
3. Get the subtrahend in CX register pair
4. Subtract minuend and subtrahend
5. Check borrow, if borrow is one go to step 6 else go to step 8
6. Increment borrow (BL register by 1)
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

7. Negate AX register
8. Store the difference from AX in memory
9. Story the borrow from BL in memory
10. Stop
Program:
Address Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 2024H
1007 MOV CX, 1010H
100B SUB AX, CX
100D JNC Label1
100F INC BL
1011 NEG AX
1013 Label 1 MOV [1200], AX
1017 MOV [1202], BL
101B HLT

Tabulation:
Input Output
Address Data Address Data






3. Multiplication
Algorithm:
1. Clear DX register
2. Load the AX register pair with multiplicand
3. Load the CX register pair with multiplier
4. Multiply multiplicand and multiplier
5. Store the higher byte of product(from DX register pair) in memory specified
6. Store the lower byte of product(from AX register pair) in memory specified
7. Stop
8.
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV DX, 0000H
1004 MOV AX, 00FFH
1008 MOV CX, 0002H
100C MUL CX
100E MOV [1200], AX
1012 MOV [1202], DX
1016 HLT
Tabulation:
Input Output
Address Data Address Data






4. Division:
Algorithm
1. Clear DX register
2. Load the AX register pair with dividend
3. Load the CX register pair with divisor
4. Dividend divided by divisor
5. Store the quotient (from AX register pair) in memory specified
6. Store the remainder (from DX register pair) in memory specified
7. Stop
Program:
Address Label Mnemonics
1000 MOV DX, 0000H
1004 MOV AX, 0008H
1008 MOV CX, 0004H
100C DIV CX
100E MOV [1200], AX
1012 MOV [1202], DX
1016 HLT

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


Result:
Thus Assembly language program are written to perform arithmetic operation using 8086 microprocessor.
They are executed using 8086 processor and the outputs are verified.
Outcome:
At the end of this experiment the students able to write ALP programs for Arithmetic and Logical operations.

1. Write the size of the data bus of 8086.
2. Write the size of the address bus of 8086.
3. What is meant by physical addressing in 8086?
4. What is meant by an Opcode?
5. What is meant by an Operand?
6. What is meant by a Mnemonics?
7. What are the other possibilities of writing ADD, SUB and MUL instructions in other addressing modes?
8. What is the difference between microprocessor and microcontroller?
9. What is meant by LATCH?
10. What is the difference between primary & secondary storage device?
11. What is the difference between static and dynamic RAM?
12. What is an interrupt?
13. Differentiate between RAM and ROM?
14. Define ? Compiler
15. Define ? Flag
16. Define ? Stack
17. How clock signal is generated in 8086 microprocessor?
18. State the functions of queue status line QS0 and QS1 in 8086 microprocessor.
19. What is the purpose of BIU& EU?
20. List out the two examples of assembler directives.

Viva ? voce
15 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Applications:
1. barrel shifters
2. Multiple-precision arithmetic
3. Calculation pipeline
4. binary multipliers
5. Calculation in a single clock

16 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.2 DECIMAL ARITHMETIC AND CODE CONVERSION
Aim:
To write an Assembly Language Program to perform Code conversion and Decimal Arithmetic operations
and to execute using 8086 microprocessor
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
Decimal Arithmetic:
1. Using DAA
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Clear the CL reg.
4. Add the contents of AL and BL.
5. Adjust decimal accumulator after addition.
6. Store the result.
17 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 MOV CL, 00
100B ADD AL,BL
100D DAA
100E JNC L1
1010 INC CL
1012 L1 MOV [1150], AL
1016 MOV [1151], CL
101A HLT

Tabulation:
Input Output
Address Data Address Data


2. Using AAM
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Multiply the contents of AL and BL.
4. Adjust decimal accumulator after multiplication.
5. Store the result.
Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 MUL BL
100A AAM
100C MOV [1150], AH
1010 MOV [1151], AL
1014 HLT

18 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


3. Using DAS
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Subtract the contents of BL from AL.
4. Adjust decimal accumulator after subtraction.
5. Store the result.
Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 SUB AL,BL
100A DAS
100B MOV [1150], AL
100F HLT
Tabulation:
Input Output
Address Data Address Data


Code Conversion:
1. Binary to BCD
Algorithm:
1. Get the input and store in AL.
2. Clear the carry flag.
3. Rotate right the bits of input.
4. Find logical XOR between input and shifted input.
5. Store the result.
19 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 XOR AX,AX
1002 XOR CX,CX
1004 MOV BX,000B
1008 L2 CMP BX,00
100C JZ L1
100E DEC BX
100F MOV AL,CL
1011 ADD AL,01
1014 DAA
1015 MOV CL,AL
1017 MOV AL,CH
1019 ADC AL,00
101C DAA
101D MOV CH,AL
101F JMP L2
1022 MOV [1150],CX
1026 HLT
Tabulation:
Input Output
Address Data Address Data




2. Binary to Gray
Algorithm:
1. Get the input and store in AL.
2. Clear the carry flag.
3. Rotate right the bits of input.
4. Find logical XOR between input and shifted input.
5. Store the result.

20 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, AL
1006 CLC
1007 MOV CL,01
100A RCR AL,CL
100C XOR BL,AL
100E MOV [1150],BL
1012 HLT
Tabulation:
Input Output
Address Data Address Data


Result:
Thus an Assembly Language Program for code conversion and decimal arithmetic operations is written. The
program is executed using 8086 and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts of code conversions and
decimal arithmetic operations.








21 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


1. Write the function of the following 8085 instructions: JP, JPE, JPO, and JNZ.
2. What is the purpose of the following commands in 8086?
a) AAD
b) RCL
3. List out the addressing modes in 8086.
4. List out the various string instructions that are available in 8086.
5. What are the 8086 instructions used for BCD arithmetic?
6. What flags get affected after executing ADD instruction?
7. Which instruction is used to add immediate data?
8. What is BCD code? Where it is used?
9. What is ASCII code? Where it is used?
10. What is the difference between carry flag and overflow flag?
11. What are the special function register associated with interrupts?
12. List the flags affected by arithmetic instructions.
13. After executing ADDC instruction, what flags get affected?
14. How many bytes the instruction ADDC will add?
15. Name the signals used by the processor to communicate with an I/O processor
16. What is the function of IP?
17. What is the use of base pointer register?
18. Mention the index registers of 8086.
19. How many memory locations are available in 8086 microprocessor?
20. What are the flags in 8086? What are the various interrupts in 8086?
Applications:
1. Programmable calculators
2. Counting system using counts the tennis ball
3. Detecting and Correcting an Error with the Hamming Code
4. Power tool
5. Radio clocks
Viva ? voce
22 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.3 MOVE A DATA BLOCK WITHOUT OVERLAP
Aim:
To write an assembly language program to move a block of data to another memory location and execute it
using 8086
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Algorithm:
1. Initialize the source and destination memory location to SI and DI register
2. Initialize the counter (CL register)
3. Move the data to designation memory through AL register
4. Decrement the count
5. Check for zero flag and if zero flag is set go to next step
6. else go to step 3
7. Stop
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
23 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


Program:
Address Label Mnemonics
1000 MOV CL, 08
1003 MOV SI, 1200
1007 MOV DI, 1300
100B L1 LOD SB
100C MOV [DI], AL
100E INC DI
100F DEC CL
1011 JNZ L1
1013 HLT

Tabulation:
Input Output
Address Data Address Data




Result:
Thus an Assembly Language Program for moving data to another location is written the program is
executed using 8086 and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts and write the ALP program for
moving data to another location.



24 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00



1. List out the Flag manipulation instruction.
2. Define ? Variables
3. Define ? Segment Override Prefix
4. How is the memory segment accessed by 8086 microprocessor identified?
5. List out the advantages of using Direct Memory Access (DMA).
6. What is BIOS function call in 8086? (May 2012)
7. List out the difference between procedures and Macros.
8. What is meant by maskable interrupts& non-maskable interrupts?
9. What is the Maximum clock frequency in 8086?
10. Which Stack is used in 8086?
11. Define ? Pipeline (Dec 2011)
12. How many address lines are available in 8086? What is the maximum address possible?
13. What is an assembler?( May 2012)
14. What is the purpose of LEA instruction in 8086? (May 2012)
15. Give the function of index and pointers in 8086.
16. What are the different instruction set of 8086?
17. Give the various addressing modes in 8086.
18. Give the differences between JUMP and LOOP instruction.
19. Give the physical address formation of any two addressing mode.
20. Give the use of ?ASSUME? in 8086 programming.
Applications:
1. Priority Encoder
2. DVD players
3. Cellular telephones
4. Household appliances
5. Car equipment
Viva ? voce
25 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.4 MATRIX OPERATIONS
Aim:
To write an assembly language program to perform matrix addition and to execute it using 8086
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Algorithm:
1. Get the size (count) of the matrix
2. Initialize SI pointer for storing first matrix
3. Initialize DI pointer for storing second matrix
4. Move the contents pointed by SI pointer to accumulator
5. Move the contents pointed by DI pointer BL register
6. Add the contents of accumulator and BL register
7. Store result in the address pointed by DI pointer
8. Increment DI and SI pointer by 1 and Decrement count by 1
9. Check for zero. If no zero jump to step 4 else go to step 11
10. Stop the execution
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result

26 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV CL, 09
1003 MOV SI, 1100
1007 MOV DI, 1200
100B L1 MOV AL, [SI]
100D MOV BL, [DI]
100F ADD AL, BL
1011 MOV [DI], AL
1013 INC SI
1014 INC DI
1015 DEC CL
1017 JNZ L1
1019 HLT

Tabulation:
Input Output
Address Data Address Data



Result:
Thus an assembly language program for matrix addition was written. It is executed using 8086
microprocessor and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts of moving and adding the group
of data from one location to another location.







27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


1. Write an ALP for 8086 to multiply two 16 bit unsigned numbers.
2. What is an accumulator?
3. List out the segment register available in 8086.
4. List out any four program control instructions that are available in 8086.
5. What is program counter?
6. Give any four logical instructions in 8086.
7. How many memory locations are available in 8086 microprocessor?
8. What are the general purposes registers in 8086?
9. What are the functional units in 8086?
10. How much memory location allotted for the particular segments registers in 8086?
11. When the 8086 processor is in minimum mode and maximum mode?
12. Define ? Segment Override Prefix.
13. Define ? Macro and Procedure
14. Define ? Assembler and assembler directives
15. Define ? Compiler and Linker
16. What is meant by modular programming?
17. Explain the uses of PUSH and POP instruction.
18. Explain the uses of CALL and RET instruction.
19. Identify the addressing modes in the following instructions.
AND AL, BL
SUB AL, 24H
MOV AL, (BP)
MOV CX, 1245H
20. What are the 8086 instructions used for BCD arithmetic?

Applications:
1. Toys
2. Light switches and dimmers
3. Electrical circuit breakers
4. Smoke alarms
5. Battery packs


Viva ? voce
28 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.5 SEARCHING AND SORTING A STRING IN A
GIVEN ARRAY
a) Searching a String in a Given Array:
Aim:
To write an assembly language program to search a string in the given array and to execute it using 8086
kit.
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Algorithm:
1. Initialize the source and destination memory in SI and DI register
2. Initialize the count (CL) and Load the string values to any register (DL)
3. Move string to AL register and Compare the register (DL and AL)
4. Check for zero flag and if it is set jump to step 7 else go to step 9
5. Store the value of AL register
6. Increment DI register by one, Increment SI register by one and Decrement CL register by one
7. Check for zero flag and if it is set jump to step 12 else go to step 4
8. Stop the execution
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Type the Assembly Language Program
6. Press ?RESET? key
To executive the program
7. Press ?GO?
8. Type the starting address to execute the program
9. Press ?RESET? key
To verify the result
29 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

10. Type ?SB(Substitute Byte)?
11. Enter the output address location to check the result
Program:
Address Label Mnemonics
1000 MOV DI, 1300
1004 MOV SI, 1200
1008 MOV CL, 06
100B MOV DL, 02
100E L1 MOV AL, [SI]
1010 CMP DL, AL
1012 JNZ L2
1014 MOV [DI], AL
1016 INC DI
1017 L2 INC SI
1018 DEC CL
101A JNZ L1
101C HLT

Tabulation:
Input Output
Address Data Address Data


Result:
Thus an assembly language program to search a string in the string in the given array is written. The
program is executed using 8086 and the output is verified.






30 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

b) Sorting an Array of Data Using 8086:
Aim:
To write an assembly language program to sort an array of data in ascending and descending order and
execute it using 8086 kit
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
1. Ascending Order:
Algorithm:
1. Set SI as pointer for array
2. Set CL as outer loop counter
3. Initialize array pointer
4. Set CH as inner loop counter
5. Increment array pointer
6. Get the first element of array
7. Increment array pointer and Compare the two elements
31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

8. Checks carry flag. If carry flag is set go to step 11 else go to step 10
9. Swap the content of the memory location
10. Decrement the inner loop counter
11. Check zero flag. If it is set go to step 13 else go to step 7
12. Decrement outer loop counter
13. Check zero flag. If it is set go to step 15 else go to step 3 and stop
Program:
Address Label Mnemonics
1000 MOV SI, 1100H
1004 MOV CL, [SI]
1006 DEC CL
008 Repeat MOV SI, 1100H
100C MOV CH, [SI]
100E DEC CH
1010 INC SI
1011 Rep MOV AL, [SI]
1013 INC SI
1014 CMP AL, [SI]
1016 JC Ahead
1018 XCHG AL, [SI]
101A XCHG AL, [SI-1]
101D Ahead DEC CH
101F JNZ Rep
1021 DEC CL
1023 JNZ Repeat
1025 HLT
Tabulation:
Input Output
Address Data Address Data



32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

2. Descending Order:
Algorithm:
1. Set SI as pointer for array
2. Set CL as outer loop counter
3. Initialize array pointer
4. Set CH as inner loop counter
5. Increment array pointer Get the first element of array
6. Increment array pointer
7. Compare the two elements
8. Checks carry flag. If carry flag is set go to step 11 else go to step 10
9. Swap the content of the memory location
10. Decrement the inner loop counter
11. Check zero flag. If it is set go to step 13 else go to step 7
12. Decrement outer loop counter
13. Check zero flag. If it is set go to step 15 else go to step 3
14. Stop
Program:
Address Label Mnemonics
1000 MOV SI, 1100H
1004 MOV CL, [SI]
1006 DEC CL
1008 Repeat MOV SI, 1100H
100C MOV CH, [SI]
100E DEC CH
1010 INC SI
1011 Rep MOV AL, [SI]
1013 INC SI
1014 CMP AL, [SI]
1016 JNC Ahead
1018 XCHG AL, [SI]
101A XCHG AL, [SI-1]
101D Ahead DEC CH
101F JNZ Rep
1021 DEC CL
1023 JNZ Repeat
1025 HLT

33 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


Result:
Thus an assembly language program is written to sort an array of data in ascending and descending order.
The program is executed using 8086 and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts and write the Assembly
Language Program for Searching and Sorting.

1. What is the relation between 8086 processor frequency & crystal Frequency?
2. What is the position of the stack pointer after the POP instruction?
3. Compare CALL and JMP instructions.
4. Define ? Baud Rate
5. What is the size of instruction queue in 8086?
6. Compare JNC and JMP instructions.
7. What happens when HLT instruction is executed in processor?
8. What is the maximum internal clock frequency of 8086 processor?
9. What are the functions of BIU?
10. Write an ALP program to search a number 05 from a given array.
11. What is cache memory?
12. Can ROM be used as stack?
13. What are the 8086 instructions used for BCD arithmetic?
14. What are the 8086 instructions used for ASCII arithmetic?
15. List the various string instructions available in 8086.
16. How will carry and zero flags reflect the result of instruction CMP BX, CX?
17. Give any four miscellaneous instructions in 16-bit Microprocessor
18. List the flags in 8086 and state its functions.
19. What is the purpose of segment registers in 8086?
20. What is virtual addressing mode?

Viva ? voce
34 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Applications:
1. Car keys
2. Power tool
3. Home security system
4. Dishwashers
5. Washing machines
35 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.6 PASSWORD CHECKING AND PRINT RAM SIZE
WITH SYSTEM DATE
Aim:
To write an assembly language program to Check Password.
Apparatus required:
1. Personal Computer
2. MASM Software
Procedure:
1. Go to Start, Programs, MS-DOS Prompt (or Command Window). Once the DOS window is open, type
the command EDIT. Type your file and save it to your .ASM directory. Be sure it has a .ASM
extension. Do not close the DOS window or the editor.
2. Go to Start, Programs, MS-DOS Prompt (or Command Window). This will open a second DOS
window. Change to your .ASM directory and issue the commands to run MASM.
3. Click compile, link and run it.
a) C: cd \COP3402
b) MASM/L FIRST.ASM
c) LINK FIRST.OBJ
d) FIRST.EXE
4. For errors after issuing the MASM command, fix the .ASM file and redo the above steps.
5. open the file FIRST.LST to clear all errors
6. Click compile, link and run it.
a) MASM/L FIRST.ASM
b) LINK FIRST.OBJ
c) FIRST.EXE
Program:
.MODEL SMALL
.DATA
PASS DB ?ABC?
MES1 DB 10,13,?ENTER 3 CHARACTER PASSWORD $?
MES2 DB 10,13,?PASSWORD IS CORRECT $?
MES3 DB 10,13,?PASSWORD ID WRONG $ ?
.CODE
START: MOV AX,@DATA
MOV DS,AX
MOV AH,09H
LEA DX,MES1
INT 21H
FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING


EC6513 ? MICROPROCESSOR AND MICROCONTROLLERLABORATORY


V SEMESTER - R 2013










Name : _______________________________________
Register No. : _______________________________________
Section : _______________________________________



LABORATORY MANUAL
2 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY


C01 - To learn the working of ARM processor
C02 - To introduce ALP concepts and features
C03 - To write ALP for arithmetic and logical operations in 8086 and 8051
C04 - To differentiate Serial and Parallel Interface
C05 - To interface different I/Os with Microprocessors
C06 - To be familiar with MASM
.




1. Write programs in ARM for a specific Application
2. Write ALP Programs for fixed and Floating Point and Arithmetic
3. Interface different I/Os with processor and Generate waveforms using Microprocessors
4. Execute Programs in 8051
5. Assess the performance of optical devices: light sources, fibers and detectors from both physical and system
point of view

INTRODUCTION
This course illustrates the concepts covered in course CS6412 and provides students with hands-on
experience in Assembly language programs.
PREREQUISITE:
1. Digital Electronics
EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
Lecture
No./Session No.
Name of the Experiment
Course
objectives
Proposed
date

1,2,3
Introduction to lab
CO1

CYCLE I - 8086 PROGRAMS USING KITS AND MASM
4,5,6 Basic arithmetic and Logical operations CO2
COURSE OBJECTIVES
COURSE OUTCOMES
3 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00













7,8,9 Decimal arithmetic and Code conversion CO3
10,11,12
Move a data block without overlap
CO3
Matrix operations
13,14,15 Searching and Sorting a sting in a given array CO2
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
16,17,18 D/A interface and Waveform Generation CO4
19,20,21 A/D interface CO5
22,23,24 Key board and Display CO5
25,26,27
Stepper motor control CO2
Traffic light control CO5
28,29,30
Digital clock CO6
Serial interface and Parallel interface CO4
CYCLE III - 8051 PROGRAMS USING KITS AND MASM
31,32,33 Basic arithmetic and Logical operations CO1
34,35,36
Square and Cube program, Find 2?s complement of a number
CO5
Unpacked BCD to ASCII
37,38,39
Password checking and Print RAM size with system date
CO6
Counters and Time Delay
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
40,41,42 Sorting of an array using 8051 CO2
43,44,45
Separate odd and even numbers using 8086


CO3
Sum of N consecutive numbers using 8086
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00




College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING




To impart professional education integrated with human values to the younger generation, so as to shape
them as proficient and dedicated engineers, capable of providing comprehensive solutions to the challenges in
deploying technology for the service of humanity



? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices


VISION
MISSION
VISION
MISSION
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of
engineering that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this
enables to find solutions for real time problem in industry and organization and to design products
requiring interdisciplinary skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up
their communication skills, individual leadership and supportive qualities and to develop them to adapt and
work in ever changing technologies
5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees











6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer
Science and Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the
career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both
verbal and written forms
i) To work in a team as team member or a leader and make unique contributions and work with
coordination
j) To engage lifelong learning and exhibit their technical skills
k) To develop and manage projects in multidisciplinary environments










7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER
LABORATORY
SYLLABUS

? To learn the working of ARM processor
? To introduce ALP concepts and features
? To write ALP for arithmetic and logical operations in 8086 and 8051
? To differentiate Serial and Parallel Interface
? To interface different I/Os with Microprocessors
? To be familiar with MASM
LIST OF EXPERIMENTS:
8086 Programs using kits and MASM
1. Basic arithmetic and Logical operations
2. Move a data block without overlap
3. Code conversion, decimal arithmetic and Matrix operations.
4. Floating point operations, string manipulations, sorting and searching
5. Password checking, Print RAM size and system date
6. Counters and Time Delay
Peripherals and Interfacing Experiments
7. Traffic light control
8. Stepper motor control
9. Digital clock
10. Key board and Display
11. Printer status
12. Serial interface and Parallel interface
13. A/D and D/A interface and Waveform Generation 8051
Experiments using kits and MASM
14. Basic arithmetic and Logical operations
15. Square and Cube program, Find 2 ?s complement of a number
16. Unpacked BCD to ASCII

? Write programs in ARM for a specific Application
? Write ALP Programs for fixed and Floating Point and Arithmetic
? Interface different I/Os with processor and Generate waveforms using Microprocessors
? Execute Programs in 8051
? Assess the performance of optical devices: light sources, fibers and detectors from both physical and
system point of view


COURSE OUTCOMES
COURSE OBJECTIVES
8 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 - 8086 PROGRAMS USING KITS AND MASM
1 Basic arithmetic and Logical operations 10
2 Decimal arithmetic and Code conversion 15
3 Move a data block without overlap 21
4 Matrix operations 24
5 Searching and Sorting a sting in a given array 27
6 Password checking and Print RAM size with system date 33
7 Counters and Time Delay 36
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
8 Stepper motor control 39
9 Traffic light control 42
10 Digital clock 47
11 Serial interface and Parallel interface 50
12 A/D interface 54
13 Key board and Display 57
14 D/A interface and Waveform Generation 60
CYCLE 3 - 8051 PROGRAMS USING KITS AND MASM
15 Basic arithmetic and Logical operations 64
16 Square and Cube program, Find 2?s complement of a number 69
17 Unpacked BCD to ASCII 71
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
18 Sorting of an array using 8051 74
19 Separate odd and even numbers using 8086 77
20 Sum of N consecutive numbers using 8086 80

9 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.1 BASIC ARITHMETIC AND LOGICAL OPERATIONS

Aim:
To write an Assembly Language Program to perform Arithmetic operation and to execute using 8086
microprocessor
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
Arithmetic Operation:
1. Addition:
Algorithm:
1. Clear BL register to store carry
2. Get the addend in AX register pair
3. Get the Augend in CX register pair
4. Add Augend and addend
5. Check for carry, If it is one go to step 6 else go to step 7
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

6. Increments carry (BL register by 1)
7. Store the sum in memory from AX register pair
8. Store the carry in memory from BL register
9. Stop
Program:
Address
Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 1010H
1007 MOV CX, 2020H
100B CLC
100C ADD AX, CX
100E JNC Label1
1010 INC BL
1012 Label 1 MOV [1200], AX
1016 MOV [1202], BL
101A HLT
Precaution:
Make sure that all the machine codes should be as per the specified in the program.
Tabulation:
Input Output
Address Data Address Data








2. Subtraction:
Algorithm:
1. Clear BL register for storing borrow
2. Get the minuend in AX register pair
3. Get the subtrahend in CX register pair
4. Subtract minuend and subtrahend
5. Check borrow, if borrow is one go to step 6 else go to step 8
6. Increment borrow (BL register by 1)
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

7. Negate AX register
8. Store the difference from AX in memory
9. Story the borrow from BL in memory
10. Stop
Program:
Address Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 2024H
1007 MOV CX, 1010H
100B SUB AX, CX
100D JNC Label1
100F INC BL
1011 NEG AX
1013 Label 1 MOV [1200], AX
1017 MOV [1202], BL
101B HLT

Tabulation:
Input Output
Address Data Address Data






3. Multiplication
Algorithm:
1. Clear DX register
2. Load the AX register pair with multiplicand
3. Load the CX register pair with multiplier
4. Multiply multiplicand and multiplier
5. Store the higher byte of product(from DX register pair) in memory specified
6. Store the lower byte of product(from AX register pair) in memory specified
7. Stop
8.
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV DX, 0000H
1004 MOV AX, 00FFH
1008 MOV CX, 0002H
100C MUL CX
100E MOV [1200], AX
1012 MOV [1202], DX
1016 HLT
Tabulation:
Input Output
Address Data Address Data






4. Division:
Algorithm
1. Clear DX register
2. Load the AX register pair with dividend
3. Load the CX register pair with divisor
4. Dividend divided by divisor
5. Store the quotient (from AX register pair) in memory specified
6. Store the remainder (from DX register pair) in memory specified
7. Stop
Program:
Address Label Mnemonics
1000 MOV DX, 0000H
1004 MOV AX, 0008H
1008 MOV CX, 0004H
100C DIV CX
100E MOV [1200], AX
1012 MOV [1202], DX
1016 HLT

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


Result:
Thus Assembly language program are written to perform arithmetic operation using 8086 microprocessor.
They are executed using 8086 processor and the outputs are verified.
Outcome:
At the end of this experiment the students able to write ALP programs for Arithmetic and Logical operations.

1. Write the size of the data bus of 8086.
2. Write the size of the address bus of 8086.
3. What is meant by physical addressing in 8086?
4. What is meant by an Opcode?
5. What is meant by an Operand?
6. What is meant by a Mnemonics?
7. What are the other possibilities of writing ADD, SUB and MUL instructions in other addressing modes?
8. What is the difference between microprocessor and microcontroller?
9. What is meant by LATCH?
10. What is the difference between primary & secondary storage device?
11. What is the difference between static and dynamic RAM?
12. What is an interrupt?
13. Differentiate between RAM and ROM?
14. Define ? Compiler
15. Define ? Flag
16. Define ? Stack
17. How clock signal is generated in 8086 microprocessor?
18. State the functions of queue status line QS0 and QS1 in 8086 microprocessor.
19. What is the purpose of BIU& EU?
20. List out the two examples of assembler directives.

Viva ? voce
15 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Applications:
1. barrel shifters
2. Multiple-precision arithmetic
3. Calculation pipeline
4. binary multipliers
5. Calculation in a single clock

16 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.2 DECIMAL ARITHMETIC AND CODE CONVERSION
Aim:
To write an Assembly Language Program to perform Code conversion and Decimal Arithmetic operations
and to execute using 8086 microprocessor
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
Decimal Arithmetic:
1. Using DAA
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Clear the CL reg.
4. Add the contents of AL and BL.
5. Adjust decimal accumulator after addition.
6. Store the result.
17 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 MOV CL, 00
100B ADD AL,BL
100D DAA
100E JNC L1
1010 INC CL
1012 L1 MOV [1150], AL
1016 MOV [1151], CL
101A HLT

Tabulation:
Input Output
Address Data Address Data


2. Using AAM
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Multiply the contents of AL and BL.
4. Adjust decimal accumulator after multiplication.
5. Store the result.
Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 MUL BL
100A AAM
100C MOV [1150], AH
1010 MOV [1151], AL
1014 HLT

18 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


3. Using DAS
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Subtract the contents of BL from AL.
4. Adjust decimal accumulator after subtraction.
5. Store the result.
Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 SUB AL,BL
100A DAS
100B MOV [1150], AL
100F HLT
Tabulation:
Input Output
Address Data Address Data


Code Conversion:
1. Binary to BCD
Algorithm:
1. Get the input and store in AL.
2. Clear the carry flag.
3. Rotate right the bits of input.
4. Find logical XOR between input and shifted input.
5. Store the result.
19 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 XOR AX,AX
1002 XOR CX,CX
1004 MOV BX,000B
1008 L2 CMP BX,00
100C JZ L1
100E DEC BX
100F MOV AL,CL
1011 ADD AL,01
1014 DAA
1015 MOV CL,AL
1017 MOV AL,CH
1019 ADC AL,00
101C DAA
101D MOV CH,AL
101F JMP L2
1022 MOV [1150],CX
1026 HLT
Tabulation:
Input Output
Address Data Address Data




2. Binary to Gray
Algorithm:
1. Get the input and store in AL.
2. Clear the carry flag.
3. Rotate right the bits of input.
4. Find logical XOR between input and shifted input.
5. Store the result.

20 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, AL
1006 CLC
1007 MOV CL,01
100A RCR AL,CL
100C XOR BL,AL
100E MOV [1150],BL
1012 HLT
Tabulation:
Input Output
Address Data Address Data


Result:
Thus an Assembly Language Program for code conversion and decimal arithmetic operations is written. The
program is executed using 8086 and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts of code conversions and
decimal arithmetic operations.








21 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


1. Write the function of the following 8085 instructions: JP, JPE, JPO, and JNZ.
2. What is the purpose of the following commands in 8086?
a) AAD
b) RCL
3. List out the addressing modes in 8086.
4. List out the various string instructions that are available in 8086.
5. What are the 8086 instructions used for BCD arithmetic?
6. What flags get affected after executing ADD instruction?
7. Which instruction is used to add immediate data?
8. What is BCD code? Where it is used?
9. What is ASCII code? Where it is used?
10. What is the difference between carry flag and overflow flag?
11. What are the special function register associated with interrupts?
12. List the flags affected by arithmetic instructions.
13. After executing ADDC instruction, what flags get affected?
14. How many bytes the instruction ADDC will add?
15. Name the signals used by the processor to communicate with an I/O processor
16. What is the function of IP?
17. What is the use of base pointer register?
18. Mention the index registers of 8086.
19. How many memory locations are available in 8086 microprocessor?
20. What are the flags in 8086? What are the various interrupts in 8086?
Applications:
1. Programmable calculators
2. Counting system using counts the tennis ball
3. Detecting and Correcting an Error with the Hamming Code
4. Power tool
5. Radio clocks
Viva ? voce
22 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.3 MOVE A DATA BLOCK WITHOUT OVERLAP
Aim:
To write an assembly language program to move a block of data to another memory location and execute it
using 8086
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Algorithm:
1. Initialize the source and destination memory location to SI and DI register
2. Initialize the counter (CL register)
3. Move the data to designation memory through AL register
4. Decrement the count
5. Check for zero flag and if zero flag is set go to next step
6. else go to step 3
7. Stop
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
23 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


Program:
Address Label Mnemonics
1000 MOV CL, 08
1003 MOV SI, 1200
1007 MOV DI, 1300
100B L1 LOD SB
100C MOV [DI], AL
100E INC DI
100F DEC CL
1011 JNZ L1
1013 HLT

Tabulation:
Input Output
Address Data Address Data




Result:
Thus an Assembly Language Program for moving data to another location is written the program is
executed using 8086 and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts and write the ALP program for
moving data to another location.



24 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00



1. List out the Flag manipulation instruction.
2. Define ? Variables
3. Define ? Segment Override Prefix
4. How is the memory segment accessed by 8086 microprocessor identified?
5. List out the advantages of using Direct Memory Access (DMA).
6. What is BIOS function call in 8086? (May 2012)
7. List out the difference between procedures and Macros.
8. What is meant by maskable interrupts& non-maskable interrupts?
9. What is the Maximum clock frequency in 8086?
10. Which Stack is used in 8086?
11. Define ? Pipeline (Dec 2011)
12. How many address lines are available in 8086? What is the maximum address possible?
13. What is an assembler?( May 2012)
14. What is the purpose of LEA instruction in 8086? (May 2012)
15. Give the function of index and pointers in 8086.
16. What are the different instruction set of 8086?
17. Give the various addressing modes in 8086.
18. Give the differences between JUMP and LOOP instruction.
19. Give the physical address formation of any two addressing mode.
20. Give the use of ?ASSUME? in 8086 programming.
Applications:
1. Priority Encoder
2. DVD players
3. Cellular telephones
4. Household appliances
5. Car equipment
Viva ? voce
25 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.4 MATRIX OPERATIONS
Aim:
To write an assembly language program to perform matrix addition and to execute it using 8086
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Algorithm:
1. Get the size (count) of the matrix
2. Initialize SI pointer for storing first matrix
3. Initialize DI pointer for storing second matrix
4. Move the contents pointed by SI pointer to accumulator
5. Move the contents pointed by DI pointer BL register
6. Add the contents of accumulator and BL register
7. Store result in the address pointed by DI pointer
8. Increment DI and SI pointer by 1 and Decrement count by 1
9. Check for zero. If no zero jump to step 4 else go to step 11
10. Stop the execution
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result

26 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV CL, 09
1003 MOV SI, 1100
1007 MOV DI, 1200
100B L1 MOV AL, [SI]
100D MOV BL, [DI]
100F ADD AL, BL
1011 MOV [DI], AL
1013 INC SI
1014 INC DI
1015 DEC CL
1017 JNZ L1
1019 HLT

Tabulation:
Input Output
Address Data Address Data



Result:
Thus an assembly language program for matrix addition was written. It is executed using 8086
microprocessor and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts of moving and adding the group
of data from one location to another location.







27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


1. Write an ALP for 8086 to multiply two 16 bit unsigned numbers.
2. What is an accumulator?
3. List out the segment register available in 8086.
4. List out any four program control instructions that are available in 8086.
5. What is program counter?
6. Give any four logical instructions in 8086.
7. How many memory locations are available in 8086 microprocessor?
8. What are the general purposes registers in 8086?
9. What are the functional units in 8086?
10. How much memory location allotted for the particular segments registers in 8086?
11. When the 8086 processor is in minimum mode and maximum mode?
12. Define ? Segment Override Prefix.
13. Define ? Macro and Procedure
14. Define ? Assembler and assembler directives
15. Define ? Compiler and Linker
16. What is meant by modular programming?
17. Explain the uses of PUSH and POP instruction.
18. Explain the uses of CALL and RET instruction.
19. Identify the addressing modes in the following instructions.
AND AL, BL
SUB AL, 24H
MOV AL, (BP)
MOV CX, 1245H
20. What are the 8086 instructions used for BCD arithmetic?

Applications:
1. Toys
2. Light switches and dimmers
3. Electrical circuit breakers
4. Smoke alarms
5. Battery packs


Viva ? voce
28 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.5 SEARCHING AND SORTING A STRING IN A
GIVEN ARRAY
a) Searching a String in a Given Array:
Aim:
To write an assembly language program to search a string in the given array and to execute it using 8086
kit.
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Algorithm:
1. Initialize the source and destination memory in SI and DI register
2. Initialize the count (CL) and Load the string values to any register (DL)
3. Move string to AL register and Compare the register (DL and AL)
4. Check for zero flag and if it is set jump to step 7 else go to step 9
5. Store the value of AL register
6. Increment DI register by one, Increment SI register by one and Decrement CL register by one
7. Check for zero flag and if it is set jump to step 12 else go to step 4
8. Stop the execution
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Type the Assembly Language Program
6. Press ?RESET? key
To executive the program
7. Press ?GO?
8. Type the starting address to execute the program
9. Press ?RESET? key
To verify the result
29 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

10. Type ?SB(Substitute Byte)?
11. Enter the output address location to check the result
Program:
Address Label Mnemonics
1000 MOV DI, 1300
1004 MOV SI, 1200
1008 MOV CL, 06
100B MOV DL, 02
100E L1 MOV AL, [SI]
1010 CMP DL, AL
1012 JNZ L2
1014 MOV [DI], AL
1016 INC DI
1017 L2 INC SI
1018 DEC CL
101A JNZ L1
101C HLT

Tabulation:
Input Output
Address Data Address Data


Result:
Thus an assembly language program to search a string in the string in the given array is written. The
program is executed using 8086 and the output is verified.






30 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

b) Sorting an Array of Data Using 8086:
Aim:
To write an assembly language program to sort an array of data in ascending and descending order and
execute it using 8086 kit
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
1. Ascending Order:
Algorithm:
1. Set SI as pointer for array
2. Set CL as outer loop counter
3. Initialize array pointer
4. Set CH as inner loop counter
5. Increment array pointer
6. Get the first element of array
7. Increment array pointer and Compare the two elements
31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

8. Checks carry flag. If carry flag is set go to step 11 else go to step 10
9. Swap the content of the memory location
10. Decrement the inner loop counter
11. Check zero flag. If it is set go to step 13 else go to step 7
12. Decrement outer loop counter
13. Check zero flag. If it is set go to step 15 else go to step 3 and stop
Program:
Address Label Mnemonics
1000 MOV SI, 1100H
1004 MOV CL, [SI]
1006 DEC CL
008 Repeat MOV SI, 1100H
100C MOV CH, [SI]
100E DEC CH
1010 INC SI
1011 Rep MOV AL, [SI]
1013 INC SI
1014 CMP AL, [SI]
1016 JC Ahead
1018 XCHG AL, [SI]
101A XCHG AL, [SI-1]
101D Ahead DEC CH
101F JNZ Rep
1021 DEC CL
1023 JNZ Repeat
1025 HLT
Tabulation:
Input Output
Address Data Address Data



32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

2. Descending Order:
Algorithm:
1. Set SI as pointer for array
2. Set CL as outer loop counter
3. Initialize array pointer
4. Set CH as inner loop counter
5. Increment array pointer Get the first element of array
6. Increment array pointer
7. Compare the two elements
8. Checks carry flag. If carry flag is set go to step 11 else go to step 10
9. Swap the content of the memory location
10. Decrement the inner loop counter
11. Check zero flag. If it is set go to step 13 else go to step 7
12. Decrement outer loop counter
13. Check zero flag. If it is set go to step 15 else go to step 3
14. Stop
Program:
Address Label Mnemonics
1000 MOV SI, 1100H
1004 MOV CL, [SI]
1006 DEC CL
1008 Repeat MOV SI, 1100H
100C MOV CH, [SI]
100E DEC CH
1010 INC SI
1011 Rep MOV AL, [SI]
1013 INC SI
1014 CMP AL, [SI]
1016 JNC Ahead
1018 XCHG AL, [SI]
101A XCHG AL, [SI-1]
101D Ahead DEC CH
101F JNZ Rep
1021 DEC CL
1023 JNZ Repeat
1025 HLT

33 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


Result:
Thus an assembly language program is written to sort an array of data in ascending and descending order.
The program is executed using 8086 and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts and write the Assembly
Language Program for Searching and Sorting.

1. What is the relation between 8086 processor frequency & crystal Frequency?
2. What is the position of the stack pointer after the POP instruction?
3. Compare CALL and JMP instructions.
4. Define ? Baud Rate
5. What is the size of instruction queue in 8086?
6. Compare JNC and JMP instructions.
7. What happens when HLT instruction is executed in processor?
8. What is the maximum internal clock frequency of 8086 processor?
9. What are the functions of BIU?
10. Write an ALP program to search a number 05 from a given array.
11. What is cache memory?
12. Can ROM be used as stack?
13. What are the 8086 instructions used for BCD arithmetic?
14. What are the 8086 instructions used for ASCII arithmetic?
15. List the various string instructions available in 8086.
16. How will carry and zero flags reflect the result of instruction CMP BX, CX?
17. Give any four miscellaneous instructions in 16-bit Microprocessor
18. List the flags in 8086 and state its functions.
19. What is the purpose of segment registers in 8086?
20. What is virtual addressing mode?

Viva ? voce
34 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Applications:
1. Car keys
2. Power tool
3. Home security system
4. Dishwashers
5. Washing machines
35 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.6 PASSWORD CHECKING AND PRINT RAM SIZE
WITH SYSTEM DATE
Aim:
To write an assembly language program to Check Password.
Apparatus required:
1. Personal Computer
2. MASM Software
Procedure:
1. Go to Start, Programs, MS-DOS Prompt (or Command Window). Once the DOS window is open, type
the command EDIT. Type your file and save it to your .ASM directory. Be sure it has a .ASM
extension. Do not close the DOS window or the editor.
2. Go to Start, Programs, MS-DOS Prompt (or Command Window). This will open a second DOS
window. Change to your .ASM directory and issue the commands to run MASM.
3. Click compile, link and run it.
a) C: cd \COP3402
b) MASM/L FIRST.ASM
c) LINK FIRST.OBJ
d) FIRST.EXE
4. For errors after issuing the MASM command, fix the .ASM file and redo the above steps.
5. open the file FIRST.LST to clear all errors
6. Click compile, link and run it.
a) MASM/L FIRST.ASM
b) LINK FIRST.OBJ
c) FIRST.EXE
Program:
.MODEL SMALL
.DATA
PASS DB ?ABC?
MES1 DB 10,13,?ENTER 3 CHARACTER PASSWORD $?
MES2 DB 10,13,?PASSWORD IS CORRECT $?
MES3 DB 10,13,?PASSWORD ID WRONG $ ?
.CODE
START: MOV AX,@DATA
MOV DS,AX
MOV AH,09H
LEA DX,MES1
INT 21H
36 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

MOV CL,00
MOV DL,OOH
XOR DI,DI
.WHILE CL!=3
MOV AH,07H
INT 21H
LEA BX,PASS
MOV AH,[BX+DI]
.IF AL==AH
ADD DL,01
.ENDIF
INC DI
INC CL
.ENDW
.IF DL==3
MOV AH,09H
LEA DX,MES2
INT 21H
.ELSE
MOV AH,09H
LEA DX,MES3
INT 21H
.ENDIF
MOV AH,4CH
INT 21H
END START
END
Result:
Thus the given password is checked and the result is verified.
Outcome:
At the end of this experiment the students able to understand the concepts of password checking and print
ram size with system date.








FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING


EC6513 ? MICROPROCESSOR AND MICROCONTROLLERLABORATORY


V SEMESTER - R 2013










Name : _______________________________________
Register No. : _______________________________________
Section : _______________________________________



LABORATORY MANUAL
2 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY


C01 - To learn the working of ARM processor
C02 - To introduce ALP concepts and features
C03 - To write ALP for arithmetic and logical operations in 8086 and 8051
C04 - To differentiate Serial and Parallel Interface
C05 - To interface different I/Os with Microprocessors
C06 - To be familiar with MASM
.




1. Write programs in ARM for a specific Application
2. Write ALP Programs for fixed and Floating Point and Arithmetic
3. Interface different I/Os with processor and Generate waveforms using Microprocessors
4. Execute Programs in 8051
5. Assess the performance of optical devices: light sources, fibers and detectors from both physical and system
point of view

INTRODUCTION
This course illustrates the concepts covered in course CS6412 and provides students with hands-on
experience in Assembly language programs.
PREREQUISITE:
1. Digital Electronics
EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
Lecture
No./Session No.
Name of the Experiment
Course
objectives
Proposed
date

1,2,3
Introduction to lab
CO1

CYCLE I - 8086 PROGRAMS USING KITS AND MASM
4,5,6 Basic arithmetic and Logical operations CO2
COURSE OBJECTIVES
COURSE OUTCOMES
3 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00













7,8,9 Decimal arithmetic and Code conversion CO3
10,11,12
Move a data block without overlap
CO3
Matrix operations
13,14,15 Searching and Sorting a sting in a given array CO2
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
16,17,18 D/A interface and Waveform Generation CO4
19,20,21 A/D interface CO5
22,23,24 Key board and Display CO5
25,26,27
Stepper motor control CO2
Traffic light control CO5
28,29,30
Digital clock CO6
Serial interface and Parallel interface CO4
CYCLE III - 8051 PROGRAMS USING KITS AND MASM
31,32,33 Basic arithmetic and Logical operations CO1
34,35,36
Square and Cube program, Find 2?s complement of a number
CO5
Unpacked BCD to ASCII
37,38,39
Password checking and Print RAM size with system date
CO6
Counters and Time Delay
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
40,41,42 Sorting of an array using 8051 CO2
43,44,45
Separate odd and even numbers using 8086


CO3
Sum of N consecutive numbers using 8086
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00




College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING




To impart professional education integrated with human values to the younger generation, so as to shape
them as proficient and dedicated engineers, capable of providing comprehensive solutions to the challenges in
deploying technology for the service of humanity



? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices


VISION
MISSION
VISION
MISSION
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of
engineering that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this
enables to find solutions for real time problem in industry and organization and to design products
requiring interdisciplinary skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up
their communication skills, individual leadership and supportive qualities and to develop them to adapt and
work in ever changing technologies
5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees











6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer
Science and Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the
career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both
verbal and written forms
i) To work in a team as team member or a leader and make unique contributions and work with
coordination
j) To engage lifelong learning and exhibit their technical skills
k) To develop and manage projects in multidisciplinary environments










7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER
LABORATORY
SYLLABUS

? To learn the working of ARM processor
? To introduce ALP concepts and features
? To write ALP for arithmetic and logical operations in 8086 and 8051
? To differentiate Serial and Parallel Interface
? To interface different I/Os with Microprocessors
? To be familiar with MASM
LIST OF EXPERIMENTS:
8086 Programs using kits and MASM
1. Basic arithmetic and Logical operations
2. Move a data block without overlap
3. Code conversion, decimal arithmetic and Matrix operations.
4. Floating point operations, string manipulations, sorting and searching
5. Password checking, Print RAM size and system date
6. Counters and Time Delay
Peripherals and Interfacing Experiments
7. Traffic light control
8. Stepper motor control
9. Digital clock
10. Key board and Display
11. Printer status
12. Serial interface and Parallel interface
13. A/D and D/A interface and Waveform Generation 8051
Experiments using kits and MASM
14. Basic arithmetic and Logical operations
15. Square and Cube program, Find 2 ?s complement of a number
16. Unpacked BCD to ASCII

? Write programs in ARM for a specific Application
? Write ALP Programs for fixed and Floating Point and Arithmetic
? Interface different I/Os with processor and Generate waveforms using Microprocessors
? Execute Programs in 8051
? Assess the performance of optical devices: light sources, fibers and detectors from both physical and
system point of view


COURSE OUTCOMES
COURSE OBJECTIVES
8 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 - 8086 PROGRAMS USING KITS AND MASM
1 Basic arithmetic and Logical operations 10
2 Decimal arithmetic and Code conversion 15
3 Move a data block without overlap 21
4 Matrix operations 24
5 Searching and Sorting a sting in a given array 27
6 Password checking and Print RAM size with system date 33
7 Counters and Time Delay 36
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
8 Stepper motor control 39
9 Traffic light control 42
10 Digital clock 47
11 Serial interface and Parallel interface 50
12 A/D interface 54
13 Key board and Display 57
14 D/A interface and Waveform Generation 60
CYCLE 3 - 8051 PROGRAMS USING KITS AND MASM
15 Basic arithmetic and Logical operations 64
16 Square and Cube program, Find 2?s complement of a number 69
17 Unpacked BCD to ASCII 71
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
18 Sorting of an array using 8051 74
19 Separate odd and even numbers using 8086 77
20 Sum of N consecutive numbers using 8086 80

9 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.1 BASIC ARITHMETIC AND LOGICAL OPERATIONS

Aim:
To write an Assembly Language Program to perform Arithmetic operation and to execute using 8086
microprocessor
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
Arithmetic Operation:
1. Addition:
Algorithm:
1. Clear BL register to store carry
2. Get the addend in AX register pair
3. Get the Augend in CX register pair
4. Add Augend and addend
5. Check for carry, If it is one go to step 6 else go to step 7
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

6. Increments carry (BL register by 1)
7. Store the sum in memory from AX register pair
8. Store the carry in memory from BL register
9. Stop
Program:
Address
Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 1010H
1007 MOV CX, 2020H
100B CLC
100C ADD AX, CX
100E JNC Label1
1010 INC BL
1012 Label 1 MOV [1200], AX
1016 MOV [1202], BL
101A HLT
Precaution:
Make sure that all the machine codes should be as per the specified in the program.
Tabulation:
Input Output
Address Data Address Data








2. Subtraction:
Algorithm:
1. Clear BL register for storing borrow
2. Get the minuend in AX register pair
3. Get the subtrahend in CX register pair
4. Subtract minuend and subtrahend
5. Check borrow, if borrow is one go to step 6 else go to step 8
6. Increment borrow (BL register by 1)
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

7. Negate AX register
8. Store the difference from AX in memory
9. Story the borrow from BL in memory
10. Stop
Program:
Address Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 2024H
1007 MOV CX, 1010H
100B SUB AX, CX
100D JNC Label1
100F INC BL
1011 NEG AX
1013 Label 1 MOV [1200], AX
1017 MOV [1202], BL
101B HLT

Tabulation:
Input Output
Address Data Address Data






3. Multiplication
Algorithm:
1. Clear DX register
2. Load the AX register pair with multiplicand
3. Load the CX register pair with multiplier
4. Multiply multiplicand and multiplier
5. Store the higher byte of product(from DX register pair) in memory specified
6. Store the lower byte of product(from AX register pair) in memory specified
7. Stop
8.
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV DX, 0000H
1004 MOV AX, 00FFH
1008 MOV CX, 0002H
100C MUL CX
100E MOV [1200], AX
1012 MOV [1202], DX
1016 HLT
Tabulation:
Input Output
Address Data Address Data






4. Division:
Algorithm
1. Clear DX register
2. Load the AX register pair with dividend
3. Load the CX register pair with divisor
4. Dividend divided by divisor
5. Store the quotient (from AX register pair) in memory specified
6. Store the remainder (from DX register pair) in memory specified
7. Stop
Program:
Address Label Mnemonics
1000 MOV DX, 0000H
1004 MOV AX, 0008H
1008 MOV CX, 0004H
100C DIV CX
100E MOV [1200], AX
1012 MOV [1202], DX
1016 HLT

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


Result:
Thus Assembly language program are written to perform arithmetic operation using 8086 microprocessor.
They are executed using 8086 processor and the outputs are verified.
Outcome:
At the end of this experiment the students able to write ALP programs for Arithmetic and Logical operations.

1. Write the size of the data bus of 8086.
2. Write the size of the address bus of 8086.
3. What is meant by physical addressing in 8086?
4. What is meant by an Opcode?
5. What is meant by an Operand?
6. What is meant by a Mnemonics?
7. What are the other possibilities of writing ADD, SUB and MUL instructions in other addressing modes?
8. What is the difference between microprocessor and microcontroller?
9. What is meant by LATCH?
10. What is the difference between primary & secondary storage device?
11. What is the difference between static and dynamic RAM?
12. What is an interrupt?
13. Differentiate between RAM and ROM?
14. Define ? Compiler
15. Define ? Flag
16. Define ? Stack
17. How clock signal is generated in 8086 microprocessor?
18. State the functions of queue status line QS0 and QS1 in 8086 microprocessor.
19. What is the purpose of BIU& EU?
20. List out the two examples of assembler directives.

Viva ? voce
15 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Applications:
1. barrel shifters
2. Multiple-precision arithmetic
3. Calculation pipeline
4. binary multipliers
5. Calculation in a single clock

16 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.2 DECIMAL ARITHMETIC AND CODE CONVERSION
Aim:
To write an Assembly Language Program to perform Code conversion and Decimal Arithmetic operations
and to execute using 8086 microprocessor
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
Decimal Arithmetic:
1. Using DAA
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Clear the CL reg.
4. Add the contents of AL and BL.
5. Adjust decimal accumulator after addition.
6. Store the result.
17 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 MOV CL, 00
100B ADD AL,BL
100D DAA
100E JNC L1
1010 INC CL
1012 L1 MOV [1150], AL
1016 MOV [1151], CL
101A HLT

Tabulation:
Input Output
Address Data Address Data


2. Using AAM
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Multiply the contents of AL and BL.
4. Adjust decimal accumulator after multiplication.
5. Store the result.
Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 MUL BL
100A AAM
100C MOV [1150], AH
1010 MOV [1151], AL
1014 HLT

18 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


3. Using DAS
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Subtract the contents of BL from AL.
4. Adjust decimal accumulator after subtraction.
5. Store the result.
Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 SUB AL,BL
100A DAS
100B MOV [1150], AL
100F HLT
Tabulation:
Input Output
Address Data Address Data


Code Conversion:
1. Binary to BCD
Algorithm:
1. Get the input and store in AL.
2. Clear the carry flag.
3. Rotate right the bits of input.
4. Find logical XOR between input and shifted input.
5. Store the result.
19 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 XOR AX,AX
1002 XOR CX,CX
1004 MOV BX,000B
1008 L2 CMP BX,00
100C JZ L1
100E DEC BX
100F MOV AL,CL
1011 ADD AL,01
1014 DAA
1015 MOV CL,AL
1017 MOV AL,CH
1019 ADC AL,00
101C DAA
101D MOV CH,AL
101F JMP L2
1022 MOV [1150],CX
1026 HLT
Tabulation:
Input Output
Address Data Address Data




2. Binary to Gray
Algorithm:
1. Get the input and store in AL.
2. Clear the carry flag.
3. Rotate right the bits of input.
4. Find logical XOR between input and shifted input.
5. Store the result.

20 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, AL
1006 CLC
1007 MOV CL,01
100A RCR AL,CL
100C XOR BL,AL
100E MOV [1150],BL
1012 HLT
Tabulation:
Input Output
Address Data Address Data


Result:
Thus an Assembly Language Program for code conversion and decimal arithmetic operations is written. The
program is executed using 8086 and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts of code conversions and
decimal arithmetic operations.








21 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


1. Write the function of the following 8085 instructions: JP, JPE, JPO, and JNZ.
2. What is the purpose of the following commands in 8086?
a) AAD
b) RCL
3. List out the addressing modes in 8086.
4. List out the various string instructions that are available in 8086.
5. What are the 8086 instructions used for BCD arithmetic?
6. What flags get affected after executing ADD instruction?
7. Which instruction is used to add immediate data?
8. What is BCD code? Where it is used?
9. What is ASCII code? Where it is used?
10. What is the difference between carry flag and overflow flag?
11. What are the special function register associated with interrupts?
12. List the flags affected by arithmetic instructions.
13. After executing ADDC instruction, what flags get affected?
14. How many bytes the instruction ADDC will add?
15. Name the signals used by the processor to communicate with an I/O processor
16. What is the function of IP?
17. What is the use of base pointer register?
18. Mention the index registers of 8086.
19. How many memory locations are available in 8086 microprocessor?
20. What are the flags in 8086? What are the various interrupts in 8086?
Applications:
1. Programmable calculators
2. Counting system using counts the tennis ball
3. Detecting and Correcting an Error with the Hamming Code
4. Power tool
5. Radio clocks
Viva ? voce
22 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.3 MOVE A DATA BLOCK WITHOUT OVERLAP
Aim:
To write an assembly language program to move a block of data to another memory location and execute it
using 8086
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Algorithm:
1. Initialize the source and destination memory location to SI and DI register
2. Initialize the counter (CL register)
3. Move the data to designation memory through AL register
4. Decrement the count
5. Check for zero flag and if zero flag is set go to next step
6. else go to step 3
7. Stop
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
23 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


Program:
Address Label Mnemonics
1000 MOV CL, 08
1003 MOV SI, 1200
1007 MOV DI, 1300
100B L1 LOD SB
100C MOV [DI], AL
100E INC DI
100F DEC CL
1011 JNZ L1
1013 HLT

Tabulation:
Input Output
Address Data Address Data




Result:
Thus an Assembly Language Program for moving data to another location is written the program is
executed using 8086 and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts and write the ALP program for
moving data to another location.



24 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00



1. List out the Flag manipulation instruction.
2. Define ? Variables
3. Define ? Segment Override Prefix
4. How is the memory segment accessed by 8086 microprocessor identified?
5. List out the advantages of using Direct Memory Access (DMA).
6. What is BIOS function call in 8086? (May 2012)
7. List out the difference between procedures and Macros.
8. What is meant by maskable interrupts& non-maskable interrupts?
9. What is the Maximum clock frequency in 8086?
10. Which Stack is used in 8086?
11. Define ? Pipeline (Dec 2011)
12. How many address lines are available in 8086? What is the maximum address possible?
13. What is an assembler?( May 2012)
14. What is the purpose of LEA instruction in 8086? (May 2012)
15. Give the function of index and pointers in 8086.
16. What are the different instruction set of 8086?
17. Give the various addressing modes in 8086.
18. Give the differences between JUMP and LOOP instruction.
19. Give the physical address formation of any two addressing mode.
20. Give the use of ?ASSUME? in 8086 programming.
Applications:
1. Priority Encoder
2. DVD players
3. Cellular telephones
4. Household appliances
5. Car equipment
Viva ? voce
25 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.4 MATRIX OPERATIONS
Aim:
To write an assembly language program to perform matrix addition and to execute it using 8086
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Algorithm:
1. Get the size (count) of the matrix
2. Initialize SI pointer for storing first matrix
3. Initialize DI pointer for storing second matrix
4. Move the contents pointed by SI pointer to accumulator
5. Move the contents pointed by DI pointer BL register
6. Add the contents of accumulator and BL register
7. Store result in the address pointed by DI pointer
8. Increment DI and SI pointer by 1 and Decrement count by 1
9. Check for zero. If no zero jump to step 4 else go to step 11
10. Stop the execution
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result

26 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV CL, 09
1003 MOV SI, 1100
1007 MOV DI, 1200
100B L1 MOV AL, [SI]
100D MOV BL, [DI]
100F ADD AL, BL
1011 MOV [DI], AL
1013 INC SI
1014 INC DI
1015 DEC CL
1017 JNZ L1
1019 HLT

Tabulation:
Input Output
Address Data Address Data



Result:
Thus an assembly language program for matrix addition was written. It is executed using 8086
microprocessor and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts of moving and adding the group
of data from one location to another location.







27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


1. Write an ALP for 8086 to multiply two 16 bit unsigned numbers.
2. What is an accumulator?
3. List out the segment register available in 8086.
4. List out any four program control instructions that are available in 8086.
5. What is program counter?
6. Give any four logical instructions in 8086.
7. How many memory locations are available in 8086 microprocessor?
8. What are the general purposes registers in 8086?
9. What are the functional units in 8086?
10. How much memory location allotted for the particular segments registers in 8086?
11. When the 8086 processor is in minimum mode and maximum mode?
12. Define ? Segment Override Prefix.
13. Define ? Macro and Procedure
14. Define ? Assembler and assembler directives
15. Define ? Compiler and Linker
16. What is meant by modular programming?
17. Explain the uses of PUSH and POP instruction.
18. Explain the uses of CALL and RET instruction.
19. Identify the addressing modes in the following instructions.
AND AL, BL
SUB AL, 24H
MOV AL, (BP)
MOV CX, 1245H
20. What are the 8086 instructions used for BCD arithmetic?

Applications:
1. Toys
2. Light switches and dimmers
3. Electrical circuit breakers
4. Smoke alarms
5. Battery packs


Viva ? voce
28 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.5 SEARCHING AND SORTING A STRING IN A
GIVEN ARRAY
a) Searching a String in a Given Array:
Aim:
To write an assembly language program to search a string in the given array and to execute it using 8086
kit.
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Algorithm:
1. Initialize the source and destination memory in SI and DI register
2. Initialize the count (CL) and Load the string values to any register (DL)
3. Move string to AL register and Compare the register (DL and AL)
4. Check for zero flag and if it is set jump to step 7 else go to step 9
5. Store the value of AL register
6. Increment DI register by one, Increment SI register by one and Decrement CL register by one
7. Check for zero flag and if it is set jump to step 12 else go to step 4
8. Stop the execution
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Type the Assembly Language Program
6. Press ?RESET? key
To executive the program
7. Press ?GO?
8. Type the starting address to execute the program
9. Press ?RESET? key
To verify the result
29 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

10. Type ?SB(Substitute Byte)?
11. Enter the output address location to check the result
Program:
Address Label Mnemonics
1000 MOV DI, 1300
1004 MOV SI, 1200
1008 MOV CL, 06
100B MOV DL, 02
100E L1 MOV AL, [SI]
1010 CMP DL, AL
1012 JNZ L2
1014 MOV [DI], AL
1016 INC DI
1017 L2 INC SI
1018 DEC CL
101A JNZ L1
101C HLT

Tabulation:
Input Output
Address Data Address Data


Result:
Thus an assembly language program to search a string in the string in the given array is written. The
program is executed using 8086 and the output is verified.






30 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

b) Sorting an Array of Data Using 8086:
Aim:
To write an assembly language program to sort an array of data in ascending and descending order and
execute it using 8086 kit
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
1. Ascending Order:
Algorithm:
1. Set SI as pointer for array
2. Set CL as outer loop counter
3. Initialize array pointer
4. Set CH as inner loop counter
5. Increment array pointer
6. Get the first element of array
7. Increment array pointer and Compare the two elements
31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

8. Checks carry flag. If carry flag is set go to step 11 else go to step 10
9. Swap the content of the memory location
10. Decrement the inner loop counter
11. Check zero flag. If it is set go to step 13 else go to step 7
12. Decrement outer loop counter
13. Check zero flag. If it is set go to step 15 else go to step 3 and stop
Program:
Address Label Mnemonics
1000 MOV SI, 1100H
1004 MOV CL, [SI]
1006 DEC CL
008 Repeat MOV SI, 1100H
100C MOV CH, [SI]
100E DEC CH
1010 INC SI
1011 Rep MOV AL, [SI]
1013 INC SI
1014 CMP AL, [SI]
1016 JC Ahead
1018 XCHG AL, [SI]
101A XCHG AL, [SI-1]
101D Ahead DEC CH
101F JNZ Rep
1021 DEC CL
1023 JNZ Repeat
1025 HLT
Tabulation:
Input Output
Address Data Address Data



32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

2. Descending Order:
Algorithm:
1. Set SI as pointer for array
2. Set CL as outer loop counter
3. Initialize array pointer
4. Set CH as inner loop counter
5. Increment array pointer Get the first element of array
6. Increment array pointer
7. Compare the two elements
8. Checks carry flag. If carry flag is set go to step 11 else go to step 10
9. Swap the content of the memory location
10. Decrement the inner loop counter
11. Check zero flag. If it is set go to step 13 else go to step 7
12. Decrement outer loop counter
13. Check zero flag. If it is set go to step 15 else go to step 3
14. Stop
Program:
Address Label Mnemonics
1000 MOV SI, 1100H
1004 MOV CL, [SI]
1006 DEC CL
1008 Repeat MOV SI, 1100H
100C MOV CH, [SI]
100E DEC CH
1010 INC SI
1011 Rep MOV AL, [SI]
1013 INC SI
1014 CMP AL, [SI]
1016 JNC Ahead
1018 XCHG AL, [SI]
101A XCHG AL, [SI-1]
101D Ahead DEC CH
101F JNZ Rep
1021 DEC CL
1023 JNZ Repeat
1025 HLT

33 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


Result:
Thus an assembly language program is written to sort an array of data in ascending and descending order.
The program is executed using 8086 and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts and write the Assembly
Language Program for Searching and Sorting.

1. What is the relation between 8086 processor frequency & crystal Frequency?
2. What is the position of the stack pointer after the POP instruction?
3. Compare CALL and JMP instructions.
4. Define ? Baud Rate
5. What is the size of instruction queue in 8086?
6. Compare JNC and JMP instructions.
7. What happens when HLT instruction is executed in processor?
8. What is the maximum internal clock frequency of 8086 processor?
9. What are the functions of BIU?
10. Write an ALP program to search a number 05 from a given array.
11. What is cache memory?
12. Can ROM be used as stack?
13. What are the 8086 instructions used for BCD arithmetic?
14. What are the 8086 instructions used for ASCII arithmetic?
15. List the various string instructions available in 8086.
16. How will carry and zero flags reflect the result of instruction CMP BX, CX?
17. Give any four miscellaneous instructions in 16-bit Microprocessor
18. List the flags in 8086 and state its functions.
19. What is the purpose of segment registers in 8086?
20. What is virtual addressing mode?

Viva ? voce
34 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Applications:
1. Car keys
2. Power tool
3. Home security system
4. Dishwashers
5. Washing machines
35 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.6 PASSWORD CHECKING AND PRINT RAM SIZE
WITH SYSTEM DATE
Aim:
To write an assembly language program to Check Password.
Apparatus required:
1. Personal Computer
2. MASM Software
Procedure:
1. Go to Start, Programs, MS-DOS Prompt (or Command Window). Once the DOS window is open, type
the command EDIT. Type your file and save it to your .ASM directory. Be sure it has a .ASM
extension. Do not close the DOS window or the editor.
2. Go to Start, Programs, MS-DOS Prompt (or Command Window). This will open a second DOS
window. Change to your .ASM directory and issue the commands to run MASM.
3. Click compile, link and run it.
a) C: cd \COP3402
b) MASM/L FIRST.ASM
c) LINK FIRST.OBJ
d) FIRST.EXE
4. For errors after issuing the MASM command, fix the .ASM file and redo the above steps.
5. open the file FIRST.LST to clear all errors
6. Click compile, link and run it.
a) MASM/L FIRST.ASM
b) LINK FIRST.OBJ
c) FIRST.EXE
Program:
.MODEL SMALL
.DATA
PASS DB ?ABC?
MES1 DB 10,13,?ENTER 3 CHARACTER PASSWORD $?
MES2 DB 10,13,?PASSWORD IS CORRECT $?
MES3 DB 10,13,?PASSWORD ID WRONG $ ?
.CODE
START: MOV AX,@DATA
MOV DS,AX
MOV AH,09H
LEA DX,MES1
INT 21H
36 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

MOV CL,00
MOV DL,OOH
XOR DI,DI
.WHILE CL!=3
MOV AH,07H
INT 21H
LEA BX,PASS
MOV AH,[BX+DI]
.IF AL==AH
ADD DL,01
.ENDIF
INC DI
INC CL
.ENDW
.IF DL==3
MOV AH,09H
LEA DX,MES2
INT 21H
.ELSE
MOV AH,09H
LEA DX,MES3
INT 21H
.ENDIF
MOV AH,4CH
INT 21H
END START
END
Result:
Thus the given password is checked and the result is verified.
Outcome:
At the end of this experiment the students able to understand the concepts of password checking and print
ram size with system date.








37 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00



1. What is the role of Stack?
2. What is the difference between DOS and BIOS interrupts?
3. What is an interrupt vector Tabulation: of 8086?
4. What .model small stands for?
5. Define ? Interrupt Vector Tabulation
6. What are the contents of AL and CY after the execution of the following segments?
7. What is the purpose of CLK signal in an 8086 system?
8. What is the need for MN/MX pin in 8086 system?
9. What is the purpose of QUEUE in 8086 processor?
10. Give the operation of TEST instructions of 8086?
11. List out few string instructions of 8086.
12. What is the use of LOCK prefix?
13. What is the purpose of REP prefix?
14. What are the types of Multiprocessor configuration?
15. Define ? Co-processor
16. List any four program control instructions available in 8086?
17. How the data and address lines are demultiplexed?
18. Define ? Instruction
19. Define ? Machine Cycle
20. Define ? T-State
Applications:
1. High-end coffee makers
2. Radio clocks
3. Televisions
4. VCRs
5. DVD players
Viva ? voce
FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING


EC6513 ? MICROPROCESSOR AND MICROCONTROLLERLABORATORY


V SEMESTER - R 2013










Name : _______________________________________
Register No. : _______________________________________
Section : _______________________________________



LABORATORY MANUAL
2 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY


C01 - To learn the working of ARM processor
C02 - To introduce ALP concepts and features
C03 - To write ALP for arithmetic and logical operations in 8086 and 8051
C04 - To differentiate Serial and Parallel Interface
C05 - To interface different I/Os with Microprocessors
C06 - To be familiar with MASM
.




1. Write programs in ARM for a specific Application
2. Write ALP Programs for fixed and Floating Point and Arithmetic
3. Interface different I/Os with processor and Generate waveforms using Microprocessors
4. Execute Programs in 8051
5. Assess the performance of optical devices: light sources, fibers and detectors from both physical and system
point of view

INTRODUCTION
This course illustrates the concepts covered in course CS6412 and provides students with hands-on
experience in Assembly language programs.
PREREQUISITE:
1. Digital Electronics
EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
Lecture
No./Session No.
Name of the Experiment
Course
objectives
Proposed
date

1,2,3
Introduction to lab
CO1

CYCLE I - 8086 PROGRAMS USING KITS AND MASM
4,5,6 Basic arithmetic and Logical operations CO2
COURSE OBJECTIVES
COURSE OUTCOMES
3 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00













7,8,9 Decimal arithmetic and Code conversion CO3
10,11,12
Move a data block without overlap
CO3
Matrix operations
13,14,15 Searching and Sorting a sting in a given array CO2
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
16,17,18 D/A interface and Waveform Generation CO4
19,20,21 A/D interface CO5
22,23,24 Key board and Display CO5
25,26,27
Stepper motor control CO2
Traffic light control CO5
28,29,30
Digital clock CO6
Serial interface and Parallel interface CO4
CYCLE III - 8051 PROGRAMS USING KITS AND MASM
31,32,33 Basic arithmetic and Logical operations CO1
34,35,36
Square and Cube program, Find 2?s complement of a number
CO5
Unpacked BCD to ASCII
37,38,39
Password checking and Print RAM size with system date
CO6
Counters and Time Delay
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
40,41,42 Sorting of an array using 8051 CO2
43,44,45
Separate odd and even numbers using 8086


CO3
Sum of N consecutive numbers using 8086
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00




College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING




To impart professional education integrated with human values to the younger generation, so as to shape
them as proficient and dedicated engineers, capable of providing comprehensive solutions to the challenges in
deploying technology for the service of humanity



? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices


VISION
MISSION
VISION
MISSION
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of
engineering that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this
enables to find solutions for real time problem in industry and organization and to design products
requiring interdisciplinary skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up
their communication skills, individual leadership and supportive qualities and to develop them to adapt and
work in ever changing technologies
5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees











6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer
Science and Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the
career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both
verbal and written forms
i) To work in a team as team member or a leader and make unique contributions and work with
coordination
j) To engage lifelong learning and exhibit their technical skills
k) To develop and manage projects in multidisciplinary environments










7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER
LABORATORY
SYLLABUS

? To learn the working of ARM processor
? To introduce ALP concepts and features
? To write ALP for arithmetic and logical operations in 8086 and 8051
? To differentiate Serial and Parallel Interface
? To interface different I/Os with Microprocessors
? To be familiar with MASM
LIST OF EXPERIMENTS:
8086 Programs using kits and MASM
1. Basic arithmetic and Logical operations
2. Move a data block without overlap
3. Code conversion, decimal arithmetic and Matrix operations.
4. Floating point operations, string manipulations, sorting and searching
5. Password checking, Print RAM size and system date
6. Counters and Time Delay
Peripherals and Interfacing Experiments
7. Traffic light control
8. Stepper motor control
9. Digital clock
10. Key board and Display
11. Printer status
12. Serial interface and Parallel interface
13. A/D and D/A interface and Waveform Generation 8051
Experiments using kits and MASM
14. Basic arithmetic and Logical operations
15. Square and Cube program, Find 2 ?s complement of a number
16. Unpacked BCD to ASCII

? Write programs in ARM for a specific Application
? Write ALP Programs for fixed and Floating Point and Arithmetic
? Interface different I/Os with processor and Generate waveforms using Microprocessors
? Execute Programs in 8051
? Assess the performance of optical devices: light sources, fibers and detectors from both physical and
system point of view


COURSE OUTCOMES
COURSE OBJECTIVES
8 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 - 8086 PROGRAMS USING KITS AND MASM
1 Basic arithmetic and Logical operations 10
2 Decimal arithmetic and Code conversion 15
3 Move a data block without overlap 21
4 Matrix operations 24
5 Searching and Sorting a sting in a given array 27
6 Password checking and Print RAM size with system date 33
7 Counters and Time Delay 36
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
8 Stepper motor control 39
9 Traffic light control 42
10 Digital clock 47
11 Serial interface and Parallel interface 50
12 A/D interface 54
13 Key board and Display 57
14 D/A interface and Waveform Generation 60
CYCLE 3 - 8051 PROGRAMS USING KITS AND MASM
15 Basic arithmetic and Logical operations 64
16 Square and Cube program, Find 2?s complement of a number 69
17 Unpacked BCD to ASCII 71
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
18 Sorting of an array using 8051 74
19 Separate odd and even numbers using 8086 77
20 Sum of N consecutive numbers using 8086 80

9 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.1 BASIC ARITHMETIC AND LOGICAL OPERATIONS

Aim:
To write an Assembly Language Program to perform Arithmetic operation and to execute using 8086
microprocessor
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
Arithmetic Operation:
1. Addition:
Algorithm:
1. Clear BL register to store carry
2. Get the addend in AX register pair
3. Get the Augend in CX register pair
4. Add Augend and addend
5. Check for carry, If it is one go to step 6 else go to step 7
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

6. Increments carry (BL register by 1)
7. Store the sum in memory from AX register pair
8. Store the carry in memory from BL register
9. Stop
Program:
Address
Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 1010H
1007 MOV CX, 2020H
100B CLC
100C ADD AX, CX
100E JNC Label1
1010 INC BL
1012 Label 1 MOV [1200], AX
1016 MOV [1202], BL
101A HLT
Precaution:
Make sure that all the machine codes should be as per the specified in the program.
Tabulation:
Input Output
Address Data Address Data








2. Subtraction:
Algorithm:
1. Clear BL register for storing borrow
2. Get the minuend in AX register pair
3. Get the subtrahend in CX register pair
4. Subtract minuend and subtrahend
5. Check borrow, if borrow is one go to step 6 else go to step 8
6. Increment borrow (BL register by 1)
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

7. Negate AX register
8. Store the difference from AX in memory
9. Story the borrow from BL in memory
10. Stop
Program:
Address Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 2024H
1007 MOV CX, 1010H
100B SUB AX, CX
100D JNC Label1
100F INC BL
1011 NEG AX
1013 Label 1 MOV [1200], AX
1017 MOV [1202], BL
101B HLT

Tabulation:
Input Output
Address Data Address Data






3. Multiplication
Algorithm:
1. Clear DX register
2. Load the AX register pair with multiplicand
3. Load the CX register pair with multiplier
4. Multiply multiplicand and multiplier
5. Store the higher byte of product(from DX register pair) in memory specified
6. Store the lower byte of product(from AX register pair) in memory specified
7. Stop
8.
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV DX, 0000H
1004 MOV AX, 00FFH
1008 MOV CX, 0002H
100C MUL CX
100E MOV [1200], AX
1012 MOV [1202], DX
1016 HLT
Tabulation:
Input Output
Address Data Address Data






4. Division:
Algorithm
1. Clear DX register
2. Load the AX register pair with dividend
3. Load the CX register pair with divisor
4. Dividend divided by divisor
5. Store the quotient (from AX register pair) in memory specified
6. Store the remainder (from DX register pair) in memory specified
7. Stop
Program:
Address Label Mnemonics
1000 MOV DX, 0000H
1004 MOV AX, 0008H
1008 MOV CX, 0004H
100C DIV CX
100E MOV [1200], AX
1012 MOV [1202], DX
1016 HLT

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


Result:
Thus Assembly language program are written to perform arithmetic operation using 8086 microprocessor.
They are executed using 8086 processor and the outputs are verified.
Outcome:
At the end of this experiment the students able to write ALP programs for Arithmetic and Logical operations.

1. Write the size of the data bus of 8086.
2. Write the size of the address bus of 8086.
3. What is meant by physical addressing in 8086?
4. What is meant by an Opcode?
5. What is meant by an Operand?
6. What is meant by a Mnemonics?
7. What are the other possibilities of writing ADD, SUB and MUL instructions in other addressing modes?
8. What is the difference between microprocessor and microcontroller?
9. What is meant by LATCH?
10. What is the difference between primary & secondary storage device?
11. What is the difference between static and dynamic RAM?
12. What is an interrupt?
13. Differentiate between RAM and ROM?
14. Define ? Compiler
15. Define ? Flag
16. Define ? Stack
17. How clock signal is generated in 8086 microprocessor?
18. State the functions of queue status line QS0 and QS1 in 8086 microprocessor.
19. What is the purpose of BIU& EU?
20. List out the two examples of assembler directives.

Viva ? voce
15 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Applications:
1. barrel shifters
2. Multiple-precision arithmetic
3. Calculation pipeline
4. binary multipliers
5. Calculation in a single clock

16 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.2 DECIMAL ARITHMETIC AND CODE CONVERSION
Aim:
To write an Assembly Language Program to perform Code conversion and Decimal Arithmetic operations
and to execute using 8086 microprocessor
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
Decimal Arithmetic:
1. Using DAA
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Clear the CL reg.
4. Add the contents of AL and BL.
5. Adjust decimal accumulator after addition.
6. Store the result.
17 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 MOV CL, 00
100B ADD AL,BL
100D DAA
100E JNC L1
1010 INC CL
1012 L1 MOV [1150], AL
1016 MOV [1151], CL
101A HLT

Tabulation:
Input Output
Address Data Address Data


2. Using AAM
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Multiply the contents of AL and BL.
4. Adjust decimal accumulator after multiplication.
5. Store the result.
Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 MUL BL
100A AAM
100C MOV [1150], AH
1010 MOV [1151], AL
1014 HLT

18 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


3. Using DAS
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Subtract the contents of BL from AL.
4. Adjust decimal accumulator after subtraction.
5. Store the result.
Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 SUB AL,BL
100A DAS
100B MOV [1150], AL
100F HLT
Tabulation:
Input Output
Address Data Address Data


Code Conversion:
1. Binary to BCD
Algorithm:
1. Get the input and store in AL.
2. Clear the carry flag.
3. Rotate right the bits of input.
4. Find logical XOR between input and shifted input.
5. Store the result.
19 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 XOR AX,AX
1002 XOR CX,CX
1004 MOV BX,000B
1008 L2 CMP BX,00
100C JZ L1
100E DEC BX
100F MOV AL,CL
1011 ADD AL,01
1014 DAA
1015 MOV CL,AL
1017 MOV AL,CH
1019 ADC AL,00
101C DAA
101D MOV CH,AL
101F JMP L2
1022 MOV [1150],CX
1026 HLT
Tabulation:
Input Output
Address Data Address Data




2. Binary to Gray
Algorithm:
1. Get the input and store in AL.
2. Clear the carry flag.
3. Rotate right the bits of input.
4. Find logical XOR between input and shifted input.
5. Store the result.

20 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, AL
1006 CLC
1007 MOV CL,01
100A RCR AL,CL
100C XOR BL,AL
100E MOV [1150],BL
1012 HLT
Tabulation:
Input Output
Address Data Address Data


Result:
Thus an Assembly Language Program for code conversion and decimal arithmetic operations is written. The
program is executed using 8086 and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts of code conversions and
decimal arithmetic operations.








21 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


1. Write the function of the following 8085 instructions: JP, JPE, JPO, and JNZ.
2. What is the purpose of the following commands in 8086?
a) AAD
b) RCL
3. List out the addressing modes in 8086.
4. List out the various string instructions that are available in 8086.
5. What are the 8086 instructions used for BCD arithmetic?
6. What flags get affected after executing ADD instruction?
7. Which instruction is used to add immediate data?
8. What is BCD code? Where it is used?
9. What is ASCII code? Where it is used?
10. What is the difference between carry flag and overflow flag?
11. What are the special function register associated with interrupts?
12. List the flags affected by arithmetic instructions.
13. After executing ADDC instruction, what flags get affected?
14. How many bytes the instruction ADDC will add?
15. Name the signals used by the processor to communicate with an I/O processor
16. What is the function of IP?
17. What is the use of base pointer register?
18. Mention the index registers of 8086.
19. How many memory locations are available in 8086 microprocessor?
20. What are the flags in 8086? What are the various interrupts in 8086?
Applications:
1. Programmable calculators
2. Counting system using counts the tennis ball
3. Detecting and Correcting an Error with the Hamming Code
4. Power tool
5. Radio clocks
Viva ? voce
22 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.3 MOVE A DATA BLOCK WITHOUT OVERLAP
Aim:
To write an assembly language program to move a block of data to another memory location and execute it
using 8086
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Algorithm:
1. Initialize the source and destination memory location to SI and DI register
2. Initialize the counter (CL register)
3. Move the data to designation memory through AL register
4. Decrement the count
5. Check for zero flag and if zero flag is set go to next step
6. else go to step 3
7. Stop
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
23 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


Program:
Address Label Mnemonics
1000 MOV CL, 08
1003 MOV SI, 1200
1007 MOV DI, 1300
100B L1 LOD SB
100C MOV [DI], AL
100E INC DI
100F DEC CL
1011 JNZ L1
1013 HLT

Tabulation:
Input Output
Address Data Address Data




Result:
Thus an Assembly Language Program for moving data to another location is written the program is
executed using 8086 and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts and write the ALP program for
moving data to another location.



24 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00



1. List out the Flag manipulation instruction.
2. Define ? Variables
3. Define ? Segment Override Prefix
4. How is the memory segment accessed by 8086 microprocessor identified?
5. List out the advantages of using Direct Memory Access (DMA).
6. What is BIOS function call in 8086? (May 2012)
7. List out the difference between procedures and Macros.
8. What is meant by maskable interrupts& non-maskable interrupts?
9. What is the Maximum clock frequency in 8086?
10. Which Stack is used in 8086?
11. Define ? Pipeline (Dec 2011)
12. How many address lines are available in 8086? What is the maximum address possible?
13. What is an assembler?( May 2012)
14. What is the purpose of LEA instruction in 8086? (May 2012)
15. Give the function of index and pointers in 8086.
16. What are the different instruction set of 8086?
17. Give the various addressing modes in 8086.
18. Give the differences between JUMP and LOOP instruction.
19. Give the physical address formation of any two addressing mode.
20. Give the use of ?ASSUME? in 8086 programming.
Applications:
1. Priority Encoder
2. DVD players
3. Cellular telephones
4. Household appliances
5. Car equipment
Viva ? voce
25 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.4 MATRIX OPERATIONS
Aim:
To write an assembly language program to perform matrix addition and to execute it using 8086
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Algorithm:
1. Get the size (count) of the matrix
2. Initialize SI pointer for storing first matrix
3. Initialize DI pointer for storing second matrix
4. Move the contents pointed by SI pointer to accumulator
5. Move the contents pointed by DI pointer BL register
6. Add the contents of accumulator and BL register
7. Store result in the address pointed by DI pointer
8. Increment DI and SI pointer by 1 and Decrement count by 1
9. Check for zero. If no zero jump to step 4 else go to step 11
10. Stop the execution
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result

26 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV CL, 09
1003 MOV SI, 1100
1007 MOV DI, 1200
100B L1 MOV AL, [SI]
100D MOV BL, [DI]
100F ADD AL, BL
1011 MOV [DI], AL
1013 INC SI
1014 INC DI
1015 DEC CL
1017 JNZ L1
1019 HLT

Tabulation:
Input Output
Address Data Address Data



Result:
Thus an assembly language program for matrix addition was written. It is executed using 8086
microprocessor and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts of moving and adding the group
of data from one location to another location.







27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


1. Write an ALP for 8086 to multiply two 16 bit unsigned numbers.
2. What is an accumulator?
3. List out the segment register available in 8086.
4. List out any four program control instructions that are available in 8086.
5. What is program counter?
6. Give any four logical instructions in 8086.
7. How many memory locations are available in 8086 microprocessor?
8. What are the general purposes registers in 8086?
9. What are the functional units in 8086?
10. How much memory location allotted for the particular segments registers in 8086?
11. When the 8086 processor is in minimum mode and maximum mode?
12. Define ? Segment Override Prefix.
13. Define ? Macro and Procedure
14. Define ? Assembler and assembler directives
15. Define ? Compiler and Linker
16. What is meant by modular programming?
17. Explain the uses of PUSH and POP instruction.
18. Explain the uses of CALL and RET instruction.
19. Identify the addressing modes in the following instructions.
AND AL, BL
SUB AL, 24H
MOV AL, (BP)
MOV CX, 1245H
20. What are the 8086 instructions used for BCD arithmetic?

Applications:
1. Toys
2. Light switches and dimmers
3. Electrical circuit breakers
4. Smoke alarms
5. Battery packs


Viva ? voce
28 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.5 SEARCHING AND SORTING A STRING IN A
GIVEN ARRAY
a) Searching a String in a Given Array:
Aim:
To write an assembly language program to search a string in the given array and to execute it using 8086
kit.
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Algorithm:
1. Initialize the source and destination memory in SI and DI register
2. Initialize the count (CL) and Load the string values to any register (DL)
3. Move string to AL register and Compare the register (DL and AL)
4. Check for zero flag and if it is set jump to step 7 else go to step 9
5. Store the value of AL register
6. Increment DI register by one, Increment SI register by one and Decrement CL register by one
7. Check for zero flag and if it is set jump to step 12 else go to step 4
8. Stop the execution
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Type the Assembly Language Program
6. Press ?RESET? key
To executive the program
7. Press ?GO?
8. Type the starting address to execute the program
9. Press ?RESET? key
To verify the result
29 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

10. Type ?SB(Substitute Byte)?
11. Enter the output address location to check the result
Program:
Address Label Mnemonics
1000 MOV DI, 1300
1004 MOV SI, 1200
1008 MOV CL, 06
100B MOV DL, 02
100E L1 MOV AL, [SI]
1010 CMP DL, AL
1012 JNZ L2
1014 MOV [DI], AL
1016 INC DI
1017 L2 INC SI
1018 DEC CL
101A JNZ L1
101C HLT

Tabulation:
Input Output
Address Data Address Data


Result:
Thus an assembly language program to search a string in the string in the given array is written. The
program is executed using 8086 and the output is verified.






30 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

b) Sorting an Array of Data Using 8086:
Aim:
To write an assembly language program to sort an array of data in ascending and descending order and
execute it using 8086 kit
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
1. Ascending Order:
Algorithm:
1. Set SI as pointer for array
2. Set CL as outer loop counter
3. Initialize array pointer
4. Set CH as inner loop counter
5. Increment array pointer
6. Get the first element of array
7. Increment array pointer and Compare the two elements
31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

8. Checks carry flag. If carry flag is set go to step 11 else go to step 10
9. Swap the content of the memory location
10. Decrement the inner loop counter
11. Check zero flag. If it is set go to step 13 else go to step 7
12. Decrement outer loop counter
13. Check zero flag. If it is set go to step 15 else go to step 3 and stop
Program:
Address Label Mnemonics
1000 MOV SI, 1100H
1004 MOV CL, [SI]
1006 DEC CL
008 Repeat MOV SI, 1100H
100C MOV CH, [SI]
100E DEC CH
1010 INC SI
1011 Rep MOV AL, [SI]
1013 INC SI
1014 CMP AL, [SI]
1016 JC Ahead
1018 XCHG AL, [SI]
101A XCHG AL, [SI-1]
101D Ahead DEC CH
101F JNZ Rep
1021 DEC CL
1023 JNZ Repeat
1025 HLT
Tabulation:
Input Output
Address Data Address Data



32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

2. Descending Order:
Algorithm:
1. Set SI as pointer for array
2. Set CL as outer loop counter
3. Initialize array pointer
4. Set CH as inner loop counter
5. Increment array pointer Get the first element of array
6. Increment array pointer
7. Compare the two elements
8. Checks carry flag. If carry flag is set go to step 11 else go to step 10
9. Swap the content of the memory location
10. Decrement the inner loop counter
11. Check zero flag. If it is set go to step 13 else go to step 7
12. Decrement outer loop counter
13. Check zero flag. If it is set go to step 15 else go to step 3
14. Stop
Program:
Address Label Mnemonics
1000 MOV SI, 1100H
1004 MOV CL, [SI]
1006 DEC CL
1008 Repeat MOV SI, 1100H
100C MOV CH, [SI]
100E DEC CH
1010 INC SI
1011 Rep MOV AL, [SI]
1013 INC SI
1014 CMP AL, [SI]
1016 JNC Ahead
1018 XCHG AL, [SI]
101A XCHG AL, [SI-1]
101D Ahead DEC CH
101F JNZ Rep
1021 DEC CL
1023 JNZ Repeat
1025 HLT

33 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


Result:
Thus an assembly language program is written to sort an array of data in ascending and descending order.
The program is executed using 8086 and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts and write the Assembly
Language Program for Searching and Sorting.

1. What is the relation between 8086 processor frequency & crystal Frequency?
2. What is the position of the stack pointer after the POP instruction?
3. Compare CALL and JMP instructions.
4. Define ? Baud Rate
5. What is the size of instruction queue in 8086?
6. Compare JNC and JMP instructions.
7. What happens when HLT instruction is executed in processor?
8. What is the maximum internal clock frequency of 8086 processor?
9. What are the functions of BIU?
10. Write an ALP program to search a number 05 from a given array.
11. What is cache memory?
12. Can ROM be used as stack?
13. What are the 8086 instructions used for BCD arithmetic?
14. What are the 8086 instructions used for ASCII arithmetic?
15. List the various string instructions available in 8086.
16. How will carry and zero flags reflect the result of instruction CMP BX, CX?
17. Give any four miscellaneous instructions in 16-bit Microprocessor
18. List the flags in 8086 and state its functions.
19. What is the purpose of segment registers in 8086?
20. What is virtual addressing mode?

Viva ? voce
34 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Applications:
1. Car keys
2. Power tool
3. Home security system
4. Dishwashers
5. Washing machines
35 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.6 PASSWORD CHECKING AND PRINT RAM SIZE
WITH SYSTEM DATE
Aim:
To write an assembly language program to Check Password.
Apparatus required:
1. Personal Computer
2. MASM Software
Procedure:
1. Go to Start, Programs, MS-DOS Prompt (or Command Window). Once the DOS window is open, type
the command EDIT. Type your file and save it to your .ASM directory. Be sure it has a .ASM
extension. Do not close the DOS window or the editor.
2. Go to Start, Programs, MS-DOS Prompt (or Command Window). This will open a second DOS
window. Change to your .ASM directory and issue the commands to run MASM.
3. Click compile, link and run it.
a) C: cd \COP3402
b) MASM/L FIRST.ASM
c) LINK FIRST.OBJ
d) FIRST.EXE
4. For errors after issuing the MASM command, fix the .ASM file and redo the above steps.
5. open the file FIRST.LST to clear all errors
6. Click compile, link and run it.
a) MASM/L FIRST.ASM
b) LINK FIRST.OBJ
c) FIRST.EXE
Program:
.MODEL SMALL
.DATA
PASS DB ?ABC?
MES1 DB 10,13,?ENTER 3 CHARACTER PASSWORD $?
MES2 DB 10,13,?PASSWORD IS CORRECT $?
MES3 DB 10,13,?PASSWORD ID WRONG $ ?
.CODE
START: MOV AX,@DATA
MOV DS,AX
MOV AH,09H
LEA DX,MES1
INT 21H
36 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

MOV CL,00
MOV DL,OOH
XOR DI,DI
.WHILE CL!=3
MOV AH,07H
INT 21H
LEA BX,PASS
MOV AH,[BX+DI]
.IF AL==AH
ADD DL,01
.ENDIF
INC DI
INC CL
.ENDW
.IF DL==3
MOV AH,09H
LEA DX,MES2
INT 21H
.ELSE
MOV AH,09H
LEA DX,MES3
INT 21H
.ENDIF
MOV AH,4CH
INT 21H
END START
END
Result:
Thus the given password is checked and the result is verified.
Outcome:
At the end of this experiment the students able to understand the concepts of password checking and print
ram size with system date.








37 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00



1. What is the role of Stack?
2. What is the difference between DOS and BIOS interrupts?
3. What is an interrupt vector Tabulation: of 8086?
4. What .model small stands for?
5. Define ? Interrupt Vector Tabulation
6. What are the contents of AL and CY after the execution of the following segments?
7. What is the purpose of CLK signal in an 8086 system?
8. What is the need for MN/MX pin in 8086 system?
9. What is the purpose of QUEUE in 8086 processor?
10. Give the operation of TEST instructions of 8086?
11. List out few string instructions of 8086.
12. What is the use of LOCK prefix?
13. What is the purpose of REP prefix?
14. What are the types of Multiprocessor configuration?
15. Define ? Co-processor
16. List any four program control instructions available in 8086?
17. How the data and address lines are demultiplexed?
18. Define ? Instruction
19. Define ? Machine Cycle
20. Define ? T-State
Applications:
1. High-end coffee makers
2. Radio clocks
3. Televisions
4. VCRs
5. DVD players
Viva ? voce
38 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.7 COUNTERS AND TIME DELAY

Aim:
To write an assembly language program to display the current system time and date
Apparatus required:
1. Personal Computer
2. MASM Software
Procedure:

1. Go to Start, Programs, MS-DOS Prompt (or Command Window). Once the DOS window is open, type
the command EDIT. Type your file and save it to your .ASM directory. Be sure it has a .ASM
extension. Do not close the DOS window or the editor.
2. Go to Start, Programs, MS-DOS Prompt (or Command Window). This will open a second DOS
window. Change to your .ASM directory and issue the commands to run MASM.
3. Click compile, link and run it.
a) C:
b) cd \ COP3402
c) MASM/L FIRST.ASM
d) LINK FIRST.OBJ
e) FIRST.EXE
4. For errors after issuing the MASM command, fix the .ASM file and redo the above steps.
5. open the file FIRST.LST to clear all errors
6. Click compile, link and run it.
a) MASM/L FIRST.ASM
b) LINK FIRST.OBJ
c) FIRST.EXE
Program:
.MODEL SMALL
.STACK 100H
.DATA
PROMPT DB 'Current System Time is : $'
TIME DB '00:00:00$'
.CODE
MAIN PROC
FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING


EC6513 ? MICROPROCESSOR AND MICROCONTROLLERLABORATORY


V SEMESTER - R 2013










Name : _______________________________________
Register No. : _______________________________________
Section : _______________________________________



LABORATORY MANUAL
2 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY


C01 - To learn the working of ARM processor
C02 - To introduce ALP concepts and features
C03 - To write ALP for arithmetic and logical operations in 8086 and 8051
C04 - To differentiate Serial and Parallel Interface
C05 - To interface different I/Os with Microprocessors
C06 - To be familiar with MASM
.




1. Write programs in ARM for a specific Application
2. Write ALP Programs for fixed and Floating Point and Arithmetic
3. Interface different I/Os with processor and Generate waveforms using Microprocessors
4. Execute Programs in 8051
5. Assess the performance of optical devices: light sources, fibers and detectors from both physical and system
point of view

INTRODUCTION
This course illustrates the concepts covered in course CS6412 and provides students with hands-on
experience in Assembly language programs.
PREREQUISITE:
1. Digital Electronics
EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
Lecture
No./Session No.
Name of the Experiment
Course
objectives
Proposed
date

1,2,3
Introduction to lab
CO1

CYCLE I - 8086 PROGRAMS USING KITS AND MASM
4,5,6 Basic arithmetic and Logical operations CO2
COURSE OBJECTIVES
COURSE OUTCOMES
3 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00













7,8,9 Decimal arithmetic and Code conversion CO3
10,11,12
Move a data block without overlap
CO3
Matrix operations
13,14,15 Searching and Sorting a sting in a given array CO2
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
16,17,18 D/A interface and Waveform Generation CO4
19,20,21 A/D interface CO5
22,23,24 Key board and Display CO5
25,26,27
Stepper motor control CO2
Traffic light control CO5
28,29,30
Digital clock CO6
Serial interface and Parallel interface CO4
CYCLE III - 8051 PROGRAMS USING KITS AND MASM
31,32,33 Basic arithmetic and Logical operations CO1
34,35,36
Square and Cube program, Find 2?s complement of a number
CO5
Unpacked BCD to ASCII
37,38,39
Password checking and Print RAM size with system date
CO6
Counters and Time Delay
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
40,41,42 Sorting of an array using 8051 CO2
43,44,45
Separate odd and even numbers using 8086


CO3
Sum of N consecutive numbers using 8086
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00




College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING




To impart professional education integrated with human values to the younger generation, so as to shape
them as proficient and dedicated engineers, capable of providing comprehensive solutions to the challenges in
deploying technology for the service of humanity



? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices


VISION
MISSION
VISION
MISSION
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of
engineering that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this
enables to find solutions for real time problem in industry and organization and to design products
requiring interdisciplinary skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up
their communication skills, individual leadership and supportive qualities and to develop them to adapt and
work in ever changing technologies
5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees











6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer
Science and Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the
career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both
verbal and written forms
i) To work in a team as team member or a leader and make unique contributions and work with
coordination
j) To engage lifelong learning and exhibit their technical skills
k) To develop and manage projects in multidisciplinary environments










7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER
LABORATORY
SYLLABUS

? To learn the working of ARM processor
? To introduce ALP concepts and features
? To write ALP for arithmetic and logical operations in 8086 and 8051
? To differentiate Serial and Parallel Interface
? To interface different I/Os with Microprocessors
? To be familiar with MASM
LIST OF EXPERIMENTS:
8086 Programs using kits and MASM
1. Basic arithmetic and Logical operations
2. Move a data block without overlap
3. Code conversion, decimal arithmetic and Matrix operations.
4. Floating point operations, string manipulations, sorting and searching
5. Password checking, Print RAM size and system date
6. Counters and Time Delay
Peripherals and Interfacing Experiments
7. Traffic light control
8. Stepper motor control
9. Digital clock
10. Key board and Display
11. Printer status
12. Serial interface and Parallel interface
13. A/D and D/A interface and Waveform Generation 8051
Experiments using kits and MASM
14. Basic arithmetic and Logical operations
15. Square and Cube program, Find 2 ?s complement of a number
16. Unpacked BCD to ASCII

? Write programs in ARM for a specific Application
? Write ALP Programs for fixed and Floating Point and Arithmetic
? Interface different I/Os with processor and Generate waveforms using Microprocessors
? Execute Programs in 8051
? Assess the performance of optical devices: light sources, fibers and detectors from both physical and
system point of view


COURSE OUTCOMES
COURSE OBJECTIVES
8 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 - 8086 PROGRAMS USING KITS AND MASM
1 Basic arithmetic and Logical operations 10
2 Decimal arithmetic and Code conversion 15
3 Move a data block without overlap 21
4 Matrix operations 24
5 Searching and Sorting a sting in a given array 27
6 Password checking and Print RAM size with system date 33
7 Counters and Time Delay 36
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
8 Stepper motor control 39
9 Traffic light control 42
10 Digital clock 47
11 Serial interface and Parallel interface 50
12 A/D interface 54
13 Key board and Display 57
14 D/A interface and Waveform Generation 60
CYCLE 3 - 8051 PROGRAMS USING KITS AND MASM
15 Basic arithmetic and Logical operations 64
16 Square and Cube program, Find 2?s complement of a number 69
17 Unpacked BCD to ASCII 71
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
18 Sorting of an array using 8051 74
19 Separate odd and even numbers using 8086 77
20 Sum of N consecutive numbers using 8086 80

9 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.1 BASIC ARITHMETIC AND LOGICAL OPERATIONS

Aim:
To write an Assembly Language Program to perform Arithmetic operation and to execute using 8086
microprocessor
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
Arithmetic Operation:
1. Addition:
Algorithm:
1. Clear BL register to store carry
2. Get the addend in AX register pair
3. Get the Augend in CX register pair
4. Add Augend and addend
5. Check for carry, If it is one go to step 6 else go to step 7
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

6. Increments carry (BL register by 1)
7. Store the sum in memory from AX register pair
8. Store the carry in memory from BL register
9. Stop
Program:
Address
Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 1010H
1007 MOV CX, 2020H
100B CLC
100C ADD AX, CX
100E JNC Label1
1010 INC BL
1012 Label 1 MOV [1200], AX
1016 MOV [1202], BL
101A HLT
Precaution:
Make sure that all the machine codes should be as per the specified in the program.
Tabulation:
Input Output
Address Data Address Data








2. Subtraction:
Algorithm:
1. Clear BL register for storing borrow
2. Get the minuend in AX register pair
3. Get the subtrahend in CX register pair
4. Subtract minuend and subtrahend
5. Check borrow, if borrow is one go to step 6 else go to step 8
6. Increment borrow (BL register by 1)
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

7. Negate AX register
8. Store the difference from AX in memory
9. Story the borrow from BL in memory
10. Stop
Program:
Address Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 2024H
1007 MOV CX, 1010H
100B SUB AX, CX
100D JNC Label1
100F INC BL
1011 NEG AX
1013 Label 1 MOV [1200], AX
1017 MOV [1202], BL
101B HLT

Tabulation:
Input Output
Address Data Address Data






3. Multiplication
Algorithm:
1. Clear DX register
2. Load the AX register pair with multiplicand
3. Load the CX register pair with multiplier
4. Multiply multiplicand and multiplier
5. Store the higher byte of product(from DX register pair) in memory specified
6. Store the lower byte of product(from AX register pair) in memory specified
7. Stop
8.
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV DX, 0000H
1004 MOV AX, 00FFH
1008 MOV CX, 0002H
100C MUL CX
100E MOV [1200], AX
1012 MOV [1202], DX
1016 HLT
Tabulation:
Input Output
Address Data Address Data






4. Division:
Algorithm
1. Clear DX register
2. Load the AX register pair with dividend
3. Load the CX register pair with divisor
4. Dividend divided by divisor
5. Store the quotient (from AX register pair) in memory specified
6. Store the remainder (from DX register pair) in memory specified
7. Stop
Program:
Address Label Mnemonics
1000 MOV DX, 0000H
1004 MOV AX, 0008H
1008 MOV CX, 0004H
100C DIV CX
100E MOV [1200], AX
1012 MOV [1202], DX
1016 HLT

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


Result:
Thus Assembly language program are written to perform arithmetic operation using 8086 microprocessor.
They are executed using 8086 processor and the outputs are verified.
Outcome:
At the end of this experiment the students able to write ALP programs for Arithmetic and Logical operations.

1. Write the size of the data bus of 8086.
2. Write the size of the address bus of 8086.
3. What is meant by physical addressing in 8086?
4. What is meant by an Opcode?
5. What is meant by an Operand?
6. What is meant by a Mnemonics?
7. What are the other possibilities of writing ADD, SUB and MUL instructions in other addressing modes?
8. What is the difference between microprocessor and microcontroller?
9. What is meant by LATCH?
10. What is the difference between primary & secondary storage device?
11. What is the difference between static and dynamic RAM?
12. What is an interrupt?
13. Differentiate between RAM and ROM?
14. Define ? Compiler
15. Define ? Flag
16. Define ? Stack
17. How clock signal is generated in 8086 microprocessor?
18. State the functions of queue status line QS0 and QS1 in 8086 microprocessor.
19. What is the purpose of BIU& EU?
20. List out the two examples of assembler directives.

Viva ? voce
15 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Applications:
1. barrel shifters
2. Multiple-precision arithmetic
3. Calculation pipeline
4. binary multipliers
5. Calculation in a single clock

16 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.2 DECIMAL ARITHMETIC AND CODE CONVERSION
Aim:
To write an Assembly Language Program to perform Code conversion and Decimal Arithmetic operations
and to execute using 8086 microprocessor
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
Decimal Arithmetic:
1. Using DAA
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Clear the CL reg.
4. Add the contents of AL and BL.
5. Adjust decimal accumulator after addition.
6. Store the result.
17 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 MOV CL, 00
100B ADD AL,BL
100D DAA
100E JNC L1
1010 INC CL
1012 L1 MOV [1150], AL
1016 MOV [1151], CL
101A HLT

Tabulation:
Input Output
Address Data Address Data


2. Using AAM
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Multiply the contents of AL and BL.
4. Adjust decimal accumulator after multiplication.
5. Store the result.
Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 MUL BL
100A AAM
100C MOV [1150], AH
1010 MOV [1151], AL
1014 HLT

18 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


3. Using DAS
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Subtract the contents of BL from AL.
4. Adjust decimal accumulator after subtraction.
5. Store the result.
Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 SUB AL,BL
100A DAS
100B MOV [1150], AL
100F HLT
Tabulation:
Input Output
Address Data Address Data


Code Conversion:
1. Binary to BCD
Algorithm:
1. Get the input and store in AL.
2. Clear the carry flag.
3. Rotate right the bits of input.
4. Find logical XOR between input and shifted input.
5. Store the result.
19 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 XOR AX,AX
1002 XOR CX,CX
1004 MOV BX,000B
1008 L2 CMP BX,00
100C JZ L1
100E DEC BX
100F MOV AL,CL
1011 ADD AL,01
1014 DAA
1015 MOV CL,AL
1017 MOV AL,CH
1019 ADC AL,00
101C DAA
101D MOV CH,AL
101F JMP L2
1022 MOV [1150],CX
1026 HLT
Tabulation:
Input Output
Address Data Address Data




2. Binary to Gray
Algorithm:
1. Get the input and store in AL.
2. Clear the carry flag.
3. Rotate right the bits of input.
4. Find logical XOR between input and shifted input.
5. Store the result.

20 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, AL
1006 CLC
1007 MOV CL,01
100A RCR AL,CL
100C XOR BL,AL
100E MOV [1150],BL
1012 HLT
Tabulation:
Input Output
Address Data Address Data


Result:
Thus an Assembly Language Program for code conversion and decimal arithmetic operations is written. The
program is executed using 8086 and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts of code conversions and
decimal arithmetic operations.








21 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


1. Write the function of the following 8085 instructions: JP, JPE, JPO, and JNZ.
2. What is the purpose of the following commands in 8086?
a) AAD
b) RCL
3. List out the addressing modes in 8086.
4. List out the various string instructions that are available in 8086.
5. What are the 8086 instructions used for BCD arithmetic?
6. What flags get affected after executing ADD instruction?
7. Which instruction is used to add immediate data?
8. What is BCD code? Where it is used?
9. What is ASCII code? Where it is used?
10. What is the difference between carry flag and overflow flag?
11. What are the special function register associated with interrupts?
12. List the flags affected by arithmetic instructions.
13. After executing ADDC instruction, what flags get affected?
14. How many bytes the instruction ADDC will add?
15. Name the signals used by the processor to communicate with an I/O processor
16. What is the function of IP?
17. What is the use of base pointer register?
18. Mention the index registers of 8086.
19. How many memory locations are available in 8086 microprocessor?
20. What are the flags in 8086? What are the various interrupts in 8086?
Applications:
1. Programmable calculators
2. Counting system using counts the tennis ball
3. Detecting and Correcting an Error with the Hamming Code
4. Power tool
5. Radio clocks
Viva ? voce
22 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.3 MOVE A DATA BLOCK WITHOUT OVERLAP
Aim:
To write an assembly language program to move a block of data to another memory location and execute it
using 8086
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Algorithm:
1. Initialize the source and destination memory location to SI and DI register
2. Initialize the counter (CL register)
3. Move the data to designation memory through AL register
4. Decrement the count
5. Check for zero flag and if zero flag is set go to next step
6. else go to step 3
7. Stop
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
23 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


Program:
Address Label Mnemonics
1000 MOV CL, 08
1003 MOV SI, 1200
1007 MOV DI, 1300
100B L1 LOD SB
100C MOV [DI], AL
100E INC DI
100F DEC CL
1011 JNZ L1
1013 HLT

Tabulation:
Input Output
Address Data Address Data




Result:
Thus an Assembly Language Program for moving data to another location is written the program is
executed using 8086 and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts and write the ALP program for
moving data to another location.



24 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00



1. List out the Flag manipulation instruction.
2. Define ? Variables
3. Define ? Segment Override Prefix
4. How is the memory segment accessed by 8086 microprocessor identified?
5. List out the advantages of using Direct Memory Access (DMA).
6. What is BIOS function call in 8086? (May 2012)
7. List out the difference between procedures and Macros.
8. What is meant by maskable interrupts& non-maskable interrupts?
9. What is the Maximum clock frequency in 8086?
10. Which Stack is used in 8086?
11. Define ? Pipeline (Dec 2011)
12. How many address lines are available in 8086? What is the maximum address possible?
13. What is an assembler?( May 2012)
14. What is the purpose of LEA instruction in 8086? (May 2012)
15. Give the function of index and pointers in 8086.
16. What are the different instruction set of 8086?
17. Give the various addressing modes in 8086.
18. Give the differences between JUMP and LOOP instruction.
19. Give the physical address formation of any two addressing mode.
20. Give the use of ?ASSUME? in 8086 programming.
Applications:
1. Priority Encoder
2. DVD players
3. Cellular telephones
4. Household appliances
5. Car equipment
Viva ? voce
25 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.4 MATRIX OPERATIONS
Aim:
To write an assembly language program to perform matrix addition and to execute it using 8086
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Algorithm:
1. Get the size (count) of the matrix
2. Initialize SI pointer for storing first matrix
3. Initialize DI pointer for storing second matrix
4. Move the contents pointed by SI pointer to accumulator
5. Move the contents pointed by DI pointer BL register
6. Add the contents of accumulator and BL register
7. Store result in the address pointed by DI pointer
8. Increment DI and SI pointer by 1 and Decrement count by 1
9. Check for zero. If no zero jump to step 4 else go to step 11
10. Stop the execution
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result

26 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV CL, 09
1003 MOV SI, 1100
1007 MOV DI, 1200
100B L1 MOV AL, [SI]
100D MOV BL, [DI]
100F ADD AL, BL
1011 MOV [DI], AL
1013 INC SI
1014 INC DI
1015 DEC CL
1017 JNZ L1
1019 HLT

Tabulation:
Input Output
Address Data Address Data



Result:
Thus an assembly language program for matrix addition was written. It is executed using 8086
microprocessor and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts of moving and adding the group
of data from one location to another location.







27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


1. Write an ALP for 8086 to multiply two 16 bit unsigned numbers.
2. What is an accumulator?
3. List out the segment register available in 8086.
4. List out any four program control instructions that are available in 8086.
5. What is program counter?
6. Give any four logical instructions in 8086.
7. How many memory locations are available in 8086 microprocessor?
8. What are the general purposes registers in 8086?
9. What are the functional units in 8086?
10. How much memory location allotted for the particular segments registers in 8086?
11. When the 8086 processor is in minimum mode and maximum mode?
12. Define ? Segment Override Prefix.
13. Define ? Macro and Procedure
14. Define ? Assembler and assembler directives
15. Define ? Compiler and Linker
16. What is meant by modular programming?
17. Explain the uses of PUSH and POP instruction.
18. Explain the uses of CALL and RET instruction.
19. Identify the addressing modes in the following instructions.
AND AL, BL
SUB AL, 24H
MOV AL, (BP)
MOV CX, 1245H
20. What are the 8086 instructions used for BCD arithmetic?

Applications:
1. Toys
2. Light switches and dimmers
3. Electrical circuit breakers
4. Smoke alarms
5. Battery packs


Viva ? voce
28 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.5 SEARCHING AND SORTING A STRING IN A
GIVEN ARRAY
a) Searching a String in a Given Array:
Aim:
To write an assembly language program to search a string in the given array and to execute it using 8086
kit.
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Algorithm:
1. Initialize the source and destination memory in SI and DI register
2. Initialize the count (CL) and Load the string values to any register (DL)
3. Move string to AL register and Compare the register (DL and AL)
4. Check for zero flag and if it is set jump to step 7 else go to step 9
5. Store the value of AL register
6. Increment DI register by one, Increment SI register by one and Decrement CL register by one
7. Check for zero flag and if it is set jump to step 12 else go to step 4
8. Stop the execution
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Type the Assembly Language Program
6. Press ?RESET? key
To executive the program
7. Press ?GO?
8. Type the starting address to execute the program
9. Press ?RESET? key
To verify the result
29 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

10. Type ?SB(Substitute Byte)?
11. Enter the output address location to check the result
Program:
Address Label Mnemonics
1000 MOV DI, 1300
1004 MOV SI, 1200
1008 MOV CL, 06
100B MOV DL, 02
100E L1 MOV AL, [SI]
1010 CMP DL, AL
1012 JNZ L2
1014 MOV [DI], AL
1016 INC DI
1017 L2 INC SI
1018 DEC CL
101A JNZ L1
101C HLT

Tabulation:
Input Output
Address Data Address Data


Result:
Thus an assembly language program to search a string in the string in the given array is written. The
program is executed using 8086 and the output is verified.






30 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

b) Sorting an Array of Data Using 8086:
Aim:
To write an assembly language program to sort an array of data in ascending and descending order and
execute it using 8086 kit
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
1. Ascending Order:
Algorithm:
1. Set SI as pointer for array
2. Set CL as outer loop counter
3. Initialize array pointer
4. Set CH as inner loop counter
5. Increment array pointer
6. Get the first element of array
7. Increment array pointer and Compare the two elements
31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

8. Checks carry flag. If carry flag is set go to step 11 else go to step 10
9. Swap the content of the memory location
10. Decrement the inner loop counter
11. Check zero flag. If it is set go to step 13 else go to step 7
12. Decrement outer loop counter
13. Check zero flag. If it is set go to step 15 else go to step 3 and stop
Program:
Address Label Mnemonics
1000 MOV SI, 1100H
1004 MOV CL, [SI]
1006 DEC CL
008 Repeat MOV SI, 1100H
100C MOV CH, [SI]
100E DEC CH
1010 INC SI
1011 Rep MOV AL, [SI]
1013 INC SI
1014 CMP AL, [SI]
1016 JC Ahead
1018 XCHG AL, [SI]
101A XCHG AL, [SI-1]
101D Ahead DEC CH
101F JNZ Rep
1021 DEC CL
1023 JNZ Repeat
1025 HLT
Tabulation:
Input Output
Address Data Address Data



32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

2. Descending Order:
Algorithm:
1. Set SI as pointer for array
2. Set CL as outer loop counter
3. Initialize array pointer
4. Set CH as inner loop counter
5. Increment array pointer Get the first element of array
6. Increment array pointer
7. Compare the two elements
8. Checks carry flag. If carry flag is set go to step 11 else go to step 10
9. Swap the content of the memory location
10. Decrement the inner loop counter
11. Check zero flag. If it is set go to step 13 else go to step 7
12. Decrement outer loop counter
13. Check zero flag. If it is set go to step 15 else go to step 3
14. Stop
Program:
Address Label Mnemonics
1000 MOV SI, 1100H
1004 MOV CL, [SI]
1006 DEC CL
1008 Repeat MOV SI, 1100H
100C MOV CH, [SI]
100E DEC CH
1010 INC SI
1011 Rep MOV AL, [SI]
1013 INC SI
1014 CMP AL, [SI]
1016 JNC Ahead
1018 XCHG AL, [SI]
101A XCHG AL, [SI-1]
101D Ahead DEC CH
101F JNZ Rep
1021 DEC CL
1023 JNZ Repeat
1025 HLT

33 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


Result:
Thus an assembly language program is written to sort an array of data in ascending and descending order.
The program is executed using 8086 and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts and write the Assembly
Language Program for Searching and Sorting.

1. What is the relation between 8086 processor frequency & crystal Frequency?
2. What is the position of the stack pointer after the POP instruction?
3. Compare CALL and JMP instructions.
4. Define ? Baud Rate
5. What is the size of instruction queue in 8086?
6. Compare JNC and JMP instructions.
7. What happens when HLT instruction is executed in processor?
8. What is the maximum internal clock frequency of 8086 processor?
9. What are the functions of BIU?
10. Write an ALP program to search a number 05 from a given array.
11. What is cache memory?
12. Can ROM be used as stack?
13. What are the 8086 instructions used for BCD arithmetic?
14. What are the 8086 instructions used for ASCII arithmetic?
15. List the various string instructions available in 8086.
16. How will carry and zero flags reflect the result of instruction CMP BX, CX?
17. Give any four miscellaneous instructions in 16-bit Microprocessor
18. List the flags in 8086 and state its functions.
19. What is the purpose of segment registers in 8086?
20. What is virtual addressing mode?

Viva ? voce
34 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Applications:
1. Car keys
2. Power tool
3. Home security system
4. Dishwashers
5. Washing machines
35 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.6 PASSWORD CHECKING AND PRINT RAM SIZE
WITH SYSTEM DATE
Aim:
To write an assembly language program to Check Password.
Apparatus required:
1. Personal Computer
2. MASM Software
Procedure:
1. Go to Start, Programs, MS-DOS Prompt (or Command Window). Once the DOS window is open, type
the command EDIT. Type your file and save it to your .ASM directory. Be sure it has a .ASM
extension. Do not close the DOS window or the editor.
2. Go to Start, Programs, MS-DOS Prompt (or Command Window). This will open a second DOS
window. Change to your .ASM directory and issue the commands to run MASM.
3. Click compile, link and run it.
a) C: cd \COP3402
b) MASM/L FIRST.ASM
c) LINK FIRST.OBJ
d) FIRST.EXE
4. For errors after issuing the MASM command, fix the .ASM file and redo the above steps.
5. open the file FIRST.LST to clear all errors
6. Click compile, link and run it.
a) MASM/L FIRST.ASM
b) LINK FIRST.OBJ
c) FIRST.EXE
Program:
.MODEL SMALL
.DATA
PASS DB ?ABC?
MES1 DB 10,13,?ENTER 3 CHARACTER PASSWORD $?
MES2 DB 10,13,?PASSWORD IS CORRECT $?
MES3 DB 10,13,?PASSWORD ID WRONG $ ?
.CODE
START: MOV AX,@DATA
MOV DS,AX
MOV AH,09H
LEA DX,MES1
INT 21H
36 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

MOV CL,00
MOV DL,OOH
XOR DI,DI
.WHILE CL!=3
MOV AH,07H
INT 21H
LEA BX,PASS
MOV AH,[BX+DI]
.IF AL==AH
ADD DL,01
.ENDIF
INC DI
INC CL
.ENDW
.IF DL==3
MOV AH,09H
LEA DX,MES2
INT 21H
.ELSE
MOV AH,09H
LEA DX,MES3
INT 21H
.ENDIF
MOV AH,4CH
INT 21H
END START
END
Result:
Thus the given password is checked and the result is verified.
Outcome:
At the end of this experiment the students able to understand the concepts of password checking and print
ram size with system date.








37 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00



1. What is the role of Stack?
2. What is the difference between DOS and BIOS interrupts?
3. What is an interrupt vector Tabulation: of 8086?
4. What .model small stands for?
5. Define ? Interrupt Vector Tabulation
6. What are the contents of AL and CY after the execution of the following segments?
7. What is the purpose of CLK signal in an 8086 system?
8. What is the need for MN/MX pin in 8086 system?
9. What is the purpose of QUEUE in 8086 processor?
10. Give the operation of TEST instructions of 8086?
11. List out few string instructions of 8086.
12. What is the use of LOCK prefix?
13. What is the purpose of REP prefix?
14. What are the types of Multiprocessor configuration?
15. Define ? Co-processor
16. List any four program control instructions available in 8086?
17. How the data and address lines are demultiplexed?
18. Define ? Instruction
19. Define ? Machine Cycle
20. Define ? T-State
Applications:
1. High-end coffee makers
2. Radio clocks
3. Televisions
4. VCRs
5. DVD players
Viva ? voce
38 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.7 COUNTERS AND TIME DELAY

Aim:
To write an assembly language program to display the current system time and date
Apparatus required:
1. Personal Computer
2. MASM Software
Procedure:

1. Go to Start, Programs, MS-DOS Prompt (or Command Window). Once the DOS window is open, type
the command EDIT. Type your file and save it to your .ASM directory. Be sure it has a .ASM
extension. Do not close the DOS window or the editor.
2. Go to Start, Programs, MS-DOS Prompt (or Command Window). This will open a second DOS
window. Change to your .ASM directory and issue the commands to run MASM.
3. Click compile, link and run it.
a) C:
b) cd \ COP3402
c) MASM/L FIRST.ASM
d) LINK FIRST.OBJ
e) FIRST.EXE
4. For errors after issuing the MASM command, fix the .ASM file and redo the above steps.
5. open the file FIRST.LST to clear all errors
6. Click compile, link and run it.
a) MASM/L FIRST.ASM
b) LINK FIRST.OBJ
c) FIRST.EXE
Program:
.MODEL SMALL
.STACK 100H
.DATA
PROMPT DB 'Current System Time is : $'
TIME DB '00:00:00$'
.CODE
MAIN PROC
39 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

MOV AX, @DATA
MOV DS, AX
LEA BX, TIME
CALL GET_TIME
LEA DX, PROMPT
MOV AH, 09H
INT 21H
LEA DX, TIME
MOV AH, 09H
INT 21H
MOV AH, 4CH
INT 21H
MAIN ENDP
GET_TIME PROC
PUSH AX
PUSH CX
MOV AH, 2CH
INT 21H
MOV AL, CH
CALL CONVERT
MOV [BX], AX
MOV AL, CL
CALL CONVERT
MOV [BX+3], AX
MOV AL, DH
CALL CONVERT
MOV [BX+6], AX
POP CX
POP AX
RET
GET_TIME ENDP
Result:
Thus the systems current date is fetched, displayed and the result is verified.

Outcome:
At the end of this experiment the students able to understand the concepts of counters and time delay.





FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING


EC6513 ? MICROPROCESSOR AND MICROCONTROLLERLABORATORY


V SEMESTER - R 2013










Name : _______________________________________
Register No. : _______________________________________
Section : _______________________________________



LABORATORY MANUAL
2 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY


C01 - To learn the working of ARM processor
C02 - To introduce ALP concepts and features
C03 - To write ALP for arithmetic and logical operations in 8086 and 8051
C04 - To differentiate Serial and Parallel Interface
C05 - To interface different I/Os with Microprocessors
C06 - To be familiar with MASM
.




1. Write programs in ARM for a specific Application
2. Write ALP Programs for fixed and Floating Point and Arithmetic
3. Interface different I/Os with processor and Generate waveforms using Microprocessors
4. Execute Programs in 8051
5. Assess the performance of optical devices: light sources, fibers and detectors from both physical and system
point of view

INTRODUCTION
This course illustrates the concepts covered in course CS6412 and provides students with hands-on
experience in Assembly language programs.
PREREQUISITE:
1. Digital Electronics
EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
Lecture
No./Session No.
Name of the Experiment
Course
objectives
Proposed
date

1,2,3
Introduction to lab
CO1

CYCLE I - 8086 PROGRAMS USING KITS AND MASM
4,5,6 Basic arithmetic and Logical operations CO2
COURSE OBJECTIVES
COURSE OUTCOMES
3 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00













7,8,9 Decimal arithmetic and Code conversion CO3
10,11,12
Move a data block without overlap
CO3
Matrix operations
13,14,15 Searching and Sorting a sting in a given array CO2
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
16,17,18 D/A interface and Waveform Generation CO4
19,20,21 A/D interface CO5
22,23,24 Key board and Display CO5
25,26,27
Stepper motor control CO2
Traffic light control CO5
28,29,30
Digital clock CO6
Serial interface and Parallel interface CO4
CYCLE III - 8051 PROGRAMS USING KITS AND MASM
31,32,33 Basic arithmetic and Logical operations CO1
34,35,36
Square and Cube program, Find 2?s complement of a number
CO5
Unpacked BCD to ASCII
37,38,39
Password checking and Print RAM size with system date
CO6
Counters and Time Delay
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
40,41,42 Sorting of an array using 8051 CO2
43,44,45
Separate odd and even numbers using 8086


CO3
Sum of N consecutive numbers using 8086
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00




College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING




To impart professional education integrated with human values to the younger generation, so as to shape
them as proficient and dedicated engineers, capable of providing comprehensive solutions to the challenges in
deploying technology for the service of humanity



? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices


VISION
MISSION
VISION
MISSION
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of
engineering that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this
enables to find solutions for real time problem in industry and organization and to design products
requiring interdisciplinary skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up
their communication skills, individual leadership and supportive qualities and to develop them to adapt and
work in ever changing technologies
5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees











6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer
Science and Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the
career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both
verbal and written forms
i) To work in a team as team member or a leader and make unique contributions and work with
coordination
j) To engage lifelong learning and exhibit their technical skills
k) To develop and manage projects in multidisciplinary environments










7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER
LABORATORY
SYLLABUS

? To learn the working of ARM processor
? To introduce ALP concepts and features
? To write ALP for arithmetic and logical operations in 8086 and 8051
? To differentiate Serial and Parallel Interface
? To interface different I/Os with Microprocessors
? To be familiar with MASM
LIST OF EXPERIMENTS:
8086 Programs using kits and MASM
1. Basic arithmetic and Logical operations
2. Move a data block without overlap
3. Code conversion, decimal arithmetic and Matrix operations.
4. Floating point operations, string manipulations, sorting and searching
5. Password checking, Print RAM size and system date
6. Counters and Time Delay
Peripherals and Interfacing Experiments
7. Traffic light control
8. Stepper motor control
9. Digital clock
10. Key board and Display
11. Printer status
12. Serial interface and Parallel interface
13. A/D and D/A interface and Waveform Generation 8051
Experiments using kits and MASM
14. Basic arithmetic and Logical operations
15. Square and Cube program, Find 2 ?s complement of a number
16. Unpacked BCD to ASCII

? Write programs in ARM for a specific Application
? Write ALP Programs for fixed and Floating Point and Arithmetic
? Interface different I/Os with processor and Generate waveforms using Microprocessors
? Execute Programs in 8051
? Assess the performance of optical devices: light sources, fibers and detectors from both physical and
system point of view


COURSE OUTCOMES
COURSE OBJECTIVES
8 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 - 8086 PROGRAMS USING KITS AND MASM
1 Basic arithmetic and Logical operations 10
2 Decimal arithmetic and Code conversion 15
3 Move a data block without overlap 21
4 Matrix operations 24
5 Searching and Sorting a sting in a given array 27
6 Password checking and Print RAM size with system date 33
7 Counters and Time Delay 36
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
8 Stepper motor control 39
9 Traffic light control 42
10 Digital clock 47
11 Serial interface and Parallel interface 50
12 A/D interface 54
13 Key board and Display 57
14 D/A interface and Waveform Generation 60
CYCLE 3 - 8051 PROGRAMS USING KITS AND MASM
15 Basic arithmetic and Logical operations 64
16 Square and Cube program, Find 2?s complement of a number 69
17 Unpacked BCD to ASCII 71
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
18 Sorting of an array using 8051 74
19 Separate odd and even numbers using 8086 77
20 Sum of N consecutive numbers using 8086 80

9 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.1 BASIC ARITHMETIC AND LOGICAL OPERATIONS

Aim:
To write an Assembly Language Program to perform Arithmetic operation and to execute using 8086
microprocessor
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
Arithmetic Operation:
1. Addition:
Algorithm:
1. Clear BL register to store carry
2. Get the addend in AX register pair
3. Get the Augend in CX register pair
4. Add Augend and addend
5. Check for carry, If it is one go to step 6 else go to step 7
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

6. Increments carry (BL register by 1)
7. Store the sum in memory from AX register pair
8. Store the carry in memory from BL register
9. Stop
Program:
Address
Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 1010H
1007 MOV CX, 2020H
100B CLC
100C ADD AX, CX
100E JNC Label1
1010 INC BL
1012 Label 1 MOV [1200], AX
1016 MOV [1202], BL
101A HLT
Precaution:
Make sure that all the machine codes should be as per the specified in the program.
Tabulation:
Input Output
Address Data Address Data








2. Subtraction:
Algorithm:
1. Clear BL register for storing borrow
2. Get the minuend in AX register pair
3. Get the subtrahend in CX register pair
4. Subtract minuend and subtrahend
5. Check borrow, if borrow is one go to step 6 else go to step 8
6. Increment borrow (BL register by 1)
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

7. Negate AX register
8. Store the difference from AX in memory
9. Story the borrow from BL in memory
10. Stop
Program:
Address Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 2024H
1007 MOV CX, 1010H
100B SUB AX, CX
100D JNC Label1
100F INC BL
1011 NEG AX
1013 Label 1 MOV [1200], AX
1017 MOV [1202], BL
101B HLT

Tabulation:
Input Output
Address Data Address Data






3. Multiplication
Algorithm:
1. Clear DX register
2. Load the AX register pair with multiplicand
3. Load the CX register pair with multiplier
4. Multiply multiplicand and multiplier
5. Store the higher byte of product(from DX register pair) in memory specified
6. Store the lower byte of product(from AX register pair) in memory specified
7. Stop
8.
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV DX, 0000H
1004 MOV AX, 00FFH
1008 MOV CX, 0002H
100C MUL CX
100E MOV [1200], AX
1012 MOV [1202], DX
1016 HLT
Tabulation:
Input Output
Address Data Address Data






4. Division:
Algorithm
1. Clear DX register
2. Load the AX register pair with dividend
3. Load the CX register pair with divisor
4. Dividend divided by divisor
5. Store the quotient (from AX register pair) in memory specified
6. Store the remainder (from DX register pair) in memory specified
7. Stop
Program:
Address Label Mnemonics
1000 MOV DX, 0000H
1004 MOV AX, 0008H
1008 MOV CX, 0004H
100C DIV CX
100E MOV [1200], AX
1012 MOV [1202], DX
1016 HLT

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


Result:
Thus Assembly language program are written to perform arithmetic operation using 8086 microprocessor.
They are executed using 8086 processor and the outputs are verified.
Outcome:
At the end of this experiment the students able to write ALP programs for Arithmetic and Logical operations.

1. Write the size of the data bus of 8086.
2. Write the size of the address bus of 8086.
3. What is meant by physical addressing in 8086?
4. What is meant by an Opcode?
5. What is meant by an Operand?
6. What is meant by a Mnemonics?
7. What are the other possibilities of writing ADD, SUB and MUL instructions in other addressing modes?
8. What is the difference between microprocessor and microcontroller?
9. What is meant by LATCH?
10. What is the difference between primary & secondary storage device?
11. What is the difference between static and dynamic RAM?
12. What is an interrupt?
13. Differentiate between RAM and ROM?
14. Define ? Compiler
15. Define ? Flag
16. Define ? Stack
17. How clock signal is generated in 8086 microprocessor?
18. State the functions of queue status line QS0 and QS1 in 8086 microprocessor.
19. What is the purpose of BIU& EU?
20. List out the two examples of assembler directives.

Viva ? voce
15 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Applications:
1. barrel shifters
2. Multiple-precision arithmetic
3. Calculation pipeline
4. binary multipliers
5. Calculation in a single clock

16 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.2 DECIMAL ARITHMETIC AND CODE CONVERSION
Aim:
To write an Assembly Language Program to perform Code conversion and Decimal Arithmetic operations
and to execute using 8086 microprocessor
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
Decimal Arithmetic:
1. Using DAA
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Clear the CL reg.
4. Add the contents of AL and BL.
5. Adjust decimal accumulator after addition.
6. Store the result.
17 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 MOV CL, 00
100B ADD AL,BL
100D DAA
100E JNC L1
1010 INC CL
1012 L1 MOV [1150], AL
1016 MOV [1151], CL
101A HLT

Tabulation:
Input Output
Address Data Address Data


2. Using AAM
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Multiply the contents of AL and BL.
4. Adjust decimal accumulator after multiplication.
5. Store the result.
Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 MUL BL
100A AAM
100C MOV [1150], AH
1010 MOV [1151], AL
1014 HLT

18 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


3. Using DAS
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Subtract the contents of BL from AL.
4. Adjust decimal accumulator after subtraction.
5. Store the result.
Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 SUB AL,BL
100A DAS
100B MOV [1150], AL
100F HLT
Tabulation:
Input Output
Address Data Address Data


Code Conversion:
1. Binary to BCD
Algorithm:
1. Get the input and store in AL.
2. Clear the carry flag.
3. Rotate right the bits of input.
4. Find logical XOR between input and shifted input.
5. Store the result.
19 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 XOR AX,AX
1002 XOR CX,CX
1004 MOV BX,000B
1008 L2 CMP BX,00
100C JZ L1
100E DEC BX
100F MOV AL,CL
1011 ADD AL,01
1014 DAA
1015 MOV CL,AL
1017 MOV AL,CH
1019 ADC AL,00
101C DAA
101D MOV CH,AL
101F JMP L2
1022 MOV [1150],CX
1026 HLT
Tabulation:
Input Output
Address Data Address Data




2. Binary to Gray
Algorithm:
1. Get the input and store in AL.
2. Clear the carry flag.
3. Rotate right the bits of input.
4. Find logical XOR between input and shifted input.
5. Store the result.

20 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, AL
1006 CLC
1007 MOV CL,01
100A RCR AL,CL
100C XOR BL,AL
100E MOV [1150],BL
1012 HLT
Tabulation:
Input Output
Address Data Address Data


Result:
Thus an Assembly Language Program for code conversion and decimal arithmetic operations is written. The
program is executed using 8086 and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts of code conversions and
decimal arithmetic operations.








21 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


1. Write the function of the following 8085 instructions: JP, JPE, JPO, and JNZ.
2. What is the purpose of the following commands in 8086?
a) AAD
b) RCL
3. List out the addressing modes in 8086.
4. List out the various string instructions that are available in 8086.
5. What are the 8086 instructions used for BCD arithmetic?
6. What flags get affected after executing ADD instruction?
7. Which instruction is used to add immediate data?
8. What is BCD code? Where it is used?
9. What is ASCII code? Where it is used?
10. What is the difference between carry flag and overflow flag?
11. What are the special function register associated with interrupts?
12. List the flags affected by arithmetic instructions.
13. After executing ADDC instruction, what flags get affected?
14. How many bytes the instruction ADDC will add?
15. Name the signals used by the processor to communicate with an I/O processor
16. What is the function of IP?
17. What is the use of base pointer register?
18. Mention the index registers of 8086.
19. How many memory locations are available in 8086 microprocessor?
20. What are the flags in 8086? What are the various interrupts in 8086?
Applications:
1. Programmable calculators
2. Counting system using counts the tennis ball
3. Detecting and Correcting an Error with the Hamming Code
4. Power tool
5. Radio clocks
Viva ? voce
22 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.3 MOVE A DATA BLOCK WITHOUT OVERLAP
Aim:
To write an assembly language program to move a block of data to another memory location and execute it
using 8086
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Algorithm:
1. Initialize the source and destination memory location to SI and DI register
2. Initialize the counter (CL register)
3. Move the data to designation memory through AL register
4. Decrement the count
5. Check for zero flag and if zero flag is set go to next step
6. else go to step 3
7. Stop
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
23 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


Program:
Address Label Mnemonics
1000 MOV CL, 08
1003 MOV SI, 1200
1007 MOV DI, 1300
100B L1 LOD SB
100C MOV [DI], AL
100E INC DI
100F DEC CL
1011 JNZ L1
1013 HLT

Tabulation:
Input Output
Address Data Address Data




Result:
Thus an Assembly Language Program for moving data to another location is written the program is
executed using 8086 and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts and write the ALP program for
moving data to another location.



24 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00



1. List out the Flag manipulation instruction.
2. Define ? Variables
3. Define ? Segment Override Prefix
4. How is the memory segment accessed by 8086 microprocessor identified?
5. List out the advantages of using Direct Memory Access (DMA).
6. What is BIOS function call in 8086? (May 2012)
7. List out the difference between procedures and Macros.
8. What is meant by maskable interrupts& non-maskable interrupts?
9. What is the Maximum clock frequency in 8086?
10. Which Stack is used in 8086?
11. Define ? Pipeline (Dec 2011)
12. How many address lines are available in 8086? What is the maximum address possible?
13. What is an assembler?( May 2012)
14. What is the purpose of LEA instruction in 8086? (May 2012)
15. Give the function of index and pointers in 8086.
16. What are the different instruction set of 8086?
17. Give the various addressing modes in 8086.
18. Give the differences between JUMP and LOOP instruction.
19. Give the physical address formation of any two addressing mode.
20. Give the use of ?ASSUME? in 8086 programming.
Applications:
1. Priority Encoder
2. DVD players
3. Cellular telephones
4. Household appliances
5. Car equipment
Viva ? voce
25 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.4 MATRIX OPERATIONS
Aim:
To write an assembly language program to perform matrix addition and to execute it using 8086
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Algorithm:
1. Get the size (count) of the matrix
2. Initialize SI pointer for storing first matrix
3. Initialize DI pointer for storing second matrix
4. Move the contents pointed by SI pointer to accumulator
5. Move the contents pointed by DI pointer BL register
6. Add the contents of accumulator and BL register
7. Store result in the address pointed by DI pointer
8. Increment DI and SI pointer by 1 and Decrement count by 1
9. Check for zero. If no zero jump to step 4 else go to step 11
10. Stop the execution
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result

26 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV CL, 09
1003 MOV SI, 1100
1007 MOV DI, 1200
100B L1 MOV AL, [SI]
100D MOV BL, [DI]
100F ADD AL, BL
1011 MOV [DI], AL
1013 INC SI
1014 INC DI
1015 DEC CL
1017 JNZ L1
1019 HLT

Tabulation:
Input Output
Address Data Address Data



Result:
Thus an assembly language program for matrix addition was written. It is executed using 8086
microprocessor and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts of moving and adding the group
of data from one location to another location.







27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


1. Write an ALP for 8086 to multiply two 16 bit unsigned numbers.
2. What is an accumulator?
3. List out the segment register available in 8086.
4. List out any four program control instructions that are available in 8086.
5. What is program counter?
6. Give any four logical instructions in 8086.
7. How many memory locations are available in 8086 microprocessor?
8. What are the general purposes registers in 8086?
9. What are the functional units in 8086?
10. How much memory location allotted for the particular segments registers in 8086?
11. When the 8086 processor is in minimum mode and maximum mode?
12. Define ? Segment Override Prefix.
13. Define ? Macro and Procedure
14. Define ? Assembler and assembler directives
15. Define ? Compiler and Linker
16. What is meant by modular programming?
17. Explain the uses of PUSH and POP instruction.
18. Explain the uses of CALL and RET instruction.
19. Identify the addressing modes in the following instructions.
AND AL, BL
SUB AL, 24H
MOV AL, (BP)
MOV CX, 1245H
20. What are the 8086 instructions used for BCD arithmetic?

Applications:
1. Toys
2. Light switches and dimmers
3. Electrical circuit breakers
4. Smoke alarms
5. Battery packs


Viva ? voce
28 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.5 SEARCHING AND SORTING A STRING IN A
GIVEN ARRAY
a) Searching a String in a Given Array:
Aim:
To write an assembly language program to search a string in the given array and to execute it using 8086
kit.
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Algorithm:
1. Initialize the source and destination memory in SI and DI register
2. Initialize the count (CL) and Load the string values to any register (DL)
3. Move string to AL register and Compare the register (DL and AL)
4. Check for zero flag and if it is set jump to step 7 else go to step 9
5. Store the value of AL register
6. Increment DI register by one, Increment SI register by one and Decrement CL register by one
7. Check for zero flag and if it is set jump to step 12 else go to step 4
8. Stop the execution
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Type the Assembly Language Program
6. Press ?RESET? key
To executive the program
7. Press ?GO?
8. Type the starting address to execute the program
9. Press ?RESET? key
To verify the result
29 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

10. Type ?SB(Substitute Byte)?
11. Enter the output address location to check the result
Program:
Address Label Mnemonics
1000 MOV DI, 1300
1004 MOV SI, 1200
1008 MOV CL, 06
100B MOV DL, 02
100E L1 MOV AL, [SI]
1010 CMP DL, AL
1012 JNZ L2
1014 MOV [DI], AL
1016 INC DI
1017 L2 INC SI
1018 DEC CL
101A JNZ L1
101C HLT

Tabulation:
Input Output
Address Data Address Data


Result:
Thus an assembly language program to search a string in the string in the given array is written. The
program is executed using 8086 and the output is verified.






30 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

b) Sorting an Array of Data Using 8086:
Aim:
To write an assembly language program to sort an array of data in ascending and descending order and
execute it using 8086 kit
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
1. Ascending Order:
Algorithm:
1. Set SI as pointer for array
2. Set CL as outer loop counter
3. Initialize array pointer
4. Set CH as inner loop counter
5. Increment array pointer
6. Get the first element of array
7. Increment array pointer and Compare the two elements
31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

8. Checks carry flag. If carry flag is set go to step 11 else go to step 10
9. Swap the content of the memory location
10. Decrement the inner loop counter
11. Check zero flag. If it is set go to step 13 else go to step 7
12. Decrement outer loop counter
13. Check zero flag. If it is set go to step 15 else go to step 3 and stop
Program:
Address Label Mnemonics
1000 MOV SI, 1100H
1004 MOV CL, [SI]
1006 DEC CL
008 Repeat MOV SI, 1100H
100C MOV CH, [SI]
100E DEC CH
1010 INC SI
1011 Rep MOV AL, [SI]
1013 INC SI
1014 CMP AL, [SI]
1016 JC Ahead
1018 XCHG AL, [SI]
101A XCHG AL, [SI-1]
101D Ahead DEC CH
101F JNZ Rep
1021 DEC CL
1023 JNZ Repeat
1025 HLT
Tabulation:
Input Output
Address Data Address Data



32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

2. Descending Order:
Algorithm:
1. Set SI as pointer for array
2. Set CL as outer loop counter
3. Initialize array pointer
4. Set CH as inner loop counter
5. Increment array pointer Get the first element of array
6. Increment array pointer
7. Compare the two elements
8. Checks carry flag. If carry flag is set go to step 11 else go to step 10
9. Swap the content of the memory location
10. Decrement the inner loop counter
11. Check zero flag. If it is set go to step 13 else go to step 7
12. Decrement outer loop counter
13. Check zero flag. If it is set go to step 15 else go to step 3
14. Stop
Program:
Address Label Mnemonics
1000 MOV SI, 1100H
1004 MOV CL, [SI]
1006 DEC CL
1008 Repeat MOV SI, 1100H
100C MOV CH, [SI]
100E DEC CH
1010 INC SI
1011 Rep MOV AL, [SI]
1013 INC SI
1014 CMP AL, [SI]
1016 JNC Ahead
1018 XCHG AL, [SI]
101A XCHG AL, [SI-1]
101D Ahead DEC CH
101F JNZ Rep
1021 DEC CL
1023 JNZ Repeat
1025 HLT

33 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


Result:
Thus an assembly language program is written to sort an array of data in ascending and descending order.
The program is executed using 8086 and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts and write the Assembly
Language Program for Searching and Sorting.

1. What is the relation between 8086 processor frequency & crystal Frequency?
2. What is the position of the stack pointer after the POP instruction?
3. Compare CALL and JMP instructions.
4. Define ? Baud Rate
5. What is the size of instruction queue in 8086?
6. Compare JNC and JMP instructions.
7. What happens when HLT instruction is executed in processor?
8. What is the maximum internal clock frequency of 8086 processor?
9. What are the functions of BIU?
10. Write an ALP program to search a number 05 from a given array.
11. What is cache memory?
12. Can ROM be used as stack?
13. What are the 8086 instructions used for BCD arithmetic?
14. What are the 8086 instructions used for ASCII arithmetic?
15. List the various string instructions available in 8086.
16. How will carry and zero flags reflect the result of instruction CMP BX, CX?
17. Give any four miscellaneous instructions in 16-bit Microprocessor
18. List the flags in 8086 and state its functions.
19. What is the purpose of segment registers in 8086?
20. What is virtual addressing mode?

Viva ? voce
34 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Applications:
1. Car keys
2. Power tool
3. Home security system
4. Dishwashers
5. Washing machines
35 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.6 PASSWORD CHECKING AND PRINT RAM SIZE
WITH SYSTEM DATE
Aim:
To write an assembly language program to Check Password.
Apparatus required:
1. Personal Computer
2. MASM Software
Procedure:
1. Go to Start, Programs, MS-DOS Prompt (or Command Window). Once the DOS window is open, type
the command EDIT. Type your file and save it to your .ASM directory. Be sure it has a .ASM
extension. Do not close the DOS window or the editor.
2. Go to Start, Programs, MS-DOS Prompt (or Command Window). This will open a second DOS
window. Change to your .ASM directory and issue the commands to run MASM.
3. Click compile, link and run it.
a) C: cd \COP3402
b) MASM/L FIRST.ASM
c) LINK FIRST.OBJ
d) FIRST.EXE
4. For errors after issuing the MASM command, fix the .ASM file and redo the above steps.
5. open the file FIRST.LST to clear all errors
6. Click compile, link and run it.
a) MASM/L FIRST.ASM
b) LINK FIRST.OBJ
c) FIRST.EXE
Program:
.MODEL SMALL
.DATA
PASS DB ?ABC?
MES1 DB 10,13,?ENTER 3 CHARACTER PASSWORD $?
MES2 DB 10,13,?PASSWORD IS CORRECT $?
MES3 DB 10,13,?PASSWORD ID WRONG $ ?
.CODE
START: MOV AX,@DATA
MOV DS,AX
MOV AH,09H
LEA DX,MES1
INT 21H
36 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

MOV CL,00
MOV DL,OOH
XOR DI,DI
.WHILE CL!=3
MOV AH,07H
INT 21H
LEA BX,PASS
MOV AH,[BX+DI]
.IF AL==AH
ADD DL,01
.ENDIF
INC DI
INC CL
.ENDW
.IF DL==3
MOV AH,09H
LEA DX,MES2
INT 21H
.ELSE
MOV AH,09H
LEA DX,MES3
INT 21H
.ENDIF
MOV AH,4CH
INT 21H
END START
END
Result:
Thus the given password is checked and the result is verified.
Outcome:
At the end of this experiment the students able to understand the concepts of password checking and print
ram size with system date.








37 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00



1. What is the role of Stack?
2. What is the difference between DOS and BIOS interrupts?
3. What is an interrupt vector Tabulation: of 8086?
4. What .model small stands for?
5. Define ? Interrupt Vector Tabulation
6. What are the contents of AL and CY after the execution of the following segments?
7. What is the purpose of CLK signal in an 8086 system?
8. What is the need for MN/MX pin in 8086 system?
9. What is the purpose of QUEUE in 8086 processor?
10. Give the operation of TEST instructions of 8086?
11. List out few string instructions of 8086.
12. What is the use of LOCK prefix?
13. What is the purpose of REP prefix?
14. What are the types of Multiprocessor configuration?
15. Define ? Co-processor
16. List any four program control instructions available in 8086?
17. How the data and address lines are demultiplexed?
18. Define ? Instruction
19. Define ? Machine Cycle
20. Define ? T-State
Applications:
1. High-end coffee makers
2. Radio clocks
3. Televisions
4. VCRs
5. DVD players
Viva ? voce
38 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.7 COUNTERS AND TIME DELAY

Aim:
To write an assembly language program to display the current system time and date
Apparatus required:
1. Personal Computer
2. MASM Software
Procedure:

1. Go to Start, Programs, MS-DOS Prompt (or Command Window). Once the DOS window is open, type
the command EDIT. Type your file and save it to your .ASM directory. Be sure it has a .ASM
extension. Do not close the DOS window or the editor.
2. Go to Start, Programs, MS-DOS Prompt (or Command Window). This will open a second DOS
window. Change to your .ASM directory and issue the commands to run MASM.
3. Click compile, link and run it.
a) C:
b) cd \ COP3402
c) MASM/L FIRST.ASM
d) LINK FIRST.OBJ
e) FIRST.EXE
4. For errors after issuing the MASM command, fix the .ASM file and redo the above steps.
5. open the file FIRST.LST to clear all errors
6. Click compile, link and run it.
a) MASM/L FIRST.ASM
b) LINK FIRST.OBJ
c) FIRST.EXE
Program:
.MODEL SMALL
.STACK 100H
.DATA
PROMPT DB 'Current System Time is : $'
TIME DB '00:00:00$'
.CODE
MAIN PROC
39 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

MOV AX, @DATA
MOV DS, AX
LEA BX, TIME
CALL GET_TIME
LEA DX, PROMPT
MOV AH, 09H
INT 21H
LEA DX, TIME
MOV AH, 09H
INT 21H
MOV AH, 4CH
INT 21H
MAIN ENDP
GET_TIME PROC
PUSH AX
PUSH CX
MOV AH, 2CH
INT 21H
MOV AL, CH
CALL CONVERT
MOV [BX], AX
MOV AL, CL
CALL CONVERT
MOV [BX+3], AX
MOV AL, DH
CALL CONVERT
MOV [BX+6], AX
POP CX
POP AX
RET
GET_TIME ENDP
Result:
Thus the systems current date is fetched, displayed and the result is verified.

Outcome:
At the end of this experiment the students able to understand the concepts of counters and time delay.





40 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


1. What are the 8086 instructions used for BCD arithmetic?
2. What is the function of BX register?
3. How Physical address is generated?
4. List out the pointers available in 8086
5. Compare PUSH and PULL instructions
6. What is ALE? When will the data bus AD0-AD7 be enabled?
7. Define ? HOLD in 8086
8. Define ? HLDA in 8086
9. Give the significance of RQ / GTO and IO / M signals.
10. Name any two coprocessors and their use.
11. State the importance of sample and hold circuit.
12. List the applications of programmable interval timer.
13. What is key denouncing? What are the methods to detect the denouncing?
14. Name the two modes of operation of DMA controller?
15. Give the different types of command words in 8259.
16. Give the comments for MOV r, M.
17. How many T-states are in MOV instruction?
18. Explain the addressing mode of MOV r, M.
19. How many machine cycles are in MOV instruction?
20. Give the comments for MOV M, r.
Applications:
1. Microwaves
2. Toasters
3. Ovens
4. Stoves
5. Thermostats
Viva ? voce
FirstRanker.com - FirstRanker's Choice
1 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


?



DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING


EC6513 ? MICROPROCESSOR AND MICROCONTROLLERLABORATORY


V SEMESTER - R 2013










Name : _______________________________________
Register No. : _______________________________________
Section : _______________________________________



LABORATORY MANUAL
2 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY


C01 - To learn the working of ARM processor
C02 - To introduce ALP concepts and features
C03 - To write ALP for arithmetic and logical operations in 8086 and 8051
C04 - To differentiate Serial and Parallel Interface
C05 - To interface different I/Os with Microprocessors
C06 - To be familiar with MASM
.




1. Write programs in ARM for a specific Application
2. Write ALP Programs for fixed and Floating Point and Arithmetic
3. Interface different I/Os with processor and Generate waveforms using Microprocessors
4. Execute Programs in 8051
5. Assess the performance of optical devices: light sources, fibers and detectors from both physical and system
point of view

INTRODUCTION
This course illustrates the concepts covered in course CS6412 and provides students with hands-on
experience in Assembly language programs.
PREREQUISITE:
1. Digital Electronics
EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
Lecture
No./Session No.
Name of the Experiment
Course
objectives
Proposed
date

1,2,3
Introduction to lab
CO1

CYCLE I - 8086 PROGRAMS USING KITS AND MASM
4,5,6 Basic arithmetic and Logical operations CO2
COURSE OBJECTIVES
COURSE OUTCOMES
3 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00













7,8,9 Decimal arithmetic and Code conversion CO3
10,11,12
Move a data block without overlap
CO3
Matrix operations
13,14,15 Searching and Sorting a sting in a given array CO2
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
16,17,18 D/A interface and Waveform Generation CO4
19,20,21 A/D interface CO5
22,23,24 Key board and Display CO5
25,26,27
Stepper motor control CO2
Traffic light control CO5
28,29,30
Digital clock CO6
Serial interface and Parallel interface CO4
CYCLE III - 8051 PROGRAMS USING KITS AND MASM
31,32,33 Basic arithmetic and Logical operations CO1
34,35,36
Square and Cube program, Find 2?s complement of a number
CO5
Unpacked BCD to ASCII
37,38,39
Password checking and Print RAM size with system date
CO6
Counters and Time Delay
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
40,41,42 Sorting of an array using 8051 CO2
43,44,45
Separate odd and even numbers using 8086


CO3
Sum of N consecutive numbers using 8086
4 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00




College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING




To impart professional education integrated with human values to the younger generation, so as to shape
them as proficient and dedicated engineers, capable of providing comprehensive solutions to the challenges in
deploying technology for the service of humanity



? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices


VISION
MISSION
VISION
MISSION
5 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of
engineering that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this
enables to find solutions for real time problem in industry and organization and to design products
requiring interdisciplinary skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up
their communication skills, individual leadership and supportive qualities and to develop them to adapt and
work in ever changing technologies
5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees











6 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer
Science and Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the
career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both
verbal and written forms
i) To work in a team as team member or a leader and make unique contributions and work with
coordination
j) To engage lifelong learning and exhibit their technical skills
k) To develop and manage projects in multidisciplinary environments










7 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER
LABORATORY
SYLLABUS

? To learn the working of ARM processor
? To introduce ALP concepts and features
? To write ALP for arithmetic and logical operations in 8086 and 8051
? To differentiate Serial and Parallel Interface
? To interface different I/Os with Microprocessors
? To be familiar with MASM
LIST OF EXPERIMENTS:
8086 Programs using kits and MASM
1. Basic arithmetic and Logical operations
2. Move a data block without overlap
3. Code conversion, decimal arithmetic and Matrix operations.
4. Floating point operations, string manipulations, sorting and searching
5. Password checking, Print RAM size and system date
6. Counters and Time Delay
Peripherals and Interfacing Experiments
7. Traffic light control
8. Stepper motor control
9. Digital clock
10. Key board and Display
11. Printer status
12. Serial interface and Parallel interface
13. A/D and D/A interface and Waveform Generation 8051
Experiments using kits and MASM
14. Basic arithmetic and Logical operations
15. Square and Cube program, Find 2 ?s complement of a number
16. Unpacked BCD to ASCII

? Write programs in ARM for a specific Application
? Write ALP Programs for fixed and Floating Point and Arithmetic
? Interface different I/Os with processor and Generate waveforms using Microprocessors
? Execute Programs in 8051
? Assess the performance of optical devices: light sources, fibers and detectors from both physical and
system point of view


COURSE OUTCOMES
COURSE OBJECTIVES
8 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

EC6513 ? MICROPROCESSOR AND MICROCONTROLLER LABORATORY
CONTENTS
Sl. No. Name of the Experiment Page No.
CYCLE 1 - 8086 PROGRAMS USING KITS AND MASM
1 Basic arithmetic and Logical operations 10
2 Decimal arithmetic and Code conversion 15
3 Move a data block without overlap 21
4 Matrix operations 24
5 Searching and Sorting a sting in a given array 27
6 Password checking and Print RAM size with system date 33
7 Counters and Time Delay 36
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
8 Stepper motor control 39
9 Traffic light control 42
10 Digital clock 47
11 Serial interface and Parallel interface 50
12 A/D interface 54
13 Key board and Display 57
14 D/A interface and Waveform Generation 60
CYCLE 3 - 8051 PROGRAMS USING KITS AND MASM
15 Basic arithmetic and Logical operations 64
16 Square and Cube program, Find 2?s complement of a number 69
17 Unpacked BCD to ASCII 71
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
18 Sorting of an array using 8051 74
19 Separate odd and even numbers using 8086 77
20 Sum of N consecutive numbers using 8086 80

9 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

10 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.1 BASIC ARITHMETIC AND LOGICAL OPERATIONS

Aim:
To write an Assembly Language Program to perform Arithmetic operation and to execute using 8086
microprocessor
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
Arithmetic Operation:
1. Addition:
Algorithm:
1. Clear BL register to store carry
2. Get the addend in AX register pair
3. Get the Augend in CX register pair
4. Add Augend and addend
5. Check for carry, If it is one go to step 6 else go to step 7
11 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

6. Increments carry (BL register by 1)
7. Store the sum in memory from AX register pair
8. Store the carry in memory from BL register
9. Stop
Program:
Address
Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 1010H
1007 MOV CX, 2020H
100B CLC
100C ADD AX, CX
100E JNC Label1
1010 INC BL
1012 Label 1 MOV [1200], AX
1016 MOV [1202], BL
101A HLT
Precaution:
Make sure that all the machine codes should be as per the specified in the program.
Tabulation:
Input Output
Address Data Address Data








2. Subtraction:
Algorithm:
1. Clear BL register for storing borrow
2. Get the minuend in AX register pair
3. Get the subtrahend in CX register pair
4. Subtract minuend and subtrahend
5. Check borrow, if borrow is one go to step 6 else go to step 8
6. Increment borrow (BL register by 1)
12 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

7. Negate AX register
8. Store the difference from AX in memory
9. Story the borrow from BL in memory
10. Stop
Program:
Address Label Mnemonics
1000 MOV BL, 00H
1003 MOV AX, 2024H
1007 MOV CX, 1010H
100B SUB AX, CX
100D JNC Label1
100F INC BL
1011 NEG AX
1013 Label 1 MOV [1200], AX
1017 MOV [1202], BL
101B HLT

Tabulation:
Input Output
Address Data Address Data






3. Multiplication
Algorithm:
1. Clear DX register
2. Load the AX register pair with multiplicand
3. Load the CX register pair with multiplier
4. Multiply multiplicand and multiplier
5. Store the higher byte of product(from DX register pair) in memory specified
6. Store the lower byte of product(from AX register pair) in memory specified
7. Stop
8.
13 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV DX, 0000H
1004 MOV AX, 00FFH
1008 MOV CX, 0002H
100C MUL CX
100E MOV [1200], AX
1012 MOV [1202], DX
1016 HLT
Tabulation:
Input Output
Address Data Address Data






4. Division:
Algorithm
1. Clear DX register
2. Load the AX register pair with dividend
3. Load the CX register pair with divisor
4. Dividend divided by divisor
5. Store the quotient (from AX register pair) in memory specified
6. Store the remainder (from DX register pair) in memory specified
7. Stop
Program:
Address Label Mnemonics
1000 MOV DX, 0000H
1004 MOV AX, 0008H
1008 MOV CX, 0004H
100C DIV CX
100E MOV [1200], AX
1012 MOV [1202], DX
1016 HLT

14 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


Result:
Thus Assembly language program are written to perform arithmetic operation using 8086 microprocessor.
They are executed using 8086 processor and the outputs are verified.
Outcome:
At the end of this experiment the students able to write ALP programs for Arithmetic and Logical operations.

1. Write the size of the data bus of 8086.
2. Write the size of the address bus of 8086.
3. What is meant by physical addressing in 8086?
4. What is meant by an Opcode?
5. What is meant by an Operand?
6. What is meant by a Mnemonics?
7. What are the other possibilities of writing ADD, SUB and MUL instructions in other addressing modes?
8. What is the difference between microprocessor and microcontroller?
9. What is meant by LATCH?
10. What is the difference between primary & secondary storage device?
11. What is the difference between static and dynamic RAM?
12. What is an interrupt?
13. Differentiate between RAM and ROM?
14. Define ? Compiler
15. Define ? Flag
16. Define ? Stack
17. How clock signal is generated in 8086 microprocessor?
18. State the functions of queue status line QS0 and QS1 in 8086 microprocessor.
19. What is the purpose of BIU& EU?
20. List out the two examples of assembler directives.

Viva ? voce
15 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Applications:
1. barrel shifters
2. Multiple-precision arithmetic
3. Calculation pipeline
4. binary multipliers
5. Calculation in a single clock

16 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.2 DECIMAL ARITHMETIC AND CODE CONVERSION
Aim:
To write an Assembly Language Program to perform Code conversion and Decimal Arithmetic operations
and to execute using 8086 microprocessor
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
Decimal Arithmetic:
1. Using DAA
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Clear the CL reg.
4. Add the contents of AL and BL.
5. Adjust decimal accumulator after addition.
6. Store the result.
17 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 MOV CL, 00
100B ADD AL,BL
100D DAA
100E JNC L1
1010 INC CL
1012 L1 MOV [1150], AL
1016 MOV [1151], CL
101A HLT

Tabulation:
Input Output
Address Data Address Data


2. Using AAM
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Multiply the contents of AL and BL.
4. Adjust decimal accumulator after multiplication.
5. Store the result.
Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 MUL BL
100A AAM
100C MOV [1150], AH
1010 MOV [1151], AL
1014 HLT

18 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


3. Using DAS
Algorithm:
1. Get the first input and store in AL.
2. Get the second input and store in BL.
3. Subtract the contents of BL from AL.
4. Adjust decimal accumulator after subtraction.
5. Store the result.
Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, [1101]
1008 SUB AL,BL
100A DAS
100B MOV [1150], AL
100F HLT
Tabulation:
Input Output
Address Data Address Data


Code Conversion:
1. Binary to BCD
Algorithm:
1. Get the input and store in AL.
2. Clear the carry flag.
3. Rotate right the bits of input.
4. Find logical XOR between input and shifted input.
5. Store the result.
19 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 XOR AX,AX
1002 XOR CX,CX
1004 MOV BX,000B
1008 L2 CMP BX,00
100C JZ L1
100E DEC BX
100F MOV AL,CL
1011 ADD AL,01
1014 DAA
1015 MOV CL,AL
1017 MOV AL,CH
1019 ADC AL,00
101C DAA
101D MOV CH,AL
101F JMP L2
1022 MOV [1150],CX
1026 HLT
Tabulation:
Input Output
Address Data Address Data




2. Binary to Gray
Algorithm:
1. Get the input and store in AL.
2. Clear the carry flag.
3. Rotate right the bits of input.
4. Find logical XOR between input and shifted input.
5. Store the result.

20 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV AL, [1100]
1004 MOV BL, AL
1006 CLC
1007 MOV CL,01
100A RCR AL,CL
100C XOR BL,AL
100E MOV [1150],BL
1012 HLT
Tabulation:
Input Output
Address Data Address Data


Result:
Thus an Assembly Language Program for code conversion and decimal arithmetic operations is written. The
program is executed using 8086 and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts of code conversions and
decimal arithmetic operations.








21 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


1. Write the function of the following 8085 instructions: JP, JPE, JPO, and JNZ.
2. What is the purpose of the following commands in 8086?
a) AAD
b) RCL
3. List out the addressing modes in 8086.
4. List out the various string instructions that are available in 8086.
5. What are the 8086 instructions used for BCD arithmetic?
6. What flags get affected after executing ADD instruction?
7. Which instruction is used to add immediate data?
8. What is BCD code? Where it is used?
9. What is ASCII code? Where it is used?
10. What is the difference between carry flag and overflow flag?
11. What are the special function register associated with interrupts?
12. List the flags affected by arithmetic instructions.
13. After executing ADDC instruction, what flags get affected?
14. How many bytes the instruction ADDC will add?
15. Name the signals used by the processor to communicate with an I/O processor
16. What is the function of IP?
17. What is the use of base pointer register?
18. Mention the index registers of 8086.
19. How many memory locations are available in 8086 microprocessor?
20. What are the flags in 8086? What are the various interrupts in 8086?
Applications:
1. Programmable calculators
2. Counting system using counts the tennis ball
3. Detecting and Correcting an Error with the Hamming Code
4. Power tool
5. Radio clocks
Viva ? voce
22 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.3 MOVE A DATA BLOCK WITHOUT OVERLAP
Aim:
To write an assembly language program to move a block of data to another memory location and execute it
using 8086
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Algorithm:
1. Initialize the source and destination memory location to SI and DI register
2. Initialize the counter (CL register)
3. Move the data to designation memory through AL register
4. Decrement the count
5. Check for zero flag and if zero flag is set go to next step
6. else go to step 3
7. Stop
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
23 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


Program:
Address Label Mnemonics
1000 MOV CL, 08
1003 MOV SI, 1200
1007 MOV DI, 1300
100B L1 LOD SB
100C MOV [DI], AL
100E INC DI
100F DEC CL
1011 JNZ L1
1013 HLT

Tabulation:
Input Output
Address Data Address Data




Result:
Thus an Assembly Language Program for moving data to another location is written the program is
executed using 8086 and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts and write the ALP program for
moving data to another location.



24 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00



1. List out the Flag manipulation instruction.
2. Define ? Variables
3. Define ? Segment Override Prefix
4. How is the memory segment accessed by 8086 microprocessor identified?
5. List out the advantages of using Direct Memory Access (DMA).
6. What is BIOS function call in 8086? (May 2012)
7. List out the difference between procedures and Macros.
8. What is meant by maskable interrupts& non-maskable interrupts?
9. What is the Maximum clock frequency in 8086?
10. Which Stack is used in 8086?
11. Define ? Pipeline (Dec 2011)
12. How many address lines are available in 8086? What is the maximum address possible?
13. What is an assembler?( May 2012)
14. What is the purpose of LEA instruction in 8086? (May 2012)
15. Give the function of index and pointers in 8086.
16. What are the different instruction set of 8086?
17. Give the various addressing modes in 8086.
18. Give the differences between JUMP and LOOP instruction.
19. Give the physical address formation of any two addressing mode.
20. Give the use of ?ASSUME? in 8086 programming.
Applications:
1. Priority Encoder
2. DVD players
3. Cellular telephones
4. Household appliances
5. Car equipment
Viva ? voce
25 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.4 MATRIX OPERATIONS
Aim:
To write an assembly language program to perform matrix addition and to execute it using 8086
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Algorithm:
1. Get the size (count) of the matrix
2. Initialize SI pointer for storing first matrix
3. Initialize DI pointer for storing second matrix
4. Move the contents pointed by SI pointer to accumulator
5. Move the contents pointed by DI pointer BL register
6. Add the contents of accumulator and BL register
7. Store result in the address pointed by DI pointer
8. Increment DI and SI pointer by 1 and Decrement count by 1
9. Check for zero. If no zero jump to step 4 else go to step 11
10. Stop the execution
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result

26 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Program:
Address Label Mnemonics
1000 MOV CL, 09
1003 MOV SI, 1100
1007 MOV DI, 1200
100B L1 MOV AL, [SI]
100D MOV BL, [DI]
100F ADD AL, BL
1011 MOV [DI], AL
1013 INC SI
1014 INC DI
1015 DEC CL
1017 JNZ L1
1019 HLT

Tabulation:
Input Output
Address Data Address Data



Result:
Thus an assembly language program for matrix addition was written. It is executed using 8086
microprocessor and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts of moving and adding the group
of data from one location to another location.







27 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


1. Write an ALP for 8086 to multiply two 16 bit unsigned numbers.
2. What is an accumulator?
3. List out the segment register available in 8086.
4. List out any four program control instructions that are available in 8086.
5. What is program counter?
6. Give any four logical instructions in 8086.
7. How many memory locations are available in 8086 microprocessor?
8. What are the general purposes registers in 8086?
9. What are the functional units in 8086?
10. How much memory location allotted for the particular segments registers in 8086?
11. When the 8086 processor is in minimum mode and maximum mode?
12. Define ? Segment Override Prefix.
13. Define ? Macro and Procedure
14. Define ? Assembler and assembler directives
15. Define ? Compiler and Linker
16. What is meant by modular programming?
17. Explain the uses of PUSH and POP instruction.
18. Explain the uses of CALL and RET instruction.
19. Identify the addressing modes in the following instructions.
AND AL, BL
SUB AL, 24H
MOV AL, (BP)
MOV CX, 1245H
20. What are the 8086 instructions used for BCD arithmetic?

Applications:
1. Toys
2. Light switches and dimmers
3. Electrical circuit breakers
4. Smoke alarms
5. Battery packs


Viva ? voce
28 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.5 SEARCHING AND SORTING A STRING IN A
GIVEN ARRAY
a) Searching a String in a Given Array:
Aim:
To write an assembly language program to search a string in the given array and to execute it using 8086
kit.
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Algorithm:
1. Initialize the source and destination memory in SI and DI register
2. Initialize the count (CL) and Load the string values to any register (DL)
3. Move string to AL register and Compare the register (DL and AL)
4. Check for zero flag and if it is set jump to step 7 else go to step 9
5. Store the value of AL register
6. Increment DI register by one, Increment SI register by one and Decrement CL register by one
7. Check for zero flag and if it is set jump to step 12 else go to step 4
8. Stop the execution
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Type the Assembly Language Program
6. Press ?RESET? key
To executive the program
7. Press ?GO?
8. Type the starting address to execute the program
9. Press ?RESET? key
To verify the result
29 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

10. Type ?SB(Substitute Byte)?
11. Enter the output address location to check the result
Program:
Address Label Mnemonics
1000 MOV DI, 1300
1004 MOV SI, 1200
1008 MOV CL, 06
100B MOV DL, 02
100E L1 MOV AL, [SI]
1010 CMP DL, AL
1012 JNZ L2
1014 MOV [DI], AL
1016 INC DI
1017 L2 INC SI
1018 DEC CL
101A JNZ L1
101C HLT

Tabulation:
Input Output
Address Data Address Data


Result:
Thus an assembly language program to search a string in the string in the given array is written. The
program is executed using 8086 and the output is verified.






30 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

b) Sorting an Array of Data Using 8086:
Aim:
To write an assembly language program to sort an array of data in ascending and descending order and
execute it using 8086 kit
Apparatus required:
1. 8086 Kit
2. Power cable
3. Keyboard
Procedure:
To enter program in Trainer Kit
1. Press ?RESET? key
2. Press ?A(Address)? key
3. Press ?Enter? key
4. Enter the starting address (16 bit)
5. Press ?Enter? key
6. Type the Assembly Language Program
7. Press ?RESET? key
To executive the program
8. Press ?GO?
9. Type the starting address to execute the program
10. Press ?RESET? key
To verify the result
11. Type ?SB(Substitute Byte)?
12. Enter the output address location to check the result
1. Ascending Order:
Algorithm:
1. Set SI as pointer for array
2. Set CL as outer loop counter
3. Initialize array pointer
4. Set CH as inner loop counter
5. Increment array pointer
6. Get the first element of array
7. Increment array pointer and Compare the two elements
31 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

8. Checks carry flag. If carry flag is set go to step 11 else go to step 10
9. Swap the content of the memory location
10. Decrement the inner loop counter
11. Check zero flag. If it is set go to step 13 else go to step 7
12. Decrement outer loop counter
13. Check zero flag. If it is set go to step 15 else go to step 3 and stop
Program:
Address Label Mnemonics
1000 MOV SI, 1100H
1004 MOV CL, [SI]
1006 DEC CL
008 Repeat MOV SI, 1100H
100C MOV CH, [SI]
100E DEC CH
1010 INC SI
1011 Rep MOV AL, [SI]
1013 INC SI
1014 CMP AL, [SI]
1016 JC Ahead
1018 XCHG AL, [SI]
101A XCHG AL, [SI-1]
101D Ahead DEC CH
101F JNZ Rep
1021 DEC CL
1023 JNZ Repeat
1025 HLT
Tabulation:
Input Output
Address Data Address Data



32 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

2. Descending Order:
Algorithm:
1. Set SI as pointer for array
2. Set CL as outer loop counter
3. Initialize array pointer
4. Set CH as inner loop counter
5. Increment array pointer Get the first element of array
6. Increment array pointer
7. Compare the two elements
8. Checks carry flag. If carry flag is set go to step 11 else go to step 10
9. Swap the content of the memory location
10. Decrement the inner loop counter
11. Check zero flag. If it is set go to step 13 else go to step 7
12. Decrement outer loop counter
13. Check zero flag. If it is set go to step 15 else go to step 3
14. Stop
Program:
Address Label Mnemonics
1000 MOV SI, 1100H
1004 MOV CL, [SI]
1006 DEC CL
1008 Repeat MOV SI, 1100H
100C MOV CH, [SI]
100E DEC CH
1010 INC SI
1011 Rep MOV AL, [SI]
1013 INC SI
1014 CMP AL, [SI]
1016 JNC Ahead
1018 XCHG AL, [SI]
101A XCHG AL, [SI-1]
101D Ahead DEC CH
101F JNZ Rep
1021 DEC CL
1023 JNZ Repeat
1025 HLT

33 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Tabulation:
Input Output
Address Data Address Data


Result:
Thus an assembly language program is written to sort an array of data in ascending and descending order.
The program is executed using 8086 and the output is verified.
Outcome:
At the end of this experiment the students able to understand the concepts and write the Assembly
Language Program for Searching and Sorting.

1. What is the relation between 8086 processor frequency & crystal Frequency?
2. What is the position of the stack pointer after the POP instruction?
3. Compare CALL and JMP instructions.
4. Define ? Baud Rate
5. What is the size of instruction queue in 8086?
6. Compare JNC and JMP instructions.
7. What happens when HLT instruction is executed in processor?
8. What is the maximum internal clock frequency of 8086 processor?
9. What are the functions of BIU?
10. Write an ALP program to search a number 05 from a given array.
11. What is cache memory?
12. Can ROM be used as stack?
13. What are the 8086 instructions used for BCD arithmetic?
14. What are the 8086 instructions used for ASCII arithmetic?
15. List the various string instructions available in 8086.
16. How will carry and zero flags reflect the result of instruction CMP BX, CX?
17. Give any four miscellaneous instructions in 16-bit Microprocessor
18. List the flags in 8086 and state its functions.
19. What is the purpose of segment registers in 8086?
20. What is virtual addressing mode?

Viva ? voce
34 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Applications:
1. Car keys
2. Power tool
3. Home security system
4. Dishwashers
5. Washing machines
35 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.6 PASSWORD CHECKING AND PRINT RAM SIZE
WITH SYSTEM DATE
Aim:
To write an assembly language program to Check Password.
Apparatus required:
1. Personal Computer
2. MASM Software
Procedure:
1. Go to Start, Programs, MS-DOS Prompt (or Command Window). Once the DOS window is open, type
the command EDIT. Type your file and save it to your .ASM directory. Be sure it has a .ASM
extension. Do not close the DOS window or the editor.
2. Go to Start, Programs, MS-DOS Prompt (or Command Window). This will open a second DOS
window. Change to your .ASM directory and issue the commands to run MASM.
3. Click compile, link and run it.
a) C: cd \COP3402
b) MASM/L FIRST.ASM
c) LINK FIRST.OBJ
d) FIRST.EXE
4. For errors after issuing the MASM command, fix the .ASM file and redo the above steps.
5. open the file FIRST.LST to clear all errors
6. Click compile, link and run it.
a) MASM/L FIRST.ASM
b) LINK FIRST.OBJ
c) FIRST.EXE
Program:
.MODEL SMALL
.DATA
PASS DB ?ABC?
MES1 DB 10,13,?ENTER 3 CHARACTER PASSWORD $?
MES2 DB 10,13,?PASSWORD IS CORRECT $?
MES3 DB 10,13,?PASSWORD ID WRONG $ ?
.CODE
START: MOV AX,@DATA
MOV DS,AX
MOV AH,09H
LEA DX,MES1
INT 21H
36 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

MOV CL,00
MOV DL,OOH
XOR DI,DI
.WHILE CL!=3
MOV AH,07H
INT 21H
LEA BX,PASS
MOV AH,[BX+DI]
.IF AL==AH
ADD DL,01
.ENDIF
INC DI
INC CL
.ENDW
.IF DL==3
MOV AH,09H
LEA DX,MES2
INT 21H
.ELSE
MOV AH,09H
LEA DX,MES3
INT 21H
.ENDIF
MOV AH,4CH
INT 21H
END START
END
Result:
Thus the given password is checked and the result is verified.
Outcome:
At the end of this experiment the students able to understand the concepts of password checking and print
ram size with system date.








37 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00



1. What is the role of Stack?
2. What is the difference between DOS and BIOS interrupts?
3. What is an interrupt vector Tabulation: of 8086?
4. What .model small stands for?
5. Define ? Interrupt Vector Tabulation
6. What are the contents of AL and CY after the execution of the following segments?
7. What is the purpose of CLK signal in an 8086 system?
8. What is the need for MN/MX pin in 8086 system?
9. What is the purpose of QUEUE in 8086 processor?
10. Give the operation of TEST instructions of 8086?
11. List out few string instructions of 8086.
12. What is the use of LOCK prefix?
13. What is the purpose of REP prefix?
14. What are the types of Multiprocessor configuration?
15. Define ? Co-processor
16. List any four program control instructions available in 8086?
17. How the data and address lines are demultiplexed?
18. Define ? Instruction
19. Define ? Machine Cycle
20. Define ? T-State
Applications:
1. High-end coffee makers
2. Radio clocks
3. Televisions
4. VCRs
5. DVD players
Viva ? voce
38 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.7 COUNTERS AND TIME DELAY

Aim:
To write an assembly language program to display the current system time and date
Apparatus required:
1. Personal Computer
2. MASM Software
Procedure:

1. Go to Start, Programs, MS-DOS Prompt (or Command Window). Once the DOS window is open, type
the command EDIT. Type your file and save it to your .ASM directory. Be sure it has a .ASM
extension. Do not close the DOS window or the editor.
2. Go to Start, Programs, MS-DOS Prompt (or Command Window). This will open a second DOS
window. Change to your .ASM directory and issue the commands to run MASM.
3. Click compile, link and run it.
a) C:
b) cd \ COP3402
c) MASM/L FIRST.ASM
d) LINK FIRST.OBJ
e) FIRST.EXE
4. For errors after issuing the MASM command, fix the .ASM file and redo the above steps.
5. open the file FIRST.LST to clear all errors
6. Click compile, link and run it.
a) MASM/L FIRST.ASM
b) LINK FIRST.OBJ
c) FIRST.EXE
Program:
.MODEL SMALL
.STACK 100H
.DATA
PROMPT DB 'Current System Time is : $'
TIME DB '00:00:00$'
.CODE
MAIN PROC
39 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

MOV AX, @DATA
MOV DS, AX
LEA BX, TIME
CALL GET_TIME
LEA DX, PROMPT
MOV AH, 09H
INT 21H
LEA DX, TIME
MOV AH, 09H
INT 21H
MOV AH, 4CH
INT 21H
MAIN ENDP
GET_TIME PROC
PUSH AX
PUSH CX
MOV AH, 2CH
INT 21H
MOV AL, CH
CALL CONVERT
MOV [BX], AX
MOV AL, CL
CALL CONVERT
MOV [BX+3], AX
MOV AL, DH
CALL CONVERT
MOV [BX+6], AX
POP CX
POP AX
RET
GET_TIME ENDP
Result:
Thus the systems current date is fetched, displayed and the result is verified.

Outcome:
At the end of this experiment the students able to understand the concepts of counters and time delay.





40 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00


1. What are the 8086 instructions used for BCD arithmetic?
2. What is the function of BX register?
3. How Physical address is generated?
4. List out the pointers available in 8086
5. Compare PUSH and PULL instructions
6. What is ALE? When will the data bus AD0-AD7 be enabled?
7. Define ? HOLD in 8086
8. Define ? HLDA in 8086
9. Give the significance of RQ / GTO and IO / M signals.
10. Name any two coprocessors and their use.
11. State the importance of sample and hold circuit.
12. List the applications of programmable interval timer.
13. What is key denouncing? What are the methods to detect the denouncing?
14. Name the two modes of operation of DMA controller?
15. Give the different types of command words in 8259.
16. Give the comments for MOV r, M.
17. How many T-states are in MOV instruction?
18. Explain the addressing mode of MOV r, M.
19. How many machine cycles are in MOV instruction?
20. Give the comments for MOV M, r.
Applications:
1. Microwaves
2. Toasters
3. Ovens
4. Stoves
5. Thermostats
Viva ? voce
41 Format No.: FirstRanker/Stud/LM/34/Issue: 00/Revision: 00

Expt.No.8 INTERFACING STEPPER MOTOR WITH 8086

Aim:
To write an Assembly Language Program to run the stepper motor in forward and reverse direction and
execute it using 8086 microprocessor
Apparatus required:
1. Stepper motor Card
2. Interface Cable
3. Datasheets | App notes
Procedure:
1. Connect the 26 core FRC connector to the 8086 trainer at connector no CN4 and the interface
module.
2. Connect the power mate connector to the interface module and the other side of the connector to the
power supply.
3. 5- Way power mate is wired to the motor. This power mate is to be inserted into the male socket
provided on the interface.
4. After the completion of the program and connections, enter the program as given in the listing below.
G0< STARTING ADDRESS< ENTER (on the key board of trainer).
Algorithm:
1. Get the drive sequence using HL pointer
2. Initialize a counter for appropriate number of steps
3. Get the drive sequence