0% found this document useful (0 votes)
10 views

Microcontrollers Lab

The Microcontrollers Lab manual outlines the vision and mission of Ganga Institute of Technology and Management, emphasizing academic excellence and holistic student development. It details the course structure, including program outcomes, specific outcomes, and educational objectives, alongside a list of experiments and their corresponding course outcomes. The manual also provides an overview of the 8086 microprocessor architecture and its applications in practical scenarios.

Uploaded by

himanshu5200312
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Microcontrollers Lab

The Microcontrollers Lab manual outlines the vision and mission of Ganga Institute of Technology and Management, emphasizing academic excellence and holistic student development. It details the course structure, including program outcomes, specific outcomes, and educational objectives, alongside a list of experiments and their corresponding course outcomes. The manual also provides an overview of the 8086 microprocessor architecture and its applications in practical scenarios.

Uploaded by

himanshu5200312
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 54

LAB MANUAL

COURSE NAME: MICROCONTROLLERS LAB


COURSE CODE: LC-ECE-214 G

DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING

GANGA INSTITUTE OF TECHNOLOGY AND MANAGEMENT,


KABLANA
MICROCONTROLLERS LAB (LC-ECE-214 G)

VISION
GITAM aims to be an outstanding Institute in India through academic excellence in the field of
Technology and Management to fulfill the need of the Industry and serve the society.

MISSION
 To provide healthy environment to our students as well as faculty members.
 To achieve excellence in technical education.
 To promote holistic development of students through interaction with alumni, academia,
Industry and expert lectures.
 To attract nurture and retain the best faculty and technical manpower.
 To contribute to the society by inculcating professional ethics in the students.
 To promote research and development Initiatives.

DEPARTMENT OF ELECTRONICS & COMMUNICATION


ENGINEERING
VISION
The Department of Electronics and Communication Engineering endeavors to develop high quality,
technically competent and socially responsible engineers.

MISSION
 To have adequate mechanisms by improving the understanding and implementation of
theoretical concepts in practical scenario.
 To develop technical manpower by organizing workshops, expert lectures and industrial
visits on regular basis.
 To impart quality teaching-learning experience with state of the art laboratories.
 To prepare the students to meet the global needs of Industry and Society by inculcating
professional ethics.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


GANGA INSTITUTE OF TECHNOLOGY AND MANAGEMENT, KABLANA Page 1
MICROCONTROLLERS LAB (LC-ECE-214 G)

DEPARTMENT OF ELECTRONICS & COMMUNICATION


ENGINEERING
PROGRAM OUTCOMES/PROGRAM SPECIFIC OUTCOMES
Engineering Graduates will be able to:
PO-1 Engineering Knowledge: Apply the knowledge of mathematics, science, engineering
fundamentals, and an engineering specialization to the solution of complex engineering
problems.
PO-2 Problem Analysis: Identify, formulate, review research literature, and analyze
complex engineering problems reaching substantiated conclusions using first principles of
mathematics, natural sciences, and engineering sciences.

PO-3 Design/Development of Solutions: Design solutions for complex engineering


problems and design system components or processes that meet the specified needs with
appropriate consideration for the public health and safety, and the cultural, societal, and
environmental considerations.

PO-4 Conduct Investigations of Complex Problems: Use research-based knowledge and


research methods including design of experiments, analysis and interpretation of data, and
synthesis of the information to provide valid conclusions.

PO-5 Modern Tool Usage: Create, select, and apply appropriate techniques, resources, and
modern engineering and IT tools including prediction and modeling to complex engineering
activities with an understanding of the limitation.

PO-6 The Engineer and Society: Apply reasoning informed by the contextual knowledge
to assess societal, health, safety, legal and cultural issues and the consequent responsibilities
relevant to the professional engineering practice.

PO-7 Environment and Sustainability: Understand the impact of the professional


engineering solutions in societal and environmental contexts, and demonstrate the
knowledge of, and need for sustainable development.

PO-8 Ethics: Apply ethical principles and commit to professional ethics and responsibilities
and norms of the engineering practice.

PO-9 Individual and Teamwork: Function effectively as an individual, and as a member


or leader in diverse teams, and in multidisciplinary settings.

PO-10 Communication: Communicate effectively on complex engineering activities with


the engineering community and with society at large, such as, being able to comprehend and
write effective reports and design documentation, make effective presentations, and give and
receive clear instructions.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


GANGA INSTITUTE OF TECHNOLOGY AND MANAGEMENT, KABLANA Page 2
MICROCONTROLLERS LAB (LC-ECE-214 G)

PO-11 Project Management and Finance: Demonstrate knowledge and understanding of


the engineering and management principles and apply the set to one’s own work, as a
member and leader in a team, to manage projects and in multi-disciplinary environments.

PO-12 Life-long Learning: Recognize the need for, and have the preparation and ability to
engage in independent and life-long learning in the broadest context of technological
change.
PROGRAM SPECIFIC OUTCOMES

PSO1: Analyze, design and implement hardware and software skills to solve problems in
electronics and communication engineering in various areas such as analog & digital
electronics, signal processing, communication, VLSI, embedded systems and its allied
branches by applying basic sciences and engineering fundamentals.

PSO2: Adapt rapid changes in the field of electronics and communication engineering and
also employs their skills for the multidisciplinary work environment, to be a successful
professional/entrepreneur and worthy citizen

PROGRAM EDUCATIONAL OBJECTIVES


PEO1: Devise and deliver efficient solutions to challenging problems in the field of
Electronics & Communications Engineering and allied disciplines using engineering
fundamentals.
PEO2: Employ and cement their existence in reputed industrial organizations/ companies
by training them with soft skills, domain knowledge and managerial skills.
PEO3: Assess and motivate young engineers to become good human being and responsible
engineer for the welfare of society.
PEO4: Develop their attitude to adapt new ideas, innovations and technologies through
lifelong learning practices.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


GANGA INSTITUTE OF TECHNOLOGY AND MANAGEMENT, KABLANA Page 3
MICROCONTROLLERS LAB (LC-ECE-214 G)

COURSE NAME: MICROCONTROLLERS LAB


COURSE CODE: LC-ECE-214 G
LIST OF EXPERIMENTS

Sr.
Description COs Page No.
No.
1 To study the architecture of 8086 microprocessor and 8086 CO1 7
microprocessor kit.

2 Write a program to add the contents of the memory location to CO3 12


the content of other memory location and store the result in 3rd
memory location.

3 Write a program to add 16 bit number using 8086 instruction CO3 14


set.

4 Write a multiplication of two 16 bit numbers using 8086 CO3 16


instruction set.

5 Write a program for division of two 16 bit numbers using 8086 CO3 18
instruction set.

6 Write a program factorial of a number. CO3 20

a.)Write a Program to transfer a block of data without overlap CO4 22


in forward direction.
7 b.) Write a program to transfer a block of data without overlap
in reverse direction on microprocessor 8086 kit.

8 Write a program to find the average of two numbers. CO2 27

9 Write a program to find maximum number in the array of 10 CO3 29


numbers.

10 Write a program to find the sum of the first ‘n’ integers. CO2 32

11 Write a program to generate a square wave. CO2 34

Experiments beyond the syllabus

12 Write a program of Programmable Keypad and LCD Interface – CO4 36


8279.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


GANGA INSTITUTE OF TECHNOLOGY AND MANAGEMENT, KABLANA Page 4
MICROCONTROLLERS LAB (LC-ECE-214 G)

13 Write a program to show Interfacing with 8253/8254 CO4 43

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


GANGA INSTITUTE OF TECHNOLOGY AND MANAGEMENT, KABLANA Page 5
MICROCONTROLLERS LAB (LC-ECE-214 G)

COURSE OUTCOMES

RBT
COs Microcontrollers Lab (LC-ECE-214 G)
Level
Define fundamental architectural and programming concepts of 8086. L1
LC-ECE-214 G.1
Understand the instruction set and process used for 8086 L2
LC-ECE-214 G.2 programming.

Apply the interfacing and implementation of various peripheral chips L3


LC-ECE-214 G.3 using 8086 microprocessor.

Analyze and compare the logic used in programs output carried out by L4
LC-ECE-214 G.4 8086 microprocessor theoretically and practically.

Articulation Matrix CO-PO MAPPING

CO/PO PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PO12 PSO1 PSO2

CO1 1 3

CO2 1 3 3 3 2 2 2 1

CO3 3 1 3 3 3 3 2 2 2 2 3

CO4 3 3 3 3

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


GANGA INSTITUTE OF TECHNOLOGY AND MANAGEMENT, KABLANA Page 6
MICROCONTROLLERS LAB (LC-ECE-214 G)

EXPERIMENT NO.1
AIM: - To study the architecture of 8086 microprocessor and 8086 microprocessor kit.

APPARATUS REQUIRED: 8086 microprocessor kit & power supply.

THEORY:- M86-02 is a single board 8086 microprocessor training/development kit configured


around the Intel’s 16 bit Microprocessor 8086. This kit can be used to train engineers, to control
any industrial process and to develop software for 8086 systems. The kit has been designed to
operate in the Maximum Mode.
Co-processor 8087 and I/O Processor 8089 can be added on board. 8086 CPU can also be replaced
by 8088 CPU. The Kit communicates with the outside world through an IBM PC compatible
Keyboard with 20x2 LCD Display. The kit also has the capacity of interacting with PC.
M86-02 is packed up with powerful monitor in 16K Bytes of factory programmed EPROMS and
16K Bytes of Read/Write RAM Memory. The total memory on the board can be easily expanded to
256K Bytes each.
The system has 72 programmable I/O lines. The serial I/O Communication is made possible
through 8251. For control applications, three 16 bit Timer/Counters are available through 8253.
For real time applications, the 8 level of interrupt are provided through 8259.
M86-02 provides onboard battery backup for onboard RAM. This saves the user’s program in case
of power failure. The onboard resident system monitor software is very powerful. It provides
various software commands like BLOCK MOVE, SINGLE STEP, EXECUTE, FILL etc. which are
helpful in debugging/developing software. An onboard line assembler provides user to write
program in assembling language. This Kit also has Optional Printer Port to take out the Prints of
Program written in the RAM. On-board Real Time Clock (RTC) is provided optional for any real
time application.

CENTRAL PROCESSOR: SYSTEM SPECIFICATIONS


8086, 16 bit Microprocessor operating in Maximum Mode or 8088 8 bit Microprocessor
8087 Numeric Data Processor or Co-Processor, I/O, EPROM, RAM, Parallel, Serial, Interrupt,
Timer/Counter, 8089 I/O Processor.

16K Bytes of EPROM Loaded with monitor expandable to 64K Bytes using 27C512.
16K bytes of CMOS RAM expandable to 64K Bytes using 6264/62256.
Battery Backup using 3.6V Ni-Cd Battery.
72 Parallel I/O lines using three numbers of 8255 PPI .Serial Comm. RS-232-C Interface using
8251 PCI.
8 different level Interrupt using 8259 PIC. Three16 bit Timer/Counter using 8253 PIT.

PRINTER INTERFACE: KEYBOARD & DISPLAY:


Centro nix Printer Port (Optional), 105Keys IBMPC Keyboard&20x2 LCD Display.
RTC- Real Time Clock (Optional)
BUS-All Address, Data &Control signals (TTL Compatible) available at 50 Pin&20 Pin FRC
Connector.
Power Supply-5V/ 2 Amps, ±12V/250mA
Physical Size- 26.5cm x 18cm.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


GANGA INSTITUTE OF TECHNOLOGY AND MANAGEMENT, KABLANA Page 7
MICROCONTROLLERS LAB (LC-ECE-214 G)

Operating Temp. : 0 to 50°C.

Keyboard Mode: System Capabilities:


1. Examine/Modify the memory byte locations.
2. Examine/Modify the contents of any of internal register of 8086.
3. Move a block of Data/Program from one location to another location.
4. Fill a particular memory area with a constant.
5. To execute the program in full clock speed.
6. To execute program in single instruction execution.

System Installation: To install M86-02 the following additional things are required.
1. Connect the AC Power Supply through AC Power Chord provided to the M86-02 Kit.
2. Switch on the Power Supply at the rear end.
3. A message - [M86-02 L] will come on display (PRESS RESET if you do not get-[M86-02 L]).
4. Now M86-02 Kit is ready for the user's experiments for Keyboard Mode commands.

Hardware Description and CPU: 8086 is a 16 bit, third generation microprocessor and is suitable
for an exceptionally wide spectrum of microcomputer applications. This flexibility is one of most
outstanding characteristics. 8086 has got 16 data lines and 20 address lines. The lower 16 address
lines are multiplexed with 16 data lines. Hence it becomes necessary to latch the address lines. This
is done by using 74LS373.
In fact several of the 40 CPU pins have dual functions that are selected by a strapping pin. In this
kit 8086 is used in the Maximum Mode (MN/MX input held logically low).
The 8088 is designed with an 8-bit external path to memory and I/O.
Except that the 8086 can transfer 16 bits at a time, the two processors &Software are identical in
almost every respect. Software written for one CPU will execute on the other without alteration.
The two processors are designed to operate with the 8089 I/O processors and other processors in
multiprocessing and distributed processing systems.
The INTR, TEST & Hold Inputs to 8086 are pulled down and are brought out at PCB FRC
connector.
The maskable interrupt INTR is available to the peripheral circuits through the expansion Bus. To
use the maskable interrupt an interrupt vector pointer must be provided on the data bus when INTA
is active.
An interrupt Controller Circuit is provided to take care of more than one source of interrupt.

Co-Processor 8087: The 8087 Co-processor “hooks” have been designed into the 8086 and 8088
so that these types of processor can be accommodated in the future. A co-processor differs from an
independent processor in that it obtains its instructions from another processor, called a host. The
co-processor monitors instructions fetched by the host and recognizes certain of these as its own
and executes them. A co-processor, in effect, extends the instruction set of its host computer.

I/O Processor 8089: The 8086 and 8088 are designed to be used with the 8089 in high
performance I/O applications. The 8089 in conceptually resembles a microprocessor with two
DMA channels and an instruction set specifically tailored for I/O operations. Unlike simple DMA
controllers, the 8089 can service I/O devices directly, removing this task from the CPU. In addition,
it can transfer data on its own bus or on the system bus, can match 8-bit or 16-bit peripherals to 8-

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


GANGA INSTITUTE OF TECHNOLOGY AND MANAGEMENT, KABLANA Page 8
MICROCONTROLLERS LAB (LC-ECE-214 G)

bit or 16-bit buses, and can transfer data from memory to memory and from I/O devices to I/O
device. 8089 has been used here in local mode. The system bus, can match 8-bit or 16-bit
peripherals to 8-bit or 16-bit buses, and can transfer data from memory to memory and from I/O
devices to I/O device. 8089 has been used here in local mode.

Clock Generation8284: The clock generator circuit is an Intel’s 8284 clock generator/driver. The
circuit accepts a crystal input which operates at a fundamental frequency of 14.7456 MHz (14.7456
MHz was selected since this frequency is a multiple of the baud rate clock and also provides a
suitable frequency for the CPU). The clock generator/driver divides the crystal frequency by three
to produce the 4.9 MHz CLK signal required by the CPU. Additionally, the clock generator
performs a further divide-by-two output called PCLK (peripheral clock) which is the primary clock
signal used by the remainder of the circuits. The clock generator/driver provides two control signal
outputs which are synchronized (internally) to the 4.9 MHz CLK signal; RDY (ready) and RST
(reset). RST is used to reset the M86-02 to an initialized state that occurs when the RES input goes
low (when power first is applied or when the SYSTEM RESET key is pressed). The RDY output is
active (logically high) when the RDY 1 input from the wait state generator is active. As will be
explained in the next section, the RDY 1 input is active whenever onboard memory is addressed or
when a selected number of “wait states” occurs. The system can operate at either 4.9 MHz or 2.45
MHz this is selected by a set of jumpers JP3 on the right hand side of the 8284 clock generator as
shown below:
4.9 MHz (UPPER), CLK, 2.45 MHz (LOWER). The M86-02 is supplied in 4.9 MHz configuration.
Bus Controller8288: The 8288 is a Bus Controller which decodes status signals output by an 8089,
or a maximum mode 8086 or 8088. When these signals indicate that the processor is to run a bus
cycle, the 8288 issues a bus command that identifies the bus cycle as memory read, memory write,
I/O read, I/O write, etc. It also provides a signal that strobes the address into latches. The 8288
provides the drive level needed for the bus control lines in medium to large systems.

Memory: M86-02 provides 16K Bytes of EPROM loaded with monitor and 16K bytes of CMOS
RAM. The total onboard memory can be configured as follows: EPROM&RAM
64K Bytes of EPROM using 27128, 128K Bytes of EPROM using 27256, 256K Bytes of EPROM
using 27512. 128K Bytes of RAM using 62256. The system provides two 28 Pin sockets for the
EPROM area named as EVEN-ROM & ODD-ROM and two 28 Pin sockets for the RAM area
named as EVEN-RAM & ODD-RAM. EVEN-ROM & ODD-ROM can be defined to have either
of the EPROM 27128/27256/27512 and the EVEN-RAM & ODD-RAM can be defined to have
either of 6264/62256. This selection is done by changing the jumper connections on the board of
the kit. With the 20 bit address of 8086, a total of 1 Mega Bytes (1MB) of memory can be
addressed with the address slot as 00000 to FFFFF. Although the total onboard memory capacity is
384K Bytes but actual memory area will depend upon the memory chips selected and accordingly
the addresses of the various memory sockets will change.

Programmable Peripheral Interface (PPI) 8255: 8255 is a programmable peripheral interface


(PPI) designed to use with 8086 Microprocessor. This basically acts as a general purpose I/O
component to interface peripheral equipments to the system bus. It is not necessary to have an
external logic interface with peripheral devices since the functional configuration of 8255 is
programmed by the system software. It has got three inputs /output ports of 8 lines each (PORT-A,
PORT-B and PORT-C). Port-C can be divided into two ports of 4 lines each named as Port-C upper

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


GANGA INSTITUTE OF TECHNOLOGY AND MANAGEMENT, KABLANA Page 9
MICROCONTROLLERS LAB (LC-ECE-214 G)

and Port-C lower. Any Input/output combination of Port-A, Port-B, Port-C upper and Port-C lower
can be defined using the appropriate software commands. The Port addresses for these ports are
given here. M86-02 provides nine Input/output ports of 8 lines each using three 8255 chips. These
ports are brought out at connectors.

Programmable Interval Timer/Counter (PIT) 8253: This chip is a programmable interval


timer/counter (PIT) and can be used for the generation of accurate time delays under software
control. Various other functions that can be implemented with this chip are programmable rate
generator. Event Counter, Binary rate multiplier, real time clock etc. This chip has got three
independent 16 bit counters each having a count rate of up to 2 MHz The CLK, GATE & OUT
signals of these timers are brought out at the connector.

Programmable Communication Interface (PCI) 8251: This chip is a programmable


communication interface (PCI) and is used as a peripheral device. This device accepts data
characters from the CPU in parallel form and then converts them into a continuous serial data
stream for transmission. Simultaneously it can receive serial data stream and converts them into
parallel data characters for the CPU. This chip will signal the CPU whenever it can accept a new
character for transmission or whenever it has received a character for the CPU. The CPU can read
the complete status of it at any time. 8251 has been utilized in M86-01 for RS-232-Cserial interface.

Programmable Interrupt Controller (PIC) 8259: The 8259 is a device specifically designed for
use in real time, interrupt driven microcomputer systems. It manages eight levels of requests and
has built in features for expandability to other 8259’s. It is programmed by system’s software as an
I/O peripheral. A selection of priority modes in which the requests are processed by 8259 can be
configured to match his system requirements. The priority modes can be changed or reconfigured
dynamically at any time during the main program.

Battery Backup: The M86-02 provides a battery backup for the onboard RAM area using 3.6V Ni-
Cd Rechargeable battery. M86-02 has facility for connecting +5V to the RAM area if the Ni-Cd
battery fails. The selection for +5V or Battery supply Jumper (JP1).

Display: This display contains 2 lines and each line consists of 20 words (20x2). This is a cursor
LCD display modular. The CPU receives each 8 bits letter which is locked into the internal display
data of RAM (data display of RAM 80 bytes (D.D.RAM) allows 80 characters to be stored), and
transfer to 5x7 dot of array word and appear on the displayed. This LCD modular contains the word
generator ROM that will supply 160 different 5x7 dot of array word and also a 64 bytes word
generator RAM. Users can define 8 types 5x7 dot of array word. The position of word display goes
into the LCD Modular through the data bus in CPU. Next through the instruction register and
finally write the words into the data register to display on a specific location. The LCD Modular
will automatically increase or decrease the words in order to move to different addresses. The user
can therefore continue sending in word code. The cursor as to moved around or moved in the right
of left direction.

Draw Diagrams: 8086 Kit, Architecture & Pin Diagrams of 8086 microprocessor
Steps to Insert and execute any program in M86-02 (8086) Microprocessor Trainer Kit
1 Power on M86-02 8086 Microprocessor Trainer Kit.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


GANGA INSTITUTE OF TECHNOLOGY AND MANAGEMENT, KABLANA Page 10
MICROCONTROLLERS LAB (LC-ECE-214 G)

2 A message will display on the LCD Display [M86-02].


3 Now first press RESET button on M86-02 Trainer Kit, then press ENTER Key from Keyboard.
4 The menu will display on LCD display – [A.D.F.G.I.M.P.T.U.]
A=Assemble, D=Data/Display or Modify RAM, F=Fill Data into RAM, G=Go/Proceed to Address
for execution, I=Interrupt, M=Moving Data, P=Print, T=Trace Program, U=Unassembled,
R=Modify Reg.
5 This kit is working on Two Modes – ASSEMBLER MODE and DESSEMBLER MODE.
6 For ASSEMBLER MODE press A from Keyboard, then ENTER from Keyboard, LCD will show
starting address of the program, by default RAM starting address start from 0400H memory
location.
7For Program:- Now at 0400H write 1st instruction and then ENTER, then 2 nd instruction memory
location will appears on LCD Display automatically, then write 2 nd instruction and then ENTER,
then 3rd instruction memory location will appears on LCD Display automatically, similarly for all
other instructions of program till last instruction and then ENTER.
8 Now again press RESET button on M86-02 Trainer Kit, then press ENTER Key from Keyboard.
9For Data: - Now press D from Keyboard, then ENTER 1st Data Address from Keyboard, LCD will
show starting address of the Data, now enter 1st Data by press ENTER key, similarly up to last
Data.
10 Now again press RESET button on M86-02 Trainer Kit, then press ENTER Key from Keyboard.
11 For Program Execution:-Now press G from Keyboard, then ENTER starting address of the
program from Keyboard which is 0400H memory location.
12 Now again press RESET button on M86-02 Trainer Kit, then press ENTER Key from Keyboard.
13 For Result Examination:- Now press D from Keyboard, then ENTER 1st Result Memory
Address from Keyboard, LCD will show starting address of the Result Memory address, now check
1st Result Memory Address by press ENTER key and similarly for remaining Result Memory
Address.

RESULT: We have successfully studied the 8086 microprocessor and 8086 microprocessor kit.

PRECAUTIONS: 1. Properly connect the microprocessor kit with power supply terminals.

2. Switch on the power supply after checking connections

3. Make sure that all the machine codes should be as per specified in

program.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


GANGA INSTITUTE OF TECHNOLOGY AND MANAGEMENT, KABLANA Page 11
MICROCONTROLLERS LAB (LC-ECE-214 G)

EXPERIMENT NO.2
AIM: Write a program to add the contents of the memory location to the content of other memory
location and store the result in 3rd memory location.

APPARATUS REQUIRED: 8086 microprocessor kit & power supply.

THEORY: Take any two numbers from the memory locations from the same data segment starting
from address 0000H. One number should be in the AX (accumulator)from 1 st ML and other number
from 2ndM.L. Now add the two numbers by using ADD command directly, the result would be
stored in the AX. Now result of SUM of two numbers in AX will be copied at 3 rdML/MA
0700H=07H, 0701H=00H

DATA: First Memory Location at (0500H) = 0005H (First Number)(at ML/MA 0500H=05H,
0501H=00H)
Second Memory Location at (0600H) = 0002H (Second Number) (at ML/MA 0600H=02H,
0601H=00H)

ALP to ADD the contents of the 1st M.L. to the content of 2nd M.L. and store the result in 3rd
M.L. Numbers on 8086 kit, and all three M.L.’s are in same Data Segment.
MEMOR MACHIN LABE MNEM OPERAND COMMENTS
Y E CODE L ONICS
ADDRES
S
0400 B8,00,00 MOV AX,0000H Initialize AX with value 0000H
0403 8E,D8 MOV DS,AX Initialize DS with value 0000H
0405 A1,05,00 MOV AX,[0500H Copy First Number (0005H) in AX
] register from First Memory Location at
(0500H)
0408 03,30,00,0 ADD AX,[0600H Add Second No.(0002H) from Second
6 ] ML at (0600H) & Store Result of SUM
in AX
040C A3,00,07 MOV [0700H Copy contents of AX at memory
],AX location 0700H in same Data Segment
040F 76 HLT Halt / Stop the program.

PROCEDURE:
1) Switch on the 8086 microprocessor kit.
2) Press ‘RESET’.
3) After reset, press ‘REL EXEM’.
4) Then press ‘MEMC NEXT’.(We can go from address to data)
5) Put the data.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


GANGA INSTITUTE OF TECHNOLOGY AND MANAGEMENT, KABLANA Page 12
MICROCONTROLLERS LAB (LC-ECE-214 G)

6) Press ‘FILL’ button.


7) Then ‘GO’.
8) Enter the starting address.
9) Press ‘FILL’.
10) After that ‘E’ is printed on keypad.
11) Then press ‘RESET’ and then ‘REL EXMEM’.
12) After that write last address where your data is stored.
13) Then press ‘MEMC NEXT’ then your result is showing.

RESULT: SUM of Two Numbers at Third Memory Location at (0700H) = 0007H (Sum)
(at ML/MA 0700H=07H,0701H=00H)
PRECAUTIONS: 1. Properly connect the microprocessor kit with power supply terminals.

2. Switch on the power supply after checking connections.

3. Make sure that all the machine codes should be as per specified in the

program.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


GANGA INSTITUTE OF TECHNOLOGY AND MANAGEMENT, KABLANA Page 13
MICROCONTROLLERS LAB (LC-ECE-214 G)

EXPERIMENT NO.3
AIM: Write a program to add 16 bit number using 8086 instruction set.

APPARATUS REQUIRED: - 8086 microprocessor kit & power supply.:

THEORY: Take any two numbers from the memory location or by the immediate addressing in to
the two registers. One number should be in the AX (Accumulator) and other number is any of the
registers like BX or other. Now add the two numbers by using ADD command directly, the result
would be stored in the AX.

DATA: First Number= 0005H (in AX register)


Second Number= 0002H (in BX register)

ALP to ADD two 16 bit Hexadecimal Numbers on microprocessor 8086 kit


MEMO MACHI LAB MNE OPERA COMMENTS
RY NE EL MONI ND
ADDRE CODE CS
SS
0400 B8,05,00 MOV AX,0005 Copy first Number in AX register
H
0403 BB,02,00 MOV BX,0002 Copy second Number in BX register
H
0406 01,D8 ADD AX,BX Add the two Numbers& store result in
AX register
0408 CC INT 3 Interrupt of program, break point
instruction used for debugging.

PROCEDURE:
1) Switch on the 8086 microprocessor kit.
2) Press ‘RESET’.
3) After reset, press ‘REL EXEM’.
4) Then press ‘MEMC NEXT’.(We can go from address to data)
5) Put the data.
6) Press ‘FILL’ button.
7) Then ‘GO’.
8) Enter the starting address.
9) Press ‘FILL’.
10) After that ‘E’ is printed on keypad.
11) Then press ‘RESET’ and then ‘REL EXMEM’.
12) After that write last address where your data is stored.
13) Then press ‘MEMC NEXT’ then your result is showing.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


GANGA INSTITUTE OF TECHNOLOGY AND MANAGEMENT, KABLANA Page 14
MICROCONTROLLERS LAB (LC-ECE-214 G)

RESULT: SUM of Two Numbers = 0007H (in AX register or Accumulator).

PRECAUTIONS: 1. Properly connect the microprocessor kit with power supply terminals.

2. Switch on the power supply after checking connections

3. Make sure that all the machine codes should be as per specified in

program.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


GANGA INSTITUTE OF TECHNOLOGY AND MANAGEMENT, KABLANA Page 15
MICROCONTROLLERS LAB (LC-ECE-214 G)

EXPERIMENT NO.4
AIM: Write a multiplication of two 16 bit numbers using 8086 instruction set.

APPARATUS REQUIRED: - 8086 microprocessor kit & power supply.

THEORY: Take any two numbers from the memory location or by the immediate addressing in to
the two registers. One number should be in the AX (Accumulator) and other number is any of the
registers like CX or other. Multiply the two no’s by using MUL command directly, the result will
be stored in the AX & DX.

DATA: First Number= 9273H (in AX register) (Multiplicand)

Second Number= 4835H (in CX register) (Multiplier)

ALP for MULTIPLICATION two 16 bit Hexadecimal Numbers on microprocessor 8086 kit
MEMORY MACHINE LABEL MNEMO OPERAND COMMENTS
ADDRESS CODE NICS
0400 B8,73,92 MOV AX,9273 H Copy first Number in AX register
0403 B9,35,48 MOV CX,4835 H Copy second Number in CX register
0406 F7,E1 MUL CX Multiply the two 16 bits Numbers & store
result in AX and DX registers
0408 CC INT 3 Interrupt of program, break point instruction
used for debugging.

PROCEDURE:
1) Switch on the 8086 microprocessor kit.
2) Press ‘RESET’.
3) After reset, press ‘REL EXEM’.
4) Then press ‘MEMC NEXT’.(We can go from address to data)
5) Put the data.
6) Press ‘FILL’ button.
7) Then ‘GO’.
8) Enter the starting address.
9) Press ‘FILL’.
10) After that ‘E’ is printed on keypad.
11) Then press ‘RESET’ and then ‘REL EXMEM’.
12) After that write last address where your data is stored.
13) Then press ‘MEMC NEXT’ then your result is showing.

RESULT: Lower order product of MULTIPLICATION of Two Numbers = A9CFH (in AX


Register)
Higher order product of MULTIPLICATION of Two Numbers = 294EH (in DX register)

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


GANGA INSTITUTE OF TECHNOLOGY AND MANAGEMENT, KABLANA Page 16
MICROCONTROLLERS LAB (LC-ECE-214 G)

PRECAUTIONS: 1. Properly connect the microprocessor kit with power supply terminals.

2. Switch on the power supply after checking connections

3. Make sure that all the machine codes should be as per specified in the

Program.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


GANGA INSTITUTE OF TECHNOLOGY AND MANAGEMENT, KABLANA Page 17
MICROCONTROLLERS LAB (LC-ECE-214 G)

EXPERIMENT NO: 5
AIM: Write a program for division of two 16 bit numbers using 8086 instruction set.

APPARATUS REQUIRED: - 8086 microprocessor kit & power supply.

THEORY: Take any two numbers from the memory location or by the immediate addressing in to
the two registers. One number should be in the AX (Accumulator) and other number is any of the
registers like CX or other. Divide the two No’s by using DIV command directly, the result would
be stored in the AX & DX.

DATA: First Number Lower order 16 bit = A9DFH (in AX register) (Dividend)

First Number Higher order 16 bit = 294EH (in DX register) (Dividend)


Second Number16 bit = 4835H (in CX register) (Divisor)

ALP for DIVISION of 32 bit number by 16 bit number on microprocessor 8086 kit
MEMORY MACHINE LABEL MNEMO OPERAND COMMENTS
ADDRESS CODE NICS
0400 B8,DF,A9 MOV AX,A9DFH Copy Lower order 16 bit first Number in AX
0403 BA,4E,29 MOV DX,294E H Copy Higher order 16 bit first Number in DX
0406 B9,35,48 MOV CX,4835 H Copy second Number in CX register
0409 F7,F1 DIV CX Divide the two Numbers & store result in AX
040B CC INT 3 Interrupt of program, break point instruction
used for debugging.

PROCEDURE:
1) Switch on the 8086 microprocessor kit.
2) Press ‘RESET’.
3) After reset, press ‘REL EXEM’.
4) Then press ‘MEMC NEXT’.(We can go from address to data)
5) Put the data.
6) Press ‘FILL’ button.
7) Then ‘GO’.
8) Enter the starting address.
9) Press ‘FILL’.
10) After that ‘E’ is printed on keypad.
11) Then press ‘RESET’ and then ‘REL EXMEM’.
12) After that write last address where your data is stored.
13) Then press ‘MEMC NEXT’ then your result is showing.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


GANGA INSTITUTE OF TECHNOLOGY AND MANAGEMENT, KABLANA Page 18
MICROCONTROLLERS LAB (LC-ECE-214 G)

RESULT: Lower order result of DIVISION of Two Numbers = 9273H (in AX register) (Quotient)

Higher order result of DIVISION of Two Numbers = 0010H (in DX register) (Remainder)

PRECAUTIONS: 1. Properly connect the microprocessor kit with power supply terminals.

2. Switch on the power supply after checking connections

3. Make sure that all the machine codes should be as per specified in

Program.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


GANGA INSTITUTE OF TECHNOLOGY AND MANAGEMENT, KABLANA Page 19
MICROCONTROLLERS LAB (LC-ECE-214 G)

EXPERIMENT NO: 6
AIM: Write a program factorial of a number.

APPARATUS REQUIRED: - 8086 microprocessor kit & power supply.

THEORY: The number for which we have to find out its factorial should be kept or copied in AL
register. Also this number should be kept or copied in CL register for count used for multiplication
purpose. After continuous comparisons and multiplications we get desired factorial in AX register.
Then get desired factorial in AX register will be copied at desired memory location. Here algorithm
will be, Input No. to AL, CL=AL, If No.=1 then Factorial=1 then exit, b=2, a=1, b=a*b, b=b+1, If
b<=CL then go to b=a*b, If b>CL then Factorial=AX

DATA: Required 8 bit Number = 04H (in AL Register or Accumulator)


ALP to find FACTORIAL of a given 8 bit Hexadecimal Number on microprocessor 8086 kit
Memory Machine Label Mnemonics Operand Comments
Address Code
0400 B8,00,00 MOV AX,0000H Initialize AX with value 0000H
0403 8E,D8 MOV DS,AX Initialize DS with value 0000H

0405 B0,04 MOV AL,04H Copy number (04H) in AL register

0407 88,C1 MOV CL,AL Copy number (04H) in AL to CL register

0409 B4,00 MOV AH,00H Clear upper 8 bits of AX or acc. (AH=00H)

040B 3C,01 CMP AL,01H Compare No. in AL with 01H, Factorial=1

040D 74,07 JE/JZ GO If 01H< No. in AL, then use next Instruction

040F B3,02 MOV BL,02H Copy number (02H) in BL register

0411 B0,01 MOV AL,01H Copy number (01H) in AL register

0413 F6,E3 BACK MUL BL Multiply BL & AL, store result in AL

0415 FE,C3 INC BL Increment contents of BL by one

0417 3A,D9 CMP BL,CL Compare BL & CL

0419 76,03 JNA/JBE BACK If BL<= CL, then jump to label BACK

041B A3,00,05 GO MOV [0500H If BL>CL, then store AX at ML 0500H

041E CC INT 3 Interrupt of program

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


GANGA INSTITUTE OF TECHNOLOGY AND MANAGEMENT, KABLANA Page 20
MICROCONTROLLERS LAB (LC-ECE-214 G)

PROCEDURE:
1) Switch on the 8086 microprocessor kit.
2) Press ‘RESET’.
3) After reset, press ‘REL EXEM’.
4) Then press ‘MEMC NEXT’.(We can go from address to data)
5) Put the data.
6) Press ‘FILL’ button.
7) Then ‘GO’.
8) Enter the starting address.
9) Press ‘FILL’.
10) After that ‘E’ is printed on keypad.
11) Then press ‘RESET’ and then ‘REL EXMEM’.
12) After that write last address where your data is stored.
13) Then press ‘MEMC NEXT’ then your result is showing.

RESULT: FACTORIAL of Number = 18H (in AX Register and also at ML 0500H)

PRECAUTIONS: 1. Properly connect the microprocessor kit with power supply terminals.

2. Switch on the power supply after checking connections

3. Make sure that all the machine codes should be as per specified in program.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


GANGA INSTITUTE OF TECHNOLOGY AND MANAGEMENT, KABLANA Page 21
MICROCONTROLLERS LAB (LC-ECE-214 G)

EXPERIMENT NO: 7(a)


AIM: Write a Program to transfer a block of data without overlap in forward direction..

APPARATUS REQUIRED: - 8086 microprocessor kit & power supply.

THEORY: To transfer a block of data, first take a single byte (8 bit of data) into accumulator from
its original memory location in SI and then it is transferred to desired memory location in DI. We
take 0000H in AX for initialization and then transfer it in DS and ES. So AX, DS and ES are
cleared or having value 0000H. Now CX is loaded with the total number of data bytes (count) to be
transferred. The data is transferred byte by byte by using MOVSB instruction to destination with
counter CX decrementing at each step. Using CLD instruction (clear the direction flag, DF=0) then
contents of SI and DI will auto incremented by one. When counter CX reaches to zero, the process
of transferring is stopped i.e. whole block of data is transferred.

DATA:

0500H (1st Byte) = 11H


0501H (2nd Byte) = 22H
0502H (3rd Byte) = 33H
0503H (4th Byte) = 44H
0504H (5th Byte) = 55H

RESULT:

0600H (1st Byte) = 11H

0601H (2nd Byte) = 22H

0602H (3rd Byte) = 33H

0603H (4th Byte) = 44H

0604H (5th Byte) = 55H

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


GANGA INSTITUTE OF TECHNOLOGY AND MANAGEMENT, KABLANA Page 22
MICROCONTROLLERS LAB (LC-ECE-214 G)

ALP to TRANSFER(or Shift) a Block (or String) of data without overlap in Forward on 8086 kit
MEMORY MACHINE LABEL MNEMONI OPERAND COMMENTS
ADDRESS CODE CS
0400 B8,00,00 MOV AX,0000H Copy 0000H into AX register for clear

0403 8E,D8 MOV DS,AX Copy 0000H into DS register for clear

0405 8E,C0 MOV ES,AX Copy 0000H into ES register for clear

0407 BE,00,05 MOV SI,0500H SI offset filled with 0500H (source address)

040A BF,00,06 MOV DI,0600H DI offset filled with 0600H (destination add)

040D B9,05,00 MOV CX,0005H Copy Count 0005H in CX register

0410 A4 UP MOVSB Move single Byte (8Bit) of Data from SI toDI

0411 46 INC SI Incremented contents of SI by one

0412 47 INC DI Incremented contents of DI by one

0413 49 DEC CX Decrement CX by one, so CX=CX-1

0414 75,FA JNZ/JNE UP If CX is not = 0, then jump to Label UP

0416 F4 HLT If CX=0, then halt or stop the program

PROCEDURE:
1) Switch on the 8086 microprocessor kit.
2) Press ‘RESET’.
3) After reset, press ‘REL EXEM’.
4) Then press ‘MEMC NEXT’.(We can go from address to data)
5) Put the data.
6) Press ‘FILL’ button.
7) Then ‘GO’.
8) Enter the starting address.
9) Press ‘FILL’.
10) After that ‘E’ is printed on keypad.
11) Then press ‘RESET’ and then ‘REL EXMEM’.
12) After that write last address where your data is stored.
13) Then press ‘MEMC NEXT’ then your result is showing.

RESULT: We have successfully shifted a block of data with or without overlap.

PRECAUTIONS: 1. Properly connect the microprocessor kit with power supply terminals.

2. Switch on the power supply after checking connections

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


GANGA INSTITUTE OF TECHNOLOGY AND MANAGEMENT, KABLANA Page 23
MICROCONTROLLERS LAB (LC-ECE-214 G)

EXPERIMENT NO: 7(b)


AIM: Write a program to transfer a block of data without overlap in reverse direction on
microprocessor 8086 kit.

APPARATUS REQUIRED: - 8086 microprocessor kit & power supply.

THEORY: To transfer a block of data, first take a single byte (8 bit of data) into accumulator from
its original memory location in SI and then it is transferred to desired memory location in DI. We
take 0000H in AX for initialization and then transfer it in DS and ES. So AX, DS and ES are
cleared or having value 0000H. Now CX is loaded with the total number of data bytes (count) to be
transferred. The data is transferred byte by byte by using MOVSB instruction to destination with
counter CX decrementing at each step. Using CLD instruction (clear the direction flag, DF=0) then
contents of SI and DI will auto incremented by one. When counter CX reaches to zero, the process
of transferring is stopped i.e. whole block of data is transferred.

DATA:
0500H (1st Byte) = 11H
0501H (2nd Byte) = 22H
0502H (3rd Byte) = 33H
0503H (4th Byte) = 44H
0504H (5th Byte) = 55H

RESULT:

0600H (1st Byte) = 55H

0601H (2nd Byte) = 44H

0602H (3rd Byte) = 33H

0603H (4th Byte) = 22H

0604H (5th Byte) = 11H

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


GANGA INSTITUTE OF TECHNOLOGY AND MANAGEMENT, KABLANA Page 24
MICROCONTROLLERS LAB (LC-ECE-214 G)

ALP to TRANSFER(or Shift) a Block (or String) of data without overlap in Reverseon 8086 kit
MEMORY MACHINE LABEL MNEMON OPERAND COMMENTS
ADDRESS CODE ICS
0400 B8,00,00 MOV AX,0000H Copy 0000H into AX register for clear

0403 8E,D8 MOV DS,AX Copy 0000H into DS register for clear

0405 8E,C0 MOV ES,AX Copy 0000H into ES register for clear

0407 BE,00,05 MOV SI,0500H SI offset filled with 0500H (source address)

040A BF,00,06 MOV DI,0600H DI offset filled with 0600H (destination


add)
040D B9,05,00 MOV CX,0005H Copy Count 0005H in CX register

0410 A4 UP MOVSB Move single Byte (8Bit) of Data from SI


toDI
0411 46 INC SI Incremented contents of SI by one

0412 4F DEC DI Incremented contents of DI by one

0413 49 DEC CX Decrement CX by one, so CX=CX-1

0414 75,FA JNZ/JNE UP If CX is not = 0, then jump to Label UP

0416 F4 HLT If CX=0, then halt or stop the program

PROCEDURE:
1) Switch on the 8086 microprocessor kit.
2) Press ‘RESET’.
3) After reset, press ‘REL EXEM’.
4) Then press ‘MEMC NEXT’.(We can go from address to data)
5) Put the data.
6) Press ‘FILL’ button.
7) Then ‘GO’.
8) Enter the starting address.
9) Press ‘FILL’.
10) After that ‘E’ is printed on keypad.
11) Then press ‘RESET’ and then ‘REL EXMEM’.
12) After that write last address where your data is stored.
13) Then press ‘MEMC NEXT’ then your result is showing.

RESULT: We have successfully transferred a block of data in reverse direction.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


GANGA INSTITUTE OF TECHNOLOGY AND MANAGEMENT, KABLANA Page 25
MICROCONTROLLERS LAB (LC-ECE-214 G)

PRECAUTIONS: 1. Properly connect the microprocessor kit with power supply terminals.

2. Switch on the power supply after checking connections

3. Make sure that all the machine codes should be as per specified in program.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


GANGA INSTITUTE OF TECHNOLOGY AND MANAGEMENT, KABLANA Page 26
MICROCONTROLLERS LAB (LC-ECE-214 G)

EXPERIMENT NO.8
AIM: Write a program to find the average of two numbers.

APPARATUS REQUIRED: - 8086 microprocessor kit & power supply.

THEORY: Take any two numbers from the memory location or by the immediate addressing in to
the two registers. One number should be in the AX (Accumulator) and other number is any of the
registers like BX or other. Now add the two numbers by using ADD command directly, the result
would be stored in the AX.

Then Divide contents of AX by two by using SAR AX, 1 instruction and store result in AX register.

DATA: First Number= 0008H (in AX register)

Second Number= 0004H (in BX register)

ALP for AVERAGE of two 16 bit Hexadecimal Numbers on microprocessor 8086 kit
MEMORY MACHINE LABEL MNEMONICS OPERAND COMMENTS
ADDRESS CODE
0400 B8,08,00 MOV AX,0008 H Copy first Number
in AX register
0403 BB,04,00 MOV BX,0004 H Copy second
Number in BX
register
0406 01,D8 ADD AX,BX Add the two
Numbers& store
result in AX
0408 D1,F8 SAR AX,1 Shift the contents of
AX right by one bit
040A CC INT 3 Interrupt of program,
break point
instruction used for
debugging.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


GANGA INSTITUTE OF TECHNOLOGY AND MANAGEMENT, KABLANA Page 27
MICROCONTROLLERS LAB (LC-ECE-214 G)

PROCEDURE:
1) Switch on the 8086 microprocessor kit.
2) Press ‘RESET’.
3) After reset, press ‘REL EXEM’.
4) Then press ‘MEMC NEXT’.(We can go from address to data)
5) Put the data.
6) Press ‘FILL’ button.
7) Then ‘GO’.
8) Enter the starting address.
9) Press ‘FILL’.
10) After that ‘E’ is printed on keypad.
11) Then press ‘RESET’ and then ‘REL EXMEM’.
12) After that write last address where your data is stored.
13) Then press ‘MEMC NEXT’ then your result is showing.

RESULT: AVERAGE of Two Numbers = 0006H (in AX register or Accumulator).

PRECAUTIONS: 1. Properly connect the microprocessor kit with power supply terminals.

2. Switch on the power supply after checking connections

3. Make sure that all the machine codes should be as per specified in the program.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


GANGA INSTITUTE OF TECHNOLOGY AND MANAGEMENT, KABLANA Page 28
MICROCONTROLLERS LAB (LC-ECE-214 G)

EXPERIMENT NO.9
AIM: Write a program to find maximum number in the array of 03 numbers.

APPARATUS REQUIRED: - 8086 microprocessor kit & power supply.

THEORY: Let there are 3 numbers in given series and therefore the count is placed in memory
locations (ML) 0500H and 0501H and copied in CX as 0003H. The numbers are placed in memory
locations from 0502H to 0507H. Each memory location store only one byte (8 Bit) of data. First
number in series is placed in AX and compared with second number residing in memory locations.
The Largest of two numbers is placed in AX. Again number in AX is compared with third number
of series and Largest Number is stored in AX. The process of comparison is repeated till all the
numbers of series is compared and result of Largest Number is stored in AX is stored at ML 0550H
and 0551H.

DATA:
0500H (Lower Count) = 03H
0501H (Higher Count) = 00H
0502H (Lower 1st Byte) = 11H
0503H (Higher 1st Byte) = 22H

RESULT:
0504H (Lower 2nd Byte) = 33H
0505H (Higher 2nd Byte) = 44H
0506H (Lower 3rd Byte) = 55H
0507H (Higher 3rd Byte) = 66H

0550H (Lower Byte) = 55H


0551H (Higher Byte) = 66H

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


GANGA INSTITUTE OF TECHNOLOGY AND MANAGEMENT, KABLANA Page 29
MICROCONTROLLERS LAB (LC-ECE-214 G)

ALP to find MAXIMUM / GREATEST / LARGEST Number in the Array of 03 Numbers on


microprocessor 8086 kit.

MEMORY MACHINE LABEL MNEM OPERAND COMMENTS


ADDRESS CODE ONICS
0400 BE,00,05 MOV SI,0500H Copy 0500H into SI offset (source
address)
0403 8B,0C MOV CX,[SI] Copy contents of SI (0003H) into CX
register
0405 B8,00,00 MOV AX,0000 Copy 0000H into AX register for clear
H
0408 46 BACK INC SI Incremented contents of SI by one

0409 46 INC SI Incremented contents of SI by one

040A 3B,04 CMP AX,[SI] Compare 1st No. in AX with 2nd No. at
ML in SI
040C 73,02 JAE GO If AX > = ML, then jump to label GO
040E 8B,04 MOV AX,[SI] If AX< ML, then contents of SI copied in
AX
0410 E2,F6 GO LOOP BACK If CX not = 0, then jump to label BACK
0412 A3,50,05 MOV [0550],A Copy Largest No. in AX at ML 0550H &
X 0551H
0415 CC INT 3 Interrupt of program, break point
instruction used for debugging.

PROCEDURE:
1) Switch on the 8086 microprocessor kit.
2) Press ‘RESET’.
3) After reset, press ‘REL EXEM’.
4) Then press ‘MEMC NEXT’.(We can go from address to data)
5) Put the data.
6) Press ‘FILL’ button.
7) Then ‘GO’.
8) Enter the starting address.
9) Press ‘FILL’.
10) After that ‘E’ is printed on keypad.
11) Then press ‘RESET’ and then ‘REL EXMEM’.
12) After that write last address where your data is stored.
13) Then press ‘MEMC NEXT’ then your result is showing.

RESULT: We have successfully find out the maximum number in array of 3 numbers.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


GANGA INSTITUTE OF TECHNOLOGY AND MANAGEMENT, KABLANA Page 30
MICROCONTROLLERS LAB (LC-ECE-214 G)

PRECAUTIONS: 1. Properly connect the microprocessor kit with power supply terminals.

2. Switch on the power supply after checking connections

3. Make sure that all the machine codes should be as per specified in the

program.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


GANGA INSTITUTE OF TECHNOLOGY AND MANAGEMENT, KABLANA Page 31
MICROCONTROLLERS LAB (LC-ECE-214 G)

EXPERIMENT NO.10
AIM: Write a program to find the sum of the first ‘n’ integers.

APPARATUS REQUIRED: - 8086 microprocessor kit & power supply.

THEORY: Take any three numbers from the memory locations. First number should be in the AX
(Accumulator) and Second number is at some memory location. Now add the two numbers by using
ADD command directly, the result would be stored in the AX. Now add the Third number to Sum
of two numbers in AX by using ADD command directly, the result would be stored in the AX.
Copy result of Sum in AX at Memory Location / Address (ML/MA) 0601H. Note that numbers
should be choose that their sum do not exceed the highest range of 16 bit i.e. FFFFH.

DATA: COUNT = 0003H (as there are 3 Numbers)


First Number= 2211H (at ML/MA 0501H=11H, 0502H=22H)
Second Number= 5544H (at ML/MA 0503H=44H, 0504H=55H)
Second Number= 8877H (at ML/MA 0505H=77H, 0506H=88H)

PROCEDURE:
ALP to find the SUM of 16 bit n numbers and SUM is 16 bit on microprocessor 8086 kit
MEMORY MACHINE LABEL MNEMO OPERAND COMMENTS
ADDRESS CODE NICS
0400 B8,00,00 MOV AX,0000H Initial SUM is 0000H in AX
0403 BE,01,05 MOV SI,[0501H] Starting Memory Address of Data in SI
0406 8B,0C MOV CX,[SI] Copy contents of SI i.e. Count in CX

0408 46 BACK INC SI Increment contents of SI by One

0409 46 INC SI Increment contents of SI by One again

040A 03,04 ADD AX,[SI] Add Next Number to Previous Sum

040C E2,FA LOOP BACK Jump to Label BACK until CX becomes


zero
040E A3,01,06 MOV [0601H],A Store SUM in Memory Location / Addr
X 0601
0411 CC INT 3 Interrupt of program, break point instruction
used for debugging.
1) Switch on the 8086 microprocessor kit.
2) Press ‘RESET’.
3) After reset, press ‘REL EXEM’.
4) Then press ‘MEMC NEXT’.(We can go from address to data)

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


GANGA INSTITUTE OF TECHNOLOGY AND MANAGEMENT, KABLANA Page 32
MICROCONTROLLERS LAB (LC-ECE-214 G)

5) Put the data.


6) Press ‘FILL’ button.
7) Then ‘GO’.
8) Enter the starting address.
9) Press ‘FILL’.
10) After that ‘E’ is printed on keypad.
11) Then press ‘RESET’ and then ‘REL EXMEM’.
12) After that write last address where your data is stored.
13) Then press ‘MEMC NEXT’ then your result is showing.

RESULT: SUM of Three Numbers = FFCCH (in AX register and at ML/MA 0601H=CCH,
0602H=FFH)

PRECAUTIONS: 1. Properly connect the microprocessor kit with power supply terminals.

2. Switch on the power supply after checking connections

3. Make sure that all the machine codes should be as per specified in the

program.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


GANGA INSTITUTE OF TECHNOLOGY AND MANAGEMENT, KABLANA Page 33
MICROCONTROLLERS LAB (LC-ECE-214 G)

EXPERIMENT NO.11
AIM: Write a program to generate a square wave.

APPARATUS REQUIRED: - 8086 microprocessor kit & power supply.

THEORY: First we have to initialize 16 bit control word register (CWR) of 8253 having value
FFDEH. The value FFDEH must be copied in DX register. Then we have to select Counter-1 /
Timer-1. For selection of Counter-1 / Timer-1of 8253 IC, we have to copy FFDAH in DX register.
For generating square wave we must short pins numbers 9 and 15 of 8253 IC. The square wave
output will available at pin number 13 of 8253 IC.

DATA: No input data

ALP to generate SQUARE WAVE using 8253 at Timer-1 on microprocessor 8086 kit
MEMORY MACHINE LABEL MNEMONICS OPERAND COMMENTS
ADDRESS CODE
0400 BA,DE,FF MOV DX,FFDE Copy FFDEH into DX register for
H CWR
0403 B0,76 MOV AL,76H Copy 76H into AL register

0405 EE OUT DX,AL Outputted AL contents in DX

0406 BA,DA,FF MOV DX,FFDA Copy FFDAH into DX register for


H Timer-1
0409 B0,FF BACK MOV AL,FFH Copy FFH into AL register

040B EE OUT DX,AL Outputted AL contents in DX,


W/F=HIGH
040C B0,00 MOV AL,00H Copy FFH into AL register

040E EE OUT DX,AL Outputted AL contents in DX,


W/F=LOW
040F EB,F8 JMP BACK Jump to label BACK for square
wave
0411 CC INT 3 Interrupt of program, break point
instruction used for debugging.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


GANGA INSTITUTE OF TECHNOLOGY AND MANAGEMENT, KABLANA Page 34
MICROCONTROLLERS LAB (LC-ECE-214 G)

PROCEDURE:

1) Switch on the 8086 microprocessor kit.


2) Press ‘RESET’.
3) After reset, press ‘REL EXEM’.
4) Then press ‘MEMC NEXT’.(We can go from address to data)
5) Put the data.
6) Press ‘FILL’ button.
7) Then ‘GO’.
8) Enter the starting address.
9) Press ‘FILL’.
10) After that ‘E’ is printed on keypad.
11) Then press ‘RESET’ and then ‘REL EXMEM’.
12) After that write last address where your data is stored.
13) Then press ‘MEMC NEXT’ then your result is showing.

RESULT: Square Wave Output at pin number 13 of 8253 IC.

PRECAUTIONS: 1. Properly connect the microprocessor kit with power supply terminals.

2. Switch on the power supply after checking connections

3. Make sure that all the machine codes should be as per specified in the

program.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


GANGA INSTITUTE OF TECHNOLOGY AND MANAGEMENT, KABLANA Page 35
MICROCONTROLLERS LAB (LC-ECE-214 G)

EXPERIMENT NO: 12
AIM: Write a program of Programmable Keypad and LCD Interface – 8279

APPARATUS REQUIRED: - 8279 kit & power supply.

THEORY: The objective of this lab is to show how the 8279 chip can be used to control the
Keypad and LCD. 2. The 8279 is a programmable keyboard and display interfacing chip. It scans
and encodes up to a 64-key keyboard where the keyboard matrix can be any size from 2x2 to 8x8. It
also controls up to a 16-digit numerical display. The keyboard section has a built-in FIFO 8
character buffer. The display is controlled from an internal 16B RAM that stores the coded display
information. The following figure shows the pin-out definition of 8279:

1. A0: selects data (0) or control/status (1) for reads and writes between 8086 and 8279.
2. !BD: output that blanks the displays.
3. CLK: used internally for timing. Max is 3 MHz
4. CN/ST: connected to the control key on the keyboard.
5. DB7 -DB0 : bidirectional pins that connect to data bus on 8086.
6. IRQ: becomes 1 when a key is pressed, data is available.
7. OUT A3 -A0 /B3 -B0 : outputs that sends data to the most o significant/least significant
nibble of the display.
8. RL7 -RL0 : return lines are inputs used to sense key depression in the keyboard matrix.
9. Shift: connects to Shift key on keyboard.
10. SL3 -SL0 : scan line outputs scan both the keyboard and displays.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


GANGA INSTITUTE OF TECHNOLOGY AND MANAGEMENT, KABLANA Page 36
MICROCONTROLLERS LAB (LC-ECE-214 G)

PROCEDURES:
Keypad Control The 8279 scan line outputs SL0 , SL1 , and SL2 are connected to the keypad
through 74LS145 decoder. The 74LS145 is designed to accept BCD inputs and provide appropriate
outputs to drive 10-digit displays. Once a key is pressed, the input key is encoded by 8279 and
stored in its built-in FIFO RAM. After that, it sends the key code to the 8086 which consequently
sends it to the FND as shown in the following figure.

Figure 1: Functional circuit description of the keypad control exercise.

DATA79 EQU 0FFE8H

CNTR79 EQU 0FFEAH

FND EQU 3FF0H

CODE SEGMENT

ASSUME CS:CODE, DS:CODE

ORG 0

START: MOV AX,CS

MOV DS,AX

MOV DX,CNTR79

MOV AL,0

OUT DX,AL

MOV AL,39H

OUT DX,AL

LOOP_MAIN: MOV DX,CNTR79

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


GANGA INSTITUTE OF TECHNOLOGY AND MANAGEMENT, KABLANA Page 37
MICROCONTROLLERS LAB (LC-ECE-214 G)

LOOP1: IN AL,DX

TEST AL,7

JZ LOOP1

MOV DX,DATA79

IN AL,DX

CALL OUT_FND

JMP LOOP_MAIN

OUT_FND: MOV BX, OFFSET FONT

MOV DX,FND

XLAT

OUT DX,AL

RET

FONT

DB 11000000B

DB 11111001B

DB 10100100B

DB 10110000B

DB 10011001B

DB 10010010B

DB 10000010B

DB 11011000B

DB 10000000B

DB 10010000B

DB 10001000B

DB 10000011B

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


GANGA INSTITUTE OF TECHNOLOGY AND MANAGEMENT, KABLANA Page 38
MICROCONTROLLERS LAB (LC-ECE-214 G)

DB 11000110B

DB 10100001B

DB 10000110B

DB 10001110B

DB 01000000B

DB 01111001B

DB 00100100B

DB 00110000B

DB 00011001B

DB 00010010B

CODE ENDS

END START

LCD Control The 16-by-2 LCD is controlled directly from 8086 microprocessor without
interfacing other I/O peripheral chips as shown in the following figure.

Utilize the following flow chart to write a code that causes the LCD to show the following message:

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


GANGA INSTITUTE OF TECHNOLOGY AND MANAGEMENT, KABLANA Page 39
MICROCONTROLLERS LAB (LC-ECE-214 G)

IR_WR EQU 0FFC1H

IR_RD EQU 0FFC3H

DR_WR EQU 0FFC5H

CODE SEGMENT

ASSUME CS:CODE, DS:CODE

ORG 0

START: MOV AX,CS

MOV DS,AX

MOV AH,1

CALL IRWR

MOV AH,84H

CALL IRWR

MOV AH,'O'

CALL OUTL

MOV AH,'H'

CALL OUTL

MOV AH,'-'

CALL OUTL

MOV AH,'-'

CALL OUTL

MOV AH, 0C8H

CALL IRWR

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


GANGA INSTITUTE OF TECHNOLOGY AND MANAGEMENT, KABLANA Page 40
MICROCONTROLLERS LAB (LC-ECE-214 G)

MOV AH,'Y'

CALL OUTL

MOV AH,'A'

CALL OUTL

MOV AH,'!'

CALL OUTL

MOV AH,'!'

CALL OUTL

HLT

IRWR: CALL BUSY

MOV DX,IR_WR

MOV AL,AH

OUT DX,AL

RET

OUTL: CALL BUSY

MOV AL,AH

MOV DX,DR_WR OUT DX,AL

RET

BUSY: MOV DX,IR_RD

BUSY1: IN AL,DX

AND AL,80H

JNZ BUSY1

RET

CODE ENDS

END START

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


GANGA INSTITUTE OF TECHNOLOGY AND MANAGEMENT, KABLANA Page 41
MICROCONTROLLERS LAB (LC-ECE-214 G)

RESULT: We have successfully interfaced programmable keypad and LCD.

PRECAUTIONS: 1. Properly connect the microprocessor kit with power supply terminals.

2. Switch on the power supply after checking connections

3. Make sure that all the machine codes should be as per specified in the

program.

4. Handle the Trainer kit carefully.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


GANGA INSTITUTE OF TECHNOLOGY AND MANAGEMENT, KABLANA Page 42
MICROCONTROLLERS LAB (LC-ECE-214 G)

EXPERIMENT NO.13
AIM: Write a program to show Interfacing with 8253/8254.

APPARATUS REQUIRED: - 8253/8254 kit & power supply.

THEORY: 8253 and 8254 are software programmable timer/counter designed for use with
Microcomputer systems for the generation of accurate time delays under software control instead of
setting up timing loops in software. They are nearly identical in function. The major differences are:
a) The maximum clock frequency for 8253 is 2.6MHz and for 8254 it is 8MHz.
b) 8254 only has a read-back feature, by which you can latch the count value at any instant.

8253/8254 PROGRAM:

Place the second from the top of dip switch at the top left corner of the board at right position:
OUT1
COUNT1 EQU 0FFDAH ; address to select 8253 counter 1
CSR EQU 0FFDEH ; address to select 8253 control word
CNT3 EQU 3FD6H ; address to select 8255 control word register (PPI –3)
APORT3 EQU 3FD0H ; address to select 8255 Port A
BPORT3 EQU 3FD2H ; address to select 8255 Port B
CPORT3 EQU 3FD4H ; address to select 8255Port C
FND EQU 3FF0H ; address to select Seven Segment Display
ORG 0
CODE SEGMENT ASSUME CS: CODE, DS: CODE
START:
MOV SP, 4000H ; Setup Stack Pointer
MOV AX, CS ; CS = DS
MOV DS,AX
MOV AX,0
MOV ES,AX ; Setup ES to ‘0’
MOV BX,2*4 ; Setup Vector Address of NMI to BX
MOV ES:WORD PTR[BX],OFFSET NMI ; To write IP in Vector Table
MOV ES:2[BX],CS ; To write CS in the Vector Table
MOV DX,CNT3 ; Address of control word register of 8255 to initialize
MOV AL,90H ; To set up ports as : A PORT = input, B and C PORT = Output
OUT DX,AL ; DX goes to the Address Bus and AL to the Data Bus
MOV DX,CPORT3 ; Outputting to C PORT all High
MOV AL,0FFH
OUT DX,AL

I8253:
MOV DX,CSR ; Initializing 8253
MOV AL,01110110B ; selecting Counter 1, LSB then MSB, Mode-3-Square WaveMode,
Binary Count
OUT DX,AL ; DX goes to the Address Bus and AL to the Data Bus

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


GANGA INSTITUTE OF TECHNOLOGY AND MANAGEMENT, KABLANA Page 43
MICROCONTROLLERS LAB (LC-ECE-214 G)

MOV DX,COUNT1 ; Address of 8253 Counter 1


PLAY:
PUSH DX
MOV DX,APORT3 ; Address of 8255 A PORT : Which is connected to the 8 push
buttons to take input
IN AL,DX ; The data in the PORT A is taken to AL
NOT AL ; reversing
MOV DX,BPORT3 ; Address of 8255 B PORT : Which is connected to the 8 LEDs to
output any value.
OUT DX,AL ; DX goes to the Address Bus and AL to the Data Bus
POP DX
CMP AL,BL ; Same as previous inputted button ?
JZ PLAY ; If same button jump to PLAY
MOV BL,AL ; To store the 1 Byte information of which button pressed to BL
CMP AL,0 ; Whether any button pressed ?
JZ PLAY ; If not, Jump to PLAY to see whether any button is pressed
PUSH AX ; store the information of which button pressed to the STACK
MOV AX,10 ; Data of Soundless ( the rest ) transfer to 8253
OUT DX,AL ; sending LSB
MOV AL,AH
OUT DX,AL ; sending MSB
MOV CX,1500 ; Time Delay
LOOP $
POP AX ; Return input value of buttons
PUSH DX ; temporary storage to stack
MOV DX, FND ; The seven segment display address
TEST AL, 80H ; ‘7’ key/button ?
JNZ DO ; in case of ‘7’ key then jump to DO
TEST AL, 40H ; ‘6’ key/button ?
JNZ RE ; in case of ‘6’ key then jump to RE
TEST AL, 20H ; ‘5’ key/button ?
JNZ MI ; in case of ‘5’ key then jump to MI
TEST AL, 10H ; ‘4’ key/button

RESULT: Interfacing with 8253/8254 is studied.

PRECAUTIONS: 1. Properly connect the microprocessor kit with power supply terminals.

2. Switch on the power supply after checking connections

3. Make sure that all the machine codes should be as per specified in the

program.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


GANGA INSTITUTE OF TECHNOLOGY AND MANAGEMENT, KABLANA Page 44
MICROCONTROLLERS LAB (LC-ECE-214 G)

Short Questions with Answer on 8086 Microprocessor

Q1.What is Microprocessor?
Ans: It is a program controlled semiconductor device (IC), which fetches, decodes and executes
instructions.

Q2. What are the basic units of a microprocessor?


Ans: The basic units or blocks of a microprocessor are ALU, an array of registers and control unit.

Q3. What is assembly language?


Ans: The language in which the mnemonics (short -hand form of instructions) are used to write a
program is called assembly language. The manufacturers of microprocessor give the mnemonics.

Q4. What is a bus?


Ans: Bus is a group of conducting lines that carries data, address and control signals.

Q5 What is meant by cross-compiler?


Ans: A program runs on one machine and executes on another is called as cross-compiler.

Q6 What are various examples for Maskable interrupts?


Ans: RST 7.5, RST6.5, RST5.5 are Maskable interrupts.

Q7 What is SIM and RIM instructions?


Ans: SIM is Set Interrupt Mask. It is used to mask the hardware interrupts. RIM is Read Interrupt
Mask. Used to check whether the interrupt is Masked or not

Q8 Give example for Non-Maskable interrupts.


Ans: Trap is known as Non-Maskable interrupts, which is used in emergency condition.

Q9 Which interrupts are generally used for critical events?


Ans: Non-Maskable interrupts are used in critical events. Such as Power failure, emergency, Shut
off etc.

Q10 What is the difference between 8085 and 8086 in microprocessor?


Ans: 8086 has a special concept called as memory segmentation. It allows parallel processing,
while 8085 does not.8085 is an 8-bit micro processor, 8086 is a 16-bit processor. 8085 operate in
only single mode where 8086 operate in two modes (i.e. minimum & maximum modes).

Q11 How many Pins are used in 8086 microprocessor?


Ans: - 40 pins.

Q12 How many bits of Flag registers are used in 8086 microprocessor?
Ans: - 16 bits.

Q13 What are the different flags in 8086?


Ans:9 Flages -Overflow Flag, Direction Flag, Interrupt Flag, Trap Flag, Sign Flag,Zero Flag,
Auxiliary Carry Flag,Parity Flag, Carry Flag.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


GANGA INSTITUTE OF TECHNOLOGY AND MANAGEMENT, KABLANA Page 45
MICROCONTROLLERS LAB (LC-ECE-214 G)

Q14 What are the various segment registers in 8086?


Ans: Code, Data, Stack, Extra Segment registers in 8086.

Q15 Which Segment is used to store interrupt and subroutine return address registers?
Ans: Stack Segment in segment register is used to store interrupt and subroutine return address
registers.

Q16 What is the position of the Stack Pointer after the PUSH instruction?
Ans: The address line is 02 less than the earlier value. It will be Decrement by 2.

Q18 What is internal structure of 8086?


Ans: 8086 is having 2 different units i.e. BIU (Bus Interface Unit) and EU (Execution Unit), these
two units work synchronously.

.Q19 What are memory addressing capacities of 8086 microprocessor?


Ans: -1 MB due to 20 addressing lines i.e. 220=1MB=1024KB=1048576B Where (1KB=1024)

Q20 What is address range and data range of 8086 microprocessor?


Ans: - Address range 00000 to FFFFF (20 Addr.Lines) and Data range 0000 to FFFF (16 Data
Lines).

Multiple Choice Questions on 8086 Microprocessor

1. A microprocessor is a _______ chip integrating all the functions of a CPU of a computer.


A. multiple B. single C. double D. triple

2. Microprocessor is a/an _______ circuit that functions as the CPU of the compute
A. electronic B. mechanic C. integrating D. processing

3. Microprocessor is the ______ of the computer and it perform all the computational tasks
A. main B. heart C. important D. simple

4. The purpose of the microprocessor is to control ______


A. memory B. switches C. processing D. tasks

5. The first digital electronic computer was built in the year________


A. 1950 B. 1960 C. 1940 D. 1930

6. In 1960's Texas institute invented ______


A. integrated circuits B. microprocessor C. vacuum tubes D. transistors

7. The Intel 8086 microprocessor is a _______ processor


A. 8 bit B. 16 bit C. 32 bit D. 4 bit

8. The microprocessor can read/write 16 bit data from or to ________


A. memory B. I /O device C. processor D. register

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


GANGA INSTITUTE OF TECHNOLOGY AND MANAGEMENT, KABLANA Page 46
MICROCONTROLLERS LAB (LC-ECE-214 G)

9. In 8086 microprocessor , the address bus is ________ bit wide


A. 12 bit B. 10 bit C. 16 bit D. 20 bit

10. The work of EU is ________


A. encoding B. decoding C. processing D. calculations

11. The 16 bit flag of 8086 microprocessor is responsible to indicate ___________


A. the condition of result of ALU operation B. the condition of memory
C. the result of addition D. the result of subtraction

12. The CF is known as ________


A. carry flag B. condition flag C. common flag D. single flag

13. The SF is called as ________


A. service flag B. sign flag C. single flag D. condition flag

14. The OF is called as _______


A. overflow flag B. overdue flag C. one flag D. over flag

15. The IF is called as _________


A. initial flag B. indicate flag C. interrupt flag D. inter flag

16. The register AX is formed by grouping ________


A. AH & AL B. BH & BL C. CH & CL D. DH & DL

17. The SP is indicated by ________


A. single pointerB. stack pointer C. source pointer D. destination pointer

18. The BP is indicated by _______


A. base pointer B. binary pointer C. bit pointer D. digital pointer

19. The SS is called as ________


A. single stack B. stack segment C. sequence stack .D. random stack

20. The index register are used to hold _______


A. memory register B. offset address C. segment memory D. offset memory

21. The BIU contains FIFO register of size __________ bytes


A. 8 B. 6 C. 4 D. 12

22. The BIU prefetches the instruction from memory and store them in ________
A. queue B. register C. memory D. stack

23. The 1 MB byte of memory can be divided into ______ segment


A. 1 Kbyte B. 64 Kbyte C. 33 Kbyte D. 34 Kbyte

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


GANGA INSTITUTE OF TECHNOLOGY AND MANAGEMENT, KABLANA Page 47
MICROCONTROLLERS LAB (LC-ECE-214 G)

24. The DS is called as _______


A. data segment B. digital segment C. divide segment D. decode segment

25. The CS register stores instruction _____________ in code segment


A. stream B. path C. codes D. stream line

26. The IP is ________ bits in length


A. 8 bits B. 4 bits C. 16 bits D. 32 bits

27. The push source copies a word from source to ______


A. stack B. memory C. register D. destination

28. LDs copies to consecutive words from memory to register and ___________
A. ES B. DS C. SS D. CS

29. INC destination increments the content of destination by _______


A. 1 B. 2 C. 30 D. 41

30. IMUL source is a signed _________


A. multiplication B. addition C. subtraction D. division

31. _________destination inverts each bit of destination


A. NOT B. NOR C. AND D. OR

32. The JS is called as ______


A. jump the signed bit B. jump single bit
C. jump simple bit D. jump signal it

33. Instruction providing both segment base and offset address are called _____
A. below type .B. far type C. low type D. high type

34. The conditional branch instruction specify ___________ for branching


A. conditions B. instruction C. address D. memory

35. The microprocessor determines whether the specified condition exists or not by testing the
______
A. carry flag B. conditional flag C. common flag D. sign flag
36. The LES copies to words from memory to register and __________
A. DS B. CS C. ES D. DS

37. The _________ translates a byte from one code to another code
A. XLAT B. XCHNG C. POP D. PUSH

38. The _______ contains an offset instead of actual address


A. SP B. IP C. ES D. SS

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


GANGA INSTITUTE OF TECHNOLOGY AND MANAGEMENT, KABLANA Page 48
MICROCONTROLLERS LAB (LC-ECE-214 G)

39. The 8086 fetches instruction one after another from __________ of memory
A. code segment B. IP C. ES D. SS

40. The BIU contains FIFO register of size 6 bytes called _____.
A. queue B. stack C. segment D. register

41. The ___________ is required to synchronize the internal operands in the processor CLK
Signal
A. UR Signal B. Vcc C. AIE D. Ground

42. The pin of minimum mode AD0-AD15 has ____________ address


A. 16 bit B. 20 bit C. 32 bit D. 4 bit

43. The pin of minimum mode AD0- AD15 has _________ data bus
A. 4 bit B. 20 bit C. 16 bit D. 32 bit

44. The address bits are sent out on lines through __________
A. A16-19 B. A0-17 C. D0-D17 D. C0-C17

45. ________ is used to write into memory


A. RD B. WR C. RD / WR D. CLK

46. The functions of Pins from 24 to 31 depend on the mode in which _______ is operating
A. 8085 B. 8086 C. 80835 D. 80845

47. The RD, WR, M/IO is the heart of control for a __________ mode
A. minimum B. maximum C. compatibility mode D. control mode

48. In a minimum mode there is a ___________ on the system bus


A. single B. double C. multiple D. triple

49. If MN/MX is low the 8086 operates in __________ mode


A. Minimum B. Maximum C. both (A) and (B) D. medium

50. In max mode, control bus signal So,S1 and S2 are sent out in ____________ form
A. decoded B. encoded C. shared D. unshared

51. The ___ bus controller device decodes the signals to produce the control bus signal
A. internal B. data C. external D. address

52. A _____ Instruction at the end of interrupt service program takes the execution back to the
interrupted program
A. forward B. return C. data D. line

53. The main concerns of the ___________ are to define a flexible set of commands
A. memory interface B. peripheral interface

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


GANGA INSTITUTE OF TECHNOLOGY AND MANAGEMENT, KABLANA Page 49
MICROCONTROLLERS LAB (LC-ECE-214 G)

C. both (A) and (B) D. control interface

54. Primary function of memory interfacing is that the _________ should be able to read from
and write into register
A. multiprocessor B. microprocessor C. dual Processor D. coprocessor

55. To perform any operations, the Mp should identify the __________


A. register B. memory C. interface D. system

56. The Microprocessor places __________ address on the address bus


A. 4 bit B. 8 bit C. 16 bit D. 32 bit

57. The Microprocessor places 16 bit address on the add lines from that address by _____
register should be selected
A. address B. one C. two D. three

58. The ________of the memory chip will identify and select the register for the EPROM
A. internal decoder B. external decoder C. address decoder D. data decoder

59. Microprocessor provides signal like ____ to indicate the read operatio
A. LOW B. MCMW C. MCMR D. MCMWR

60. To interface memory with the microprocessor, connect register the lines of the address bus
must be added to address lines of the _______ chip.
A. single B. memory C. multiple D. triple

61. The remaining address line of ______ bus is decoded to generate chip select signal
A. data B. address C. control bus D. both (a) and (b)

62. _______ signal is generated by combining RD and WR signals with IO/M


A. control B. memory C. register D. system

63. Memory is an integral part of a _______ system


A. supercomputer B. microcomputer
C. minicomputer D. mainframe computer

64. _____ has certain signal requirements write into and read from its registers
A. memory B. register C. both (a) and (b) D. control

65. An _________ is used to fetch one address


A. internal decoder B. external decoder C. encoder D. register

66. The primary function of the _____________ is to accept data from I/P devices
A. multiprocessor B. microprocessor C. peripherals D. interfaces

67. ___________ signal prevent the microprocessor from reading the same data more than one

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


GANGA INSTITUTE OF TECHNOLOGY AND MANAGEMENT, KABLANA Page 50
MICROCONTROLLERS LAB (LC-ECE-214 G)

A. pipelining B. handshaking C. controlling D. signaling

68. Bits in IRR interrupt are ______


A. reset B. set C. stop D. start

69. __________ generate interrupt signal to microprocessor and receive acknowledge


A. priority resolver B. control logic
C. interrupt request register D. interrupt register

70. The _______ pin is used to select direct command word


A. A0 B. D7-D6 C. A12 D. AD7-AD6

71. The _______ is used to connect more microprocessor


A. peripheral device B. cascade C. I/O devices D. control unit

72. CS connect the output of ______


A. encoder B. decoder C. slave program D. buffer

73. In which year, 8086 was introduced?


A. 1978 B. 1979 C. 1977 D. 1981

74. Expansion for HMOS technology_______


A. high level mode oxygen semiconductor
B. high level metal oxygen semiconductor
C. high performance medium oxide semiconductor
D. high performance metal oxide semiconductor

75. 8086 and 8088 contains _______ transistors


A. 29000 B. 24000 C. 34000 D. 54000

76. ALE stands for ___________


A. address latch enable B. address level enable
C. address leak enable D. address leak extension

77. What is DEN?


A. direct enable B. data entered C. data enable D. data encoding

78. In 8086, Example for Non maskable interrupts are ________.


A. TRAP B. RST6.5 C. INTR D. RST6.6

79. In 8086 the overflow flag is set when _____________.


A. the sum is more than 16 bits.
B. signed numbers go out of their range after an arithmetic operation.
C. carry and sign flags are set. D. subtraction

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


GANGA INSTITUTE OF TECHNOLOGY AND MANAGEMENT, KABLANA Page 51
MICROCONTROLLERS LAB (LC-ECE-214 G)

80. In 8086 microprocessor the following has the highest priority among all type interrupts?
A. NMI B. DIV 0 C. TYPE 255 D. OVER FLOW

81. In 8086 microprocessor one of the following statements is not true?


A. coprocessor is interfaced in max mode. B. coprocessor is interfaced in min mode.
C. I /O can be interfaced in max / min mode. D. supports pipelining

82. Address line for TRAP is?


A. 0023H B. 0024H C. 0033H D. 0099H

83. Access time is faster for _________.


A. ROM B. SRAM C. DRAM D. ERAM

84. The First Microprocessor was__________.


A. Intel 4004 B. 8080 C. 8085 D. 4008

85. Status register is also called as ___________.


A. accumulator B. stack C. counter D. flags

86. Which of the following is not a basic element within the microprocessor?
A. Microcontroller B. Arithmetic logic unit (ALU)
C. Register array D. Control unit

87. Which method bypasses the CPU for certain types of data transfer?
A. Software interrupts B. Interrupt-driven I/O
C. Polled I/O D. Direct memory access (DMA)

88. Which bus is bidirectional?


A. Address bus B. Control bus
C. Data bus D. None of the above

89. The first microprocessor had a(n)________.


A. 1 – bit data bus B. 2 – bit data bus
C. 4 – bit data bus D. 8 – bit data bus

90. Which microprocessor has multiplexed data and address lines?


A. 8086 B. 80286 C. 80386 D. Pentium

91. Which is not an operand?


A. Variable B. Register C. Memory location D. Assembler

92. Which is not part of the execution unit (EU)?


A..Arithmetic logic unit (ALU) B. Clock
C. General registers D. Flags

93. A 20-bit address bus can locate ________.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


GANGA INSTITUTE OF TECHNOLOGY AND MANAGEMENT, KABLANA Page 52
MICROCONTROLLERS LAB (LC-ECE-214 G)

A. 1,048,576 locations B. 2,097,152 locations


C. 4,194,304 locations D. 8,388,608 locations

94. Which of the following is not an arithmetic instruction?


A. INC (increment) B. CMP (compare)
C. DEC (decrement) D. ROL (rotate left)

95. During a read operation the CPU fetches ________.


A. a program instruction B. another address
C. data itself D. all of the above

96. Which of the following is not an 8086/8088 general-purpose register?


A.Code segment (CS) B. Data segment (DS)
C. Stack segment (SS) D. Address segment (AS)

97. A 20-bit address bus allows access to a memory of capacity


A. 1 MB B. 2 MB C. 4 MB D. 8 MB

98. Which microprocessor accepts the program written for 8086 without any changes?
A. 8085 B. 8086 C. 8087 D. 8088

99. Which group of instructions do not affect the flags?


A. Arithmetic operations B. Logic operations
C. Data transfer operations D. Branch operations

100.The result of MOV AL, 65 is to store


A. store 0100 0010 in AL B. store 42H in AL
C. store 40H in AL D. store 0100 0001 in AL

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


GANGA INSTITUTE OF TECHNOLOGY AND MANAGEMENT, KABLANA Page 53

You might also like