GYAN GANGA INSTITUTE OF TECHNOLOGY AND
SCIENCES JABALPUR
LABMANUAL
ON
MICROPROCESSORS AND APPLICATION LAB
V SEMESTER
DEPARTMENT OF ELECTRONICS AND COMMUNICATION
ENGINEERING
1
Course Syllabus
Architecture of 8086 Microprocessor
Salient features of advanced microprocessors. RISC & CISC processors. Review and evolution
of advanced microprocessors:8086,8088, 80186/286/386/486/Pentium, introduction to 8086
processor: Register organization of 8086,Architecture,signal description of 8086,minimum mode
8086 systems and timings and maximum mode 8086 systems and timings
Unit II
Assembly Language Programming of 8086
8086 Instruction Set, Addressing modes, Assembly Language Programming with Intel 8086
microprocessor.
Unit III
Peripheral devices and their interfacing
Introduction to the various interfacings chips like 8155, 8255, Interfacings key boards, LEDs ,
ADC, DAC and memory Interfacing.
Unit IV
Interrupts of 8086
General purposes programmable peripheral devices ( 8253), 8254 programmable interval timer,
8259A programmable interrupt controller & 8257 DMA controller, USART, serial I/O & data
Communication.
Unit V
8051 Microcontroller
Introduction to microcontrollers (8051) and embedded systems: 8051 architecture, pin description
, I/O configuration , interrupts, addressing modes, an overview of 8051 instruction set, embedded
system, use of microcontrollers in embedded systems.
TEXT BOOKS:
1. Advanced Microprocessors and Peripherals byAKRay,TataMcGraw-HillEducation,2006
2. The8051Microcontrollers:Architecture,Programming&ApplicationsbyDr.K.UmaRao,
Andhe Pallavi, Pearson, 2009
2
INTRODUCTION OF MICROPROCESSOR
INTRODUCTION:
Microprocessor is regarded as one of the most important devices in our everyday
machines called computers. Microprocessor is an electronic circuit that functions as the
CPU of a computer, providing computational control. Microprocessor is also use in other
advanced electronic systems, such as computer printers, automobiles and jet airlines
The first Microprocessor was the Intel 4004, produced in 1971. Originally
developed for a calculator and revolutionary for its time, it contained2300 transistors on a
4-bit microprocessor that could perform only 60000 operations per second. Thefirst8-bit
microprocessor was the Intel 8008, developed in 1972 to run computer terminals.
INTEL MICROPROCESSOR:
8086(1979):
-bit processor with
an 8-bit external bus.
80286(1982):
With16MB of address able memory and 1GB of a virtual memory, this 16-bit
chip packed serious compute power 12MHz
80386(1985):
The price/performance curve continued its steep climb with the 386 and later the
486- 32 bit processors that brought real computing to the masses. The 386, featured
275,000 transistors, the 486 had more than a million
Pentium (1993):
Adding systems-level characteristics to enormous raw compute power, the Pentium supports
demanding I/O, graphics and communications intensive applications with more than 3 million
transistors.
Pentium II (1997):
The 7.5 million transistors Pentium II processor incorporates Intel MMX-TM
technology, which is designed specially to process video, audio and graphics data
efficiently
Pentium III (1999):
The Pentium III processor features70new instructions. It designed to significantly
enhance Internet experience, allowing users to do such things as browse through realistic
online museums and stores and download high-quality video. The processor incorporates
9.5million transistors, and was introduce dusing0.25microntechnology.
3
Pentium-IV(2000):
The Pentium- CMOS process. Its die size is
217 , power consumption is 50W. The Pentium-4 is available in 1.4GHz & 1.5Hz bins
Buses and operation:
8086hasallinternalregistersareaswellasinternalandexternaldatabuses,were 16 bits
wide, finally estimating t
External address bus gave a1 MB physical address space(220=1,048,576).This address
the address bus in order to fit a standard 40-pin dual in line package. 16 bit I/O address
meant 64KBof separate I/O space (216=65,536). The maximum linear address space was
limited to 64KB.Simply because internal registers were only 16 bits wide, programming
over 64KB, boundaries involved adjusting segment register.
Some of the control pins which carry essential signals for all external operations
mode. The former was intended for small single processor systems while latter was for
medium and large systems, using more than one processor.
4
LIST OF EXPERIMENTS
S.No. NAME OF EXPERIMENT PAGE DATE GRADING SIGN
NO.
1. To write an assembly language program to 6
perform the addition of two 8-bit numbers
using 8086.
2. 7
To Perform Subtraction Operation On 8-Bit
Data
3. 8
To perform an assembly language on16-Bit
number for Multiplication.
4. 9
To Perform division operation on 8-Bit data
5. To Perform an Assembly Language On 10
16-Bitnumber Addition of Two Numbers.
6. 11
To Perform an assembly Language On 16-
Bit Number
(B)Subtraction Of Two Numbers
7. 12
Write A program To Arrange Given
Numbers In Ascending Order.
8. Write A program To Arrange Given 14
Numbers In Descending Order.
.
9. Write An Assembly Language Program To 16
Find the Largest Number From Series Of
Number.
LIST OF EXPERIMENTS WITH ENHANCEMENT BY THE INSTITUTE
10. To interface Programmable Interval timer 18
to 8086 and verify the operation of 8253 in
six different modes
11. Write a program to interface programmable 21
peripheral interface (8255) with 8086 to
interface Eight Light emitting diode.
5
EXPERIMENT-1
AIM:- To write an assembly language program to perform the addition of two 8-bit numbers using
8086
SOFTWARE REQUIRED: - MASM 611
ASSEMBLY LANGUAGE PROGRAM:-
ASSUME CS: CODE, DS: DATA
DATASEGMENT
NO1DB04H
NO2DB06H
DATA ENDS
CODESEGMENT
START:
ORG500H
MOVAX, DATA
MOV DS, AX
MOV AL, NO1
MOV BL, NO2
ADD AL, BL
INT 21H
CODEENDS
ENDSTART
RESULT: Addition Operation Is Performed On 8-Bit Data
EXPERIMENT-2
AIM:-To Perform Subtraction Operation On 8-Bit Data
ASSEMBLYLANGUAGEPROGRAM:-
ASSUME CS: CODE, DS: DATA
DATASEGMAENT
NO1DB08H
NO2DB06H
DATA ENDS
CODESEGMENT
START:
ORG500H
MOVAX,DATA
MOV DS, AX
MOV AL, NO1
MOV BL, NO2
SUB AL, BL
INT21H
CODE ENDS
END START
RESULT: Subtraction Operation Is Performedon8-Bitdata.
EXPERIMENT-3
AIM:-To perform Anassemblylanguageon16-Bit number For Multiplication of Two
Numbers.
SOFTWARE REQUIRED:- 8086 Emulator
ASSEMBLYLANGUAGEPROGRAM:-
ASSUME CS: CODE, DS: DATA
DATASEGMAENT
NO1DW0FH
NO2 DB 06H
DATA ENDS
CODESEGMENT
START:
ORG 500H
MOVAX,DATA
MOV DS, AX
MOV AX, NO1
MOV BX, NO2
MUL BX
INT21H
CODE ENDS
END START
RESULT: Multiplication Operation Is Performed On 16-Bit Data.
EXPERIMENT-4
AIM:-To Perform division operation on 8-Bit data
SOFTWARE REQUIRED:- 8086 Emulator
ASSEMBLYLANGUAGEPROGRAM:-
ASSUME CS: CODE, DS: DATA
DATASEGMAENT
NO1DW0FH
NO2 DB 06H
DATA ENDS
CODESEGMENT
START:
ORG500H
MOVAX,DATA
MOV DS, AX
MOV AX, NO1
MOV BL, NO2
DIV BL
INT21H
CODE ENDS
END START
RESULT: Division Operationisperformedon8-Bit data ..
EXPERIMENT-5
AIM:-To Perform an Assembly Language On 16-BitnumberAddition of Two Numbers
ASSEMBLY LANGUAGE PROGRAM:-
ASSUME CS: CODE, DS: DATA
DATASEGMAENT
NO1DW1003H
NO2DW1002H
DATA ENDS
CODESEGMENT
START:
ORG500H
MOVAX,DATA
MOV DS, AX
MOV AX, NO1
MOV BX, NO2
ADD AX, BX
INT 21H
CODEENDS
ENDSTART
RESULT: Addition Operation Is Performed On16-Bit Data
EXPERIMENT-6
AIM:-To Perform an assembly Language On 16-Bit Number Subtraction of Two Numbers
SOFTWARE REQUIRED: - Emulator 8086
ASSEMBLY LANGUAGE PROGRAM:-
ASSUME CS: CODE, DS: DATA
DATASEGMENT
NO1DW1004H
NO2DW1002H
DATA ENDS
CODESEGMENT
START:
ORG500H
MOVAX, DATA
MOV DS, AX
MOV AX, NO1
MOV BX, NO2
SUB AX, BXINT
21H
CODEENDS
ENDSTART
RESULT: Subtraction Operation Is Performed On16-Bit Data
EXPERIMENT-7
AIM: Write A program To Arrange Given Numbers In Ascending Order.
SOFTWARE REQUIRED: MASM 611
ASSEMBLYLANGUAGEPROGRAM: ASSUME
CS: CODE, DS: DATA
DATASEGMENT
AD DW 5000H
COUNTDB05H
DATA ENDS
CODESEGMENT
START:
ORG600H
MOVAX,DATA
MOV DS, AX
LOOP1: MOV BX, AD
MOVCL,COUNT
MOV DL, 00H
LOOP2: MOV AL, [BX]
CMPAL,[BX+1]
JL LOOP3
XCHGAL,[BX+1]
MOV [BX], AL
MOVDL,01H
LOOP3: INCBX
DECCL
JNZ LOOP2
CMPDL,01H
JE LOOP1
INT21H
CODE ENDS
END START
RESULT: Ascending Operation Is Performed.
EXPERIMENT-8
AIM: Write A Program To Arrange Given Numbers In Descending Order.
SOFTWARE REQUIRED: Emulator 8086
ASSEMBLYLANGUAGEPROGRAM: ASSUME
CS: CODE, DS: DATA
DATASEGMENT
AD DW 5000H
COUNTDB05H
DATA ENDS
CODESEGMENT
START:
ORG600H
MOVAX,DATA
MOV DS, AX
LOOP1: MOV BX, AD
MOVCL,COUNT
MOV DL, 00H
LOOP2: MOV AL, [BX]
CMPAL,[BX+1]
JG LOOP3
XCHGAL,[BX+1]
MOV[BX],AL
MOV DL, 01H
LOOP3: INC BX
DECCL
JNZ LOOP2
CMP DL, 01H
JE LOOP1
INT21H
CODEENDS
ENDSTART
RESULT: Descending Operation Is Performed
EXPERIMENT-9
AIM: Write An Assembly Language Program To Find the Largest Number
From Series Of Number.
SOFTWAREREQUIRED: Emulator 8086
ASSEMBLYLANGUAGEPROGRAM:
ASSUMECS:CODE,DS:DATA
DATA SEGMENT
NO1 DB 06H
AD1DW5000H
DATA ENDS
CODESEGMENT
START:
ORG600H
MOV AX, DATA
MOVDS,AX
MOV BX, AD1
MOVCL,
NO1MOVAL,[BX]
DEC CL
INCBXCMPAL, [BX]
XYZ: JNB NXT
MOVAL,[BX]
INCBX
NXT: DEC CL
JNZ XYZ
INT21H
CODEENDS
ENDSTART
RESULT: Finding Of Largest number Operation Is Performed.
EXPERIMENT-10
AIM: To interface Programmable Interval timer to 8086 and verify the operation of 8253 in six different
modes
APPARATUSREQUIRED:-
8086microprocessorkit.
8253interfacing card.
Rs-232.
Power supply.
26-pin bus.
Connecting wires.
CRO
Theory :
MODE 3-Square Generation In this the output will remain high until one half of the count and goes low for
the order half provided the count is an even number. This mode is used to generate the baud rate of 8251.
OPERATING MODES OF 8253-PIT
Each of the three counters of 8253 can be operated in one of the following six modes of operation.
OPERATING MODES OF 8253-PIT
Each of the three counters of 8253 can be operated in one of the following six modes of operation.
1. Mode 0 (Interrupt on terminal count)
2. Mode 1 (Programmable monoshot)
3. Mode 2 (Rate generator)
4. Mode 3 (Square wave generator)
5. Mode 4 (Software triggered strobe)
6. Mode 5 (Hardware triggered strobe)
Mode 3 (Square wave generator): This mode is similar to mode 2. However, the duration of the high and
low clock pulses of the output will be different from mode 2.
Suppose 𝑛 is the number loaded into the counter, the output will be
high for counts, and low for counts, if n is even.
high for counts, and low for counts, if n is odd.
PROGRAMMING THE 8253-PIT
Each counter of the 8253 is individually programmed by writing a control word into the Control Word
Register. The Control Word Register format of 8253 is shown below.
Control word data for Counter 0 in Square wave mode is CWR= 36 H
ASSEMBLYLANGUAGEPROGRAM:
MOV AL, 36H
OUT 33, AL
MOV AL, 0AH
OUT 30, AL
MOV A, 00H
OUT 30, AL
Square wave Output
Result: We have verified the output of 8253 in square wave generation mode
EXPERIMENT-11
AIM:-Write a program to interface programmable peripheral interface (8255)with 8086 to interface Eight
Light emitting diode.
APPARATUSREQUIRED:-
8086microprocessor kit.
8255interfacingcard.
Rs-232.
Power supply.
26-pinbus.
Connecting wires.
THEORY:-
This interface allow s the user to study the operation of 8255 in 3modes.TheIntel8255isa
general purpose programmable I/O device designed for use with Intel microprocessor
& microcontroller. It has24i/o ports, which may be individually programmed in2groupsi.e.,
group A consisting of port A(8 pins)&port- C upper(4 pins ) & group- B consisting of port B
(8 pins) 7 port C lower (4 pins) & used in 3 modes of operation.
Mode0 is called as simple output input mode.
In this mode (MODE O), each group of i/o pins may be programmed in sets of 4 to be i/p or
o/p. that is, port A, port C (upper), port B & port C (lower) may be configured as i/p ports or
o/p ports.
In mode1,each group is programmed to have 8 lines of i/p o/p of the remaining4
pins of port C (lower), 3 are used for handshaking &interrupt control signals for strobe
o/p operation .
The third mode of operation is a bidirectional bus mode which has 8 lines for a bi-
directional bus7&5control lines, borrowing one from the other group, for handshaking.
This interface is designed in such a way that port- A can be used as both i/p &o/p. port B
can be used in o/p mode & port-c can be used as o/p in mode 0 & as control/status in modes
1& 2 .
OPERATION:
MODE0 (BASICI/OMODE)
This functional configuration provides simple input and output operations for each of three
ports. PORT-A is the complement of PORT-B.
MODE 1STROBEDINPUT
Control signals used in input operation are STB(Strobe input),IBF(Input buffer full F/F)&
INTR (Interrupt request) and are connected to PORT C bits PC4, PC5 & PC3 respectively.
CIRCUITDIAGRAM:
PROCEDURE:-
1. Connect power supply 5v&GND to both microprocessor trainer kit and programmable
peripheral interfacing kit (card).
2. Make the connections in talk window.
3. Connectdatabusbetweenmicroprocessortrainerkitandprogrammableperipheral
interface kit .
4. Dump the programming toprocessorkitusingRS-232cable.
5. Execute the program by typing code segment starting address.
6. Observe the display on interfacing card. .
RESULT:-Thus the interfacing of Programmable Peripheral Interface (8255)with 8086 is done.
.