U3 8086 Microprocessor
U3 8086 Microprocessor
Intel 8086
o Intel 8086 microprocessor is the enhanced version of Intel 8085 microprocessor. It was designed by
Intel in 1976.
o The 8086 microprocessor is a16-bit, N-channel, HMOS microprocessor. Where the HMOS is used
for "High-speed Metal Oxide Semiconductor".
o Intel 8086 is built on a single semiconductor chip and packaged in a 40-pin IC package. The type of
package is DIP (Dual Inline Package).
o Intel 8086 uses 20 address lines and 16 data- lines. It can directly address up to 2 20 = 1 Mbyte of
memory.
o It consists of a powerful instruction set, which provides operation like division and multiplication
very quickly.
o 8086 is designed to operate in two modes, i.e., Minimum and Maximum mode.
AD0-AD15 (Address Data Bus): Bidirectional address/data lines. These are low order address bus. They are
multiplexed with data.
When these lines are used to transmit memory address, the symbol A is used instead of AD, for example,
A0- A15.
A16 - A19 (Output): High order address lines. These are multiplexed with status signals.
A16/S3, A17/S4: A16 and A17 are multiplexed with segment identifier signals S3 and S4.
A18/S5: A18 is multiplexed with interrupt status S5.
A19/S6: A19 is multiplexed with status signal S6.
BHE/S7 (Output): Bus High Enable/Status. During T1, it is low. It enables the data onto the most
significant half of data bus, D8-D15. 8-bit device connected to upper half of the data bus use BHE signal. It
is multiplexed with status signal S7. S7 signal is available during T3 and T4.
RD (Read): For read operation. It is an output signal. It is active when LOW.
Ready (Input): The addressed memory or I/O sends acknowledgment through this pin. When HIGH, it
denotes that the peripheral is ready to transfer data.
RESET (Input): System reset. The signal is active HIGH.
CLK (input): Clock 5, 8 or 10 MHz.
INTR: Interrupt Request.
NMI (Input): Non-maskable interrupt request.
TEST (Input): Wait for test control. When LOW the microprocessor continues execution otherwise waits.
VCC: Power supply +5V dc.
GND: Ground.
Operating Modes of 8086
There are two operating modes of operation for Intel 8086, namely the minimum mode and the maximum
mode.
When only one 8086 CPU is to be used in a microprocessor system, the 8086 is used in the Minimum
mode of operation.
In a multiprocessor system 8086 operates in the Maximum mode.
QS1, QS0 (Output): Pin numbers 24, 25, Instruction Queue Status. Logics are given below:
S0, S1, S2 (Output): Pin numbers 26, 27, 28 Status Signals. These signals are connected to the bus
controller of Intel 8288. This bus controller generates memory and I/O access control signals. Logics for
status signal are given below:
S2 S1 S0 Operation
0 0 0 Interrupt acknowledgement
0 0 1 Read data from I/O port
0 1 0 Write data from I/O port
0 1 1 Halt
1 0 0 Opcode fetch
1 0 1 Memory read
1 1 0 Memory write
1 1 1 Passive state
LOCK (Output): Pin no. 29. It is an active LOW signal. When this signal is LOW, all interrupts are masked
and no HOLD request is granted. In a multiprocessor system all other processors are informed through this
signal that they should not ask the CPU for relinquishing the bus control.
RG/GT1, RQ/GT0 (Bidirectional): Pin numbers 30, 31, Local Bus Priority Control. Other processors ask the
CPU by these lines to release the local bus.
In the maximum mode of operation signals WR, ALE, DEN, DT/R etc. are not available directly from the
processor. These signals are available from the controller 8288.
The BIU:
o Handles transfer of data and addresses,
o Fetches instruction codes, stores fetched instruction codes in first-in-first-out register set called
a queue,
o Reads data from memory and I/O devices,
o Writes data to memory and I/O devices,
o It relocates addresses of operands since it gets un-relocated operand addresses from EU. The EU
tells the BIU from where to fetch instructions or where to read data.
o The EU receives opcode of an instruction from the queue, decodes it and then executes it. While
Execution, unit decodes or executes an instruction, then the BIU fetches instruction codes from the
memory and stores them in the queue.
o The BIU and EU operate in parallel independently. This makes processing faster.
o General purpose registers, stack pointer, base pointer and index registers, ALU, flag registers
(FLAGS), instruction decoder and timing and control unit constitute execution unit (EU). Let's
discuss them:
o General Purpose Registers: There are four 16-bit general purpose registers: AX (Accumulator
Register), BX (Base Register), CX (Counter) and DX. Each of these 16-bit registers are further
subdivided into 8-bit registers as shown below:
Microprocessor responds to these interrupts with an interrupt service routine (ISR), which is a short
program or subroutine to instruct the microprocessor on how to handle the interrupt.
Hardware Interrupts
Hardware interrupts are that type of interrupt which are caused by any peripheral device by sending a
signal through a specified pin to the microprocessor.
The Intel 8086 has two hardware interrupt pins:
o NMI (Non-Maskbale Interrupt)
o INTR (Interrupt Request) Maskable Interrupt.
NMI: NMI is a single Non-Maskable Interrupt having higher priority than the maskable interrupt.
o It cannot be disabled (masked) by user using software.
o It is used by the processor to handle emergency conditions.
For example: It can be used to save program and data in case of power failure. An external
electronic circuitry is used to detect power failure, and to send an interrupt signal to 8086 through
NMI line.
INTR: The INTR is a maskable interrupt. It can be enabled/disabled using interrupt flag (IF). After receiving
INTR from external device, the 8086 acknowledges through INTA signal.
It executes two consecutive interrupt acknowledge bus cycles.
Software Interrupt
A microprocessor can also be interrupted by internal abnormal conditions such as overflow; division by
zero; etc. A programmer can also interrupt microprocessor by inserting INT instruction at the desired point
in the program while debugging a program. Such an interrupt is called a software interrupt.
The interrupt caused by an internal abnormal conditions also came under the heading of software
interrupt.
Example of software interrupts are:
o TYPE 0 (division by zero)
o TYPE 1 (single step execution for debugging a program)
o TYPE 2 represents NMI (power failure condition)
o TYPE 3 (break point interrupt)
o TYPE 4 (overflow interrupt)
The 8086 microprocessors have 8 addressing modes. Two addressing modes have been provided for
instructions which operate on register or immediate data.
Register Addressing: In register addressing, the operand is placed in one of the 16-bit or 8-bit general
purpose registers.
Example
o MOV AX, CX
o ADD AL, BL
o ADD CX, DX
Immediate Addressing: In immediate addressing, the operand is specified in the instruction itself.
Example
o MOV AL, 35H
o MOV BX, 0301H
o MOV [0401], 3598H
o ADD AX, 4836H
The remaining 6 addressing modes specify the location of an operand which is placed in a memory.
Direct Addressing: In direct addressing mode, the operand?s offset is given in the instruction as an 8-bit or
16-bit displacement element.
Example
o ADD AL, [0301]
The instruction adds the content of the offset address 0301 to AL. the operand is placed at the given offset
(0301) within the data segment DS.
Register Indirect Addressing: The operand's offset is placed in any one of the registers BX, BP, SI or DI as
specified in the instruction.
Example
o MOV AX, [BX]
It moves the contents of memory locations addressed by the register BX to the register AX.
Based Addressing: The operand's offset is the sum of an 8-bit or 16-bit displacement and the contents of
the base register BX or BP. BX is used as base register for data segment, and the BP is used as a base
register for stack segment.
Example
o MOV AL, [BX+05]; an example of 8-bit displacement.
o MOV AL, [BX + 1346H]; example of 16-bit displacement.
Indexed Addressing: The offset of an operand is the sum of the content of an index register SI or DI and an
8-bit or 16-bit displacement.
Example
o MOV AX, [SI + 05]; 8-bit displacement.
o MOV AX, [SI + 1528H]; 16-bit displacement.
Based Indexed Addressing: The offset of operand is the sum of the content of a base register BX or BP and
an index register SI or DI.
Effective Address (Offset) = [BX or BP] + [SI or DI]
Here, BX is used for a base register for data segment, and BP is used as a base register for stack segment.
Example
o ADD AX, [BX + SI]
o MOV CX, [BX + SI]
Based Indexed with Displacement: In this mode of addressing, the operand's offset is given by:
Effective Address (Offset) = [BX or BP] + [SI or DI] + 8-bit or 16-bit displacement
Example
o MOV AX, [BX + SI + 05]; 8-bit displacement
o MOV AX, [BX + SI + 1235H]; 16-bit displacement
Pipelining in 8086 Microprocessors
Any computer or machine works according to some instructions. These instructions are responsible for all
the work that the machine does. But how does a machine work to understand and execute that
instruction?
In the 8086 microprocessors, the instructions are executed in 4 steps which are listed as follows:
1. Fetch the instruction
2. Decode the instruction
3. Fetch the operands
4. Execution of the instruction
Any instruction that is provided to the 8086 microprocessor is executed by following the above-mentioned
steps. For each instruction, all these steps are performed, i.e. if there are 3 instructions to be executed,
then all these steps will be performed 3 times each.
Suppose, these instructions are executed sequentially, and it takes the 1-time unit for each step to run. So,
it would take 12-time units (3 X 4) to execute these instructions.
It seems less as the number of instructions is less, but a processor has o deal with a very large number of
instructions, and so it should process fast to be efficient. In the 8086 microprocessor, this problem was
solved by the method of pipelining.
Both these units work mutually exclusive to each other. Due to this, the parallel processing of instructions
can be implied in the 8086 microprocessor, because these units are responsible for alternate steps of
instruction execution. That is,
Fetch instruction: Done by BIU
Decode Instruction: Done by EU
Fetch Operands: Done by BIU
Execution: Done by EU
So, while the instruction completes its first step and goes to the second step that is handled by the EU, the
BIU is idle, and in that time, the next instruction is sent to BIU. By doing so, the parallel processing of
instructions is implemented, and this concept is known as pipelining.