Micro Processor 8086
Micro Processor 8086
Micro Processor 8086
NOTES ON
8086 MICRO PROCESSOR
FOR
ELECTRICAL ENGG. BRANCH,
PTU (JALANDHAR).
PREPARED BY:
MANISH KUMAR
E.E. (2006-2010 BATCH)
SUSCET, TANGORI,
MOHALI, PUNJAB.
2
8086 Micro Processor
COMPARISON OF 8085 AND 8086
PARAMETER 8085 8086
Size 8 bit MP 16 bit MP
Address bus 16 bits 20 bits
Instruction queue Does not have It has a 6 byte instruction queue
instruction queue
Pipelining Does not support Supports pipelined architecture
Multiprocessor Does not support Supports multiprocessing
support
I / Os 2^8 = 256 2^16 = 65,536 I/Os
Coprocessor Does not have any It has coprocessor interface
interface
Arithmetic Only supports Supports both integer and real
support integer arithmetic arithmetic
Check speed Operates on 3 MHz Operates on 5 MHz, 8 MHz, 10 MHz
or 5 MHz or 12 MHz
External hardware Requires less Requires more external hardware
external hardware
Operating modes It supports single Supports two operating modes i.e.
operating modes minimum and maximum mode
Cost Cost is low Cost is high
Memory Memory spaces are The memory space is segmented
segmentation not segmented
ALU i.e. arithmetic & logical unit: for mathematical and logical
operation.
a) Conditional Flags:
b) Control Flags
iv) Data register: It is used together with AX for the word – size
MUL & DIU operations. It also stores data.
Instruction que: It is based on FIFO principle i.e. first in first out. While
decoding and executing an instruction BIU fetches upto 6 instruction bytes for
the next instruction and stores it in the Que register.
Pipe lining: It is the process of fetching the next instruction when the
present instruction is being executed.
Advantages:
eliminates the waiting time of EU and speed up the processing.
BIU obtains two instructions byte per fetch.
Segment registers:
Code segment reg. (CS)
Stack segment reg. (SS)
Extra segment reg. (ES)
Data segment reg. (DS)
MEMORY SEGMENTATION
It means segmenting memory into number of bytes. This memory can be
thought of as a vast collection of bytes; which are organized in an efficient
manner.
Advantages of Segmentation:
• Provides a powerful memory management mechanism.
• Supports modular software design i.e. programs can be partitioned into
modules that operate independently of one another.
• Implement object oriented programs.
• Allows two processes to easily store data.
• Allows the use of 16 bit registers.
• Possibility of increasing memory size of code, data or stack segments
beyond 64 K Byte.
• Possibility to separate memory areas for stack, code and data.
PIN DIAGRAM
Read (RD): an active low pin. If low, 8086 reads data from memory
and ports.
Address / Status bus: S3, S4, S5 and S6 holds the status information
about the processor.
9
Bus High Enable (BHE)/Status S7: BHE used to enable data onto the
most significant half of the data bus i.e. D8 – D15.
MINIMUM MODE:
READ CYCLE:
WRITE CYCLE
11
MAXIMUM MODE
QSO, QS1 (Que status): O/P pins, provides the status of que. Keeps
external tracking of the instruction que.
READ CYCLE :
13
LOGIC ANALYZER
Only two bus signal lines can be observed at a time. Logic Analyzer allows
to make measurements on 16 to 64 signals lines at once.
It detects and displays 1’s and 0’s with the help of COMPARATOR. The
reference input of the comparator is set for the logic threshold of the devices in
the system being looked at.
Logic Analyzer takes a snap shot of the logic levels on the data inputs each
time it receives a clock pulse. The samples are stored in an Internal Ram. These
samples represents a sequence of address output or data words (which ever
stored) by the 8-86. for precise timing with an analyzer, we use a clock signal
from an internal, crystal controlled oscillator.
A trigger signal tells the analyzer when to stop taking samples and display
the samples stored in the RAM. Word recognizer is used to produce a trigger
signal. It compares the binary word on the I/P signal lines with a word you set
with switches or a keyboard. When the two words match, the word recognizer
sends out a trigger signal.
14
ASSEMBLER DIRECTIVES
Assembly language supports a number of statements that enables to
control the way in which a program assembles and lists. These are called
Assembler Directives. They set only during the assembly of program and
generates no machine executable code.
2. Assume Directive
It tells the assembler which logical segment to use for each of these
physical segments; code segment, data segment, stack segment & extra
segment; at a given time.
15
3. EQU directive
It assigns names to be used in a program.
5. DUP directive
It can be used to initialize several locations and to assign value to these
locations.
It decrements the stack pointer by two and copies a word from some
source to the location in the stack where the SP ( Stack Pointer) points.
Eg: PUSH CX
PUSH BX
PUSH NEXT [BX]
It copies a word from the stack location pointed by the stack pointer to a
destination and increment it by two.
Eg: POP CX
POP BX
POP NEXT [BX]
ARITHMETIC INSTRUCTIONS:
A) Addition Instructions
# ADD/DC
# OR [ OR destination, source ]
AND’s the contents of a source byte or word with the contents of the
specified destination word.
SHIFT INSTRUCTIONS:
Shifts each bit in the specified destination to the left and 0 is stored at LSB
position.
Shifts each bit in the specified destination to the right and 0 is stored at
MSB. LSB shifted to carry flag.
Shifts each bit in the specified destination source number of bits positions
to the right.
ROTATE INSTRUCTIONS:
Rotates all bits in the specified byte or word to the left some number of bit
position.
Rotates all of the bits ina specified byte or word to the left some number of
bit positions.
19
Rotates all of the bits in a specified word or byte some number of bit
positions to the left along with the carry flag.
INTERRUPTS IN 8086
Any program in 8086 can be interrupted by some external signal or by a
special instruction in the program. When an Interrupt is implied, the Micro
Processor stops the execution of its current program and calls the procedure
which service the interrupt. An instruction at the end of the interrupt of interrupt
service procedure, returns execution to the interrupted program.
These interrupts can come from any of these three sources. One source is
an EXTERNAL signal applied to the non-maskable interrupt input pin or to the
interrupt input pin. This is termed as Hardware Interrupt. The second source is
execution of the interrupt instruction, INT; which is referred as software
interrupt. The third source of interrupt is some error condition produced in the
8086 by the execution of an instruction; like for example ‘divide by zero’
interrupt.
Types of Interrupts:
There are five basic types of interrupts available in 8086 Micro Processor. These
are as follows:
It is classified as follows:
Note : (1) Vpp and PGM pin is only for PROM; not for RAM
(2) WR pin is for RAM.
1) Address lines
Number of address lines depends upon size of the memory.
2) Data bus
Data bus depends upon, data bits of memory. Standard memory
data bits available are 1, 4 and 8.
4) WR [ Write Signal ]
This signal is active LOW. Whenever we want to write into memory.
7) PGM [ Program ]
Whenever we program the chip, PGM = 0.
Whenever we verify the operation, PGM = 1.
It is of two types:
a) I/O mapped I/O
For 62K IO addresses of 8086. 8086 offers two ways of addressing the
IO. These are as follows:
Direct addressing.
Indirect addressing.