8086 Microprocessor
8086 Microprocessor
&
8086 Architecture
BY
P. PRASANTH KUMAR
ASSISTANT PROFESSOR
EEE DEPARTMENT
GRIET
Contents
Introduction to Microprocessor
Register Organization
Memory Segmentation
Programming Model
Memory Address
Timing Diagrams
Interrupts of 8086
P Prasanth Kumar
S.No Course Outcomes
P Prasanth Kumar
Definition of the Microprocessor
The microprocessor is a programmable device
that takes in numbers, performs on them
arithmetic or logical operations according to the
program stored in memory and then produces
other numbers as a result.
P Prasanth Kumar
Lets expand each of the underlined words:
Programmable device:
• The microprocessor can perform different sets of operations on
the data it receives depending on the sequence of instructions
supplied in the given program.
P Prasanth Kumar
Numbers:
The microprocessor has a very narrow view on life. It
only understands binary numbers.
P Prasanth Kumar
Features of 8086 Microprocessor
It is a 16-bit μp.
8086 has a 20 bit address bus can access up to 220
memory locations (1 MB).
P Prasanth Kumar
Internal Architecture of 8086
P Prasanth Kumar
Architecture of 8086
The 8086 CPU logic has been partitioned into two
functional units namely
P Prasanth Kumar
The BIU sends out addresses, fetches instructions from memory,
reads data from ports and memory, and writes data to ports and
memory.
P Prasanth Kumar
• The Execution Unit (EU) has
¥ Control unit
¥ Instruction decoder
¥ General registers
¥ Pointers
¥ Index registers
¥ Flag register
P Prasanth Kumar
Execution Unit (EU)
• Control unit is responsible for the co-ordination of all
other units of the processor
P Prasanth Kumar
Execution Unit - Registers
• General registers are used for temporary storage and
manipulation of data and instructions.
• Base register consists of two 8-bit registers BL and BH, which can
be combined together and used as a 16-bit register BX
• Data register consists of two 8-bit registers DL and DH, which can
be combined together and used as a 16-bit register DX
P Prasanth Kumar
Pointers:
To get 20-bit physical address one or more pointer (SP and BP) or
index registers ( SI and DI) are associated with each segment
register.
Stack pointer (SP) and Base Pointer (BP) are used to access data in
the stack segment.
Stack Pointer:
• Stack Pointer (SP) is a 16-bit register pointing to program stack.
P Prasanth Kumar
Base Pointer (BP):
Base Pointer (BP) is a 16-bit register pointing to data in stack
segment. BP register is usually used for based, based indexed or
register indirect addressing.
P Prasanth Kumar
Index Registers:
Source Index Register (SI) and Destination Index Registers (DI) are
used in indexed addressing.
P Prasanth Kumar
Flag Register
Auxiliary Carry Flag Carry Flag
Sign Flag
This is set, if there is a carry from the lowest nibble, This flag is set, when there is a
This flag is set, when the result
i.e, bit three during addition, or borrow for the lowest carry out of MSB in case of addition
of any computation is negative
nibble, i.e, bit three, during subtraction. or a borrow in case of subtraction.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
OF DF IF TF SF ZF AF PF CF
Interrupt Flag
P Prasanth Kumar
Bus Interface Unit (BIU)
Contains
• 6-byte Instruction Queue (Q)
• The Segment Registers (CS, DS, ES, SS).
• The Instruction Pointer (IP).
• The Address Summing block (Σ)
P Prasanth Kumar
Queue (Q)
• To speed up program execution, the BIU fetches a six instruction
bytes ahead of time from the memory.
P Prasanth Kumar
Segment Registers
• In 8086/88 the processors have 4 segments registers
– Code Segment register (CS)
– Data Segment register (DS)
– Extra Segment register (ES)
– Stack Segment (SS) register.
P Prasanth Kumar
Segment Registers
• Code Segment (CS) register is a 16-bit register containing
address of 64 KB segment with processor instructions
P Prasanth Kumar
Physical Memory Organization
The 8086 processor provides a 20-bit address to access
any location of the 1 MB memory space.
The memory is organized as a linear array of 1 million
bytes, addressed as 00000(H) to FFFFF(H).
Physically, the memory is organized as a high bank
(D15 - D8) and a low bank (D7 –D0) of 512 K 8-bitbytes
addressed in parallel by the processor's address lines A19 -
A1.
P Prasanth Kumar
Physical Memory Organization
Byte data with even addresses is transferred on the D7 – D0
bus lines while odd addressed byte data (A0 HIGH) is
transferred on the D15-D8 bus lines.
The processor provides two enable signals, BHE and A0, to
selectively allow reading from or writing into either an odd byte
location, even byte location, or both.
BHE A0 TYPE OF DATA TRANSFER AND BANK SELECTION
P Prasanth Kumar
Segmentation
Segmentation is the process in which the main memory
of computer is divided into different segments and each
segment has its own base address.
P Prasanth Kumar
Types of Segmentation
Overlapping Segment:
A segment starts at a particular address and its maximum
size can go up to 64 Kbytes. But if another segment starts
along this 64 Kbytes location of the first segment, the two
segments are said to be overlapping segment.
The area of memory from the start of the second segment
to the possible end of the first segment is called as
overlapped segment.
P Prasanth Kumar
Non-Overlapped Segment:
A segment starts at a particular address and its maximum
size can go up to 64 Kbytes. But if another segment starts
before this 64 Kbytes location of the first segment, the two
segments are said to be Non- overlapping segment.
P Prasanth Kumar
Memory Segmentation Physical Memory
00000
The memory in an 8086/88 based
system is organized as segmented
Code segment (64KB)
memory.
The CPU 8086 is able to address
1 MB
Data segment (64KB)
1Mbyte of memory.
Extra segment (64KB)
The Complete physically available
Stack segment (64KB)
memory may be divided into a
number of logical segments.
FFFFF
P Prasanth Kumar
• The size of each segment is 64 KB
P Prasanth Kumar
P Prasanth Kumar
• The following examples shows the CS:IP scheme of
address formation:
34BA0(CS)+
8AB4(IP)
3 D 6 5 4 (next address)
44B9F
Segment and Address register combination
• CS:IP
• SS:SP SS:BP
P Prasanth Kumar
Pin Diagram of 8086
Common signals AD0-AD15 (Bidirectional)
Address/Data bus
MN/ MX
MINIMUM / MAXIMUM
This pin signal indicates what mode the
processor is to operate in.
READY
This is the acknowledgement from the
slow device or memory that they have
completed the data transfer.
The signal made available by the devices
is synchronized by the 8284A clock
generator to provide ready input to the
8086.
The signal is active high.
Common signals
RESET (Input)
Causes the processor to immediately terminate
its present activity.
The signal must be active HIGH for at least four
clock cycles.
GND (Output)
GROUND
CLK
The clock input provides the basic timing
for processor operation and bus control
activity. Its an asymmetric square wave
with 33% duty cycle.
Common signals INTR Interrupt Request
This is a triggered input. This is sampled during
the last clock cycles of each instruction to
determine the availability of the request.
If any interrupt request is pending, the processor
enters the interrupt acknowledge cycle.
This signal is active high and internally
synchronized.
NMI (Non-Maskable
Interrupt)
It is an edge triggered input which causes a
type 2 interrupt.
NMI is not maskable internally by software.
Vcc
Power Supply (+5V DC)
Min/Max Pins
Maximum mode
• It contains
– General Purpose Registers
– Segment Registers
– Flag Register
P Prasanth Kumar
Register Organisation of 8086
P Prasanth Kumar
Instruction Set of 8086
The instruction set of 8086 is divided into 8 major groups
• Data Movement Instructions
• String Instructions
• Interrupt Instructions
P Prasanth Kumar
Timing Diagrams of
8086
P Prasanth Kumar
Read Operation in Minimum Mode
P Prasanth Kumar
Write Operation in Minimum Mode
P Prasanth Kumar
Read Operation in Maximum Mode
P Prasanth Kumar
Write Operation in Maximum Mode
P Prasanth Kumar
Interrupts of 8086
P Prasanth Kumar
Interrupts
The event that causes interruption is called Interrupt and the
special routine executed to service the interrupt is called
Interrupt Service Routine/Procedure.
Normal Program can be interrupted by three ways:
By External Signal
By a special instruction in the program
By the occurrence of some condition.
P Prasanth Kumar
1. It decrements stack pointer by 2 and pushes flag register on the stack.
2. It disables the INTR interrupt input by clearing the interrupt flag in flag
register.
3. It resets the Trap flag in Flag register.
4. It decrements stack pointer by 2 and pushes current Code Segment (CS)
Register contents on the stack.
5. It decrements stack pointer by 2 and pushes current Instruction Pointer
(IP) contents on the stack.
6. It does an indirect far jump at the start of the procedure by loading CS and
IP values for the start of the Interrupt Service Routine (ISR).
An IRET instruction at the end of the Interrupt Service Procedure returns
execution to the Main Program.
P Prasanth Kumar