Module 2 Mic
Module 2 Mic
8086 microprocessor
Intel 8086 FEATURES
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.
The Clock speed of this microprocessor is 3 MHz. The Clock speed of this microprocessor v
between 5, 8 and 10 MHz for different versions.
8085 microprocessor does not support memory 8086 microprocessor supports memory segmenta
segmentation.
In 8085, only one processor is used. In 8086, more than one processor is used
additional external processor can also be employe
It contains less number of transistors compare to 8086 It contains more number of transistors compa
microprocessor. It contains about 6500 transistor. 8085 microprocessor. It contains about 29000 in s
Architecture of 8086
The following diagram depicts the architecture of a 8086 Microprocessor −
EU (Execution Unit)
Execution unit gives instructions to BIU stating from where to fetch the data and then decode
and execute those instructions. Its function is to control operations on data using the
instruction decoder & ALU. EU has no direct connection with system buses as shown in the
above figure, it performs operations over data through BIU.
Let us now discuss the functional parts of 8086 microprocessors.
ALU
It handles all arithmetic and logical operations, like +, −, ×, /, OR, AND, NOT operations.
Flag Register
It is a 16-bit register that behaves like a flip-flop, i.e. it changes its status according to the
result stored in the accumulator. It has 9 flags and they are divided into 2 groups −
Conditional Flags and Control Flags.
Conditional Flags
It represents the result of the last arithmetic or logical instruction executed. Following is the
list of conditional flags −
Carry flag − This flag indicates an overflow condition for arithmetic
operations.
Auxiliary flag − When an operation is performed at ALU, it results in a
carry/barrow from lower nibble (i.e. D0 – D3) to upper nibble (i.e. D4 – D7),
then this flag is set, i.e. carry given by D3 bit to D4 is AF flag. The processor
uses this flag to perform binary to BCD conversion.
Parity flag − This flag is used to indicate the parity of the result, i.e. when the
lower order 8-bits of the result contains even number of 1’s, then the Parity
Flag is set. For odd number of 1’s, the Parity Flag is reset.
Zero flag − This flag is set to 1 when the result of arithmetic or logical
operation is zero else it is set to 0.
Sign flag − This flag holds the sign of the result, i.e. when the result of the
operation is negative, then the sign flag is set to 1 else set to 0.
Overflow flag − This flag represents the result when the system capacity is
exceeded.
Control Flags
Control flags controls the operations of the execution unit. Following is the list of control
flags −
Trap flag − It is used for single step control and allows the user to execute one
instruction at a time for debugging. If it is set, then the program can be run in a
single step mode.
Interrupt flag − It is an interrupt enable/disable flag, i.e. used to
allow/prohibit the interruption of a program. It is set to 1 for interrupt enabled
condition and set to 0 for interrupt disabled condition.
Direction flag − It is used in string operation. As the name suggests when it is
set then string bytes are accessed from the higher memory address to the lower
memory address and vice-a-versa.
General purpose register
There are 8 general purpose registers, i.e., AH, AL, BH, BL, CH, CL, DH, and DL. These
registers can be used individually to store 8-bit data and can be used in pairs to store 16bit
data. The valid register pairs are AH and AL, BH and BL, CH and CL, and DH and DL. It is
referred to the AX, BX, CX, and DX respectively.
AX register − It is also known as accumulator register. It is used to store
operands for arithmetic operations.
BX register − It is used as a base register. It is used to store the starting base
address of the memory area within the data segment.
CX register − It is referred to as counter. It is used in loop instruction to store
the loop counter.
DX register − This register is used to hold I/O port address for I/O instruction.
Stack pointer register
It is a 16-bit register, which holds the address from the start of the segment to the memory
location, where a word was most recently stored on the stack.
8086 was the first 16-bit microprocessor available in 40-pin DIP (Dual Inline Package) chip.
Let us now discuss in detail the pin configuration of a 8086 Microprocessor.
0 0 No operation
S 0, S 1, S 2
These are the status signals that provide the status of operation, which is used by the Bus
Controller 8288 to generate memory & I/O control signals. These are available at pin 26, 27,
and 28. Following is the table showing their status −
S2 S1 S0 Status
0 0 0 Interrupt acknowledgement
0 0 1 I/O Read
0 1 0 I/O Write
0 1 1 Halt
1 0 0 Opcode fetch
1 0 1 Memory read
1 1 0 Memory write
1 1 1 Passive
LOCK
When this signal is active, it indicates to the other processors not to ask the CPU to leave the
system bus. It is activated using the LOCK prefix on any instruction and is available at pin
29.
RQ/GT1 and RQ/GT0
These are the Request/Grant signals used by the other processors requesting the CPU to
release the system bus. When the signal is received by CPU, then it sends acknowledgment.
RQ/GT0 has a higher priority than RQ/GT1.
o They may be either used for holding data, variables and intermediate results temporarily or for
other
purposes like a counter or for storing offset address for some particular addressing modes etc.
o These registers are used as segment registers, pointers, index registers or as offset storage
registers
o Segment Registers
o Flag Register
➢ The registers AX, BX, CX and DX are the general purpose 16-bit registers.
➢ AX is used as 16-bit accumulator. The lower 8-bit is designated as AL and higher 8-bit is
designated as AH.AL
➢ All data register can be used as either 16 bit or 8 bit. BX is a 16 bit register, but BL indicates the
lower 8-bitof
➢ The register BX is used as offset storage for forming physical address in case of certain addressing
modes.
➢ The register CX is used default counter in case of string and loop instructions.
a few instructions.
Segment Registers:
➢ The 8086 architecture uses the concept of segmented memory. 8086 able to address a memory
capacity of 1
megabyte and it is byte organized. This 1-megabyte memory is divided into 16 logical segments.
Each segment
➢ Code segment register (CS): is used for addressing memory location in the code segment of the
memory,
➢ Data segment register (DS): points to the data segment of the memory where the data isstored.
➢ Extra Segment Register (ES) : also refers to a segment in the memory which is another data
segment in the
memory.
➢ Stack Segment Register (SS): is used for addressing stack segment of the memory. The stack
segment is that
➢ While addressing any location in the memory bank, the physical address is calculated from two
parts:
➢ The first is segment address, the segment registers contain 16-bit segment base addresses,
related to different
segment.
o BP—Base pointer
o SP—Stack pointer
o SI—Source index
o DI—Destination index
➢ The index registers are used as general purpose registers as well as for offset storage in case of
indexed, base
➢ The register SI is used to store the offset of source data in data segment.
➢ The register DI is used to store the offset of destination in data or extra segment.
➢ The condition code flag register is the lower byte of the 16-bit flag register. The condition code
flag register is
➢ The control flag register is the higher byte of the flag register. It contains three flags namely
direction flag (D),
SF- Sign Flag: This flag is set, when the result of any computation is negative. For signed
computations the sign flag
ZF- Zero Flag: This flag is set, if the result of the computation or comparison performed by the
previous instruction is
zero.
PF- Parity Flag: This flag is set to 1, if the lower byte of the result contains even number of 1’s.
CF- Carry Flag: This flag is set, when there is a carry out of MSB in case of addition or a borrow in
case of subtraction.
AF-Auxilary Carry Flag: This is set, if there is a carry from the lowest nibble, i.e, bit three during
addition, or borrow for
OF- Over flow Flag: This flag is set, if an overflow occurs, i.e, if the result of a signed operation is
large enough to
accommodate in a destination register. The result is of more than 7-bits in size in case of 8-bit signed
operation and
more than 15-bits in size in case of 16-bit sign operations, and then the overflow will be set.
TF- Tarp Flag: If this flag is set, the processor enters the single step execution mode. The processor
executes the
current instruction and the control is transferred to the Trap interrupt service routine.
IF- Interrupt Flag: If this flag is set, the mask able interrupts are recognized by the CPU, otherwise
they are ignored.
D- Direction Flag: This is used by string manipulation instructions. If this flag bit is ‘0’, the string is
processed beginning
from the lowest address to the highest address, i.e., auto incrementing mode. Otherwise, the string
is processed from
the highest address towards the lowest address, i.e., auto decrementing mode
Types Of Segmentation –
1. Overlapping Segment – A segment starts at a particular address
and its maximum size can go up to 64kilobytes. But if another
segment starts along with this 64kilobytes location of the first
segment, then the two are said to be Overlapping Segment.
2. Non-Overlapped Segment – A segment starts at a particular
address and its maximum size can go up to 64kilobytes. But if
another segment starts before this 64kilobytes location of the first
segment, then the two segments are said to be Non-Overlapped
Segment.
Rules of Segmentation Segmentation process follows some rules as
follows:
The starting address of a segment should be such that it can be
evenly divided by 16.
Minimum size of a segment can be 16 bytes and the maximum can
be 64 kB.
What is IO Mapped IO
IO mapped IO uses two separate address spaces for memory locations and for
IO devices. There are two separate control lines for both memory and IO
transfer. In other words, there are different read-write instruction for both IO
and memory. IO read and IO write are for IO transfer whereas memory read and
memory write are for memory transfer. IO mapped IO is also called port-
mapped IO or isolated IO.
They are assigned with 16-bit They are assigned with 8-bit
Address Size address values. address values.
The 8086 has a combined address and data bus commonly referred as a time
multiplexed address and data bus.
The main reason behind multiplexing address and data over the same pins is the
maximum utilisation of processor pins and it facilitates the use of 40 pin standard DIP
package.
The bus can be demultiplexed using a few latches and transreceivers, when ever
required.
Basically, all the processor bus cycles consist of at least four clock cycles. These
are referred to as T1, T2, T3, T4. The address is transmitted by the processor during T1.
It is present on the bus only for one cycle.
The negative edge of this ALE pulse is used to separate the address and the data
or status information. In maximum mode, the status lines S0, S1 and S2 are used to
indicate the type of operation.
Status bits S3 to S7 are multiplexed with higher order address bits and the BHE
signal. Address is valid during T1 while status bits S3 to S7 are valid during T2 through
T4.
Maximum mode
In the maximum mode, the 8086 is operated by strapping the MN/MX pin to
ground.
In this mode, the processor derives the status signal S2, S1, S0. Another chip
called bus controller derives the control signal using this status information .
In the maximum mode, there may be more than one microprocessor in the
system configuration.
Minimum mode
In a minimum mode 8086 system, the microprocessor 8086 is operated in
minimum mode by strapping its MN/MX pin to logic 1.
In this mode, all the control signals are given out by the microprocessor chip
itself.
There is a single microprocessor in the minimum mode system.