Chapter 2: 16 Bit Microprocessor: 8086 (24 M) : Salient Features of 8086 Microprocessor
Chapter 2: 16 Bit Microprocessor: 8086 (24 M) : Salient Features of 8086 Microprocessor
[24 M]
8086 has two blocks BIU (Bus Interface Unit) and EU (Execution Unit)
General-purpose Registers:
There are eight 8-bit general-purpose registers: AL, AH, BL, BH, CL, CH, DL and DH.
These can be used for temporary storage of 8-bit data. They can also be used for
storage for 16-bit data words as groups: AX register (AH and AL), BX register (BH
and BL),CX register (CH and CL) and DX register (DH and DL).
Flags:
The 16-bit flag register of 8086 contains 9 active flags (six conditional & 3 control),
other 7 flags are undefined.
Conditional Flags: indicate certain condition that arises during the execution. They are
controlled by the processor.
Control Flags: control certain operations of the processor. They are deliberately
set/reset by the user.
Other Registers:
The Segment Registers- SS, DS, CS and ES, the pointer and index registers -BP,
SP, SI and DI. and the Instruction Pointer (IP) will be discussed along with 8086
memory.
ALU:- ALU is used to perform arithmetic and logical operations
Instruction Pointer(IP) : The Instruction Pointer always points to the next instruction
to be carried out from the program memory. It is 16-bit register.
SI and DI
During the execution of string related instructions, register SI is used to store the offset
of source data/string in data segment while the register DI is used to store the offset
of destination in Data/Extra Segment.
Segment Registers:
BIU has 4 segment registers of 16 bits each i.e CS, DS, SS and ES
-The memory pointers are used to point/address particular memory location in
memory.
Code Segment (CS): CS register is used to address a memory location in the code
segment of the memory where opcode of program is stored.
Data Segment(DS) : DS register points to the data segment of the memory where the
data is stored.
Extra Segment (ES): ES register is used to address the segment which is additional
data segment
Stack Segment (SS) : SS Register is used to point Stack location in stack segment
of the memory and used to store data temporarily on the stack such as the contents
of the CPU Registers which will be required later stage of execution. The default
segment base and offset pair registers are CS: IP and SS: SP
1. 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.
2. Parity flag: This flag is set to 1if the lower byte of the result contains even
numbers of 1s
3. Auxiliary carry flag : this is set if there is a carry from the lowest
nibble, i.e. bit three during addition or borrow for the lowest nibble i.e. bit
three during subtraction.
4. Zero flag: This flag is set if the result of the computation or comparison
performed by previous instruction is zero.
5. Sign flag: This flag is set when the result of any computation is negative. For
signed computations the sign flag equals the MSB of the result.
6. Trap flag: If this flag is set the processor enters the single step execution
mode.
7. Interrupt flag: If this flag is set the maskable interrupts are recognized
by the cpu, otherwise they are ignored.
8. Direction flag: This flag 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, otherwise the string is processed from the highest address
towards lowest address.
9. Overflow flag: This flag is set if an overflow occurs.
̅̅̅̅̅̅̅
𝑩𝑯𝑬 (Active Low)/ S7 (Output): Bus High Enable/Status.
When ̅̅̅̅̅̅
𝐵𝐻𝐸 =0 it indicates that AD15-AD8 are involved in data transfer. ̅̅̅̅̅̅
𝐵𝐻𝐸 & A0 are
used to select even/odd memory banks or I/O address.
S7 always remain high.
̅̅̅̅̅̅
𝐵𝐻𝐸 A0 Indication
0 0 Whole word (16-bits)
0 1 High byte to/from odd address
1 0 Low byte to/from even address
1 1 No selection
READY: This is the acknowledgement from the slower I/O device or memory.When
high it indicates that peripheral device is ready to transfer data.
̅̅̅̅̅̅̅̅
𝑰𝑵𝑻𝑨: Interrupt acknowledge:
When microprocessor receive INTR signal, processor complete m/c cycle and
acknowledge the interrupt by generating this signal.
MN/ ̅̅̅̅̅
𝑴𝑿 MINIMUM / MAXIMUM: This pin signal indicates what mode the processor
is to operate in.
̅̅̅̅
𝑹𝑸/𝑮𝑻̅̅̅̅̅𝟎 , ̅̅̅̅
𝑹𝑸/𝑮𝑻̅̅̅̅̅𝟏 : REQUEST/GRANT:
- These pins are used by other local bus master in maximum mode to gain the
control of local buses at the end of the processors current bus cycle.
- The pins ̅̅̅̅
𝑹𝑸/𝑮𝑻̅̅̅̅̅𝟎 and ̅̅̅̅
𝑹𝑸/𝑮𝑻̅̅̅̅̅𝟏 are bidirectional and ̅̅̅̅
𝑹𝑸/𝑮𝑻̅̅̅̅̅𝟎 have higher priority
̅̅̅̅/𝑮𝑻
than 𝑹𝑸 ̅̅̅̅̅𝟏 .
- After receiving request on these lines, CPU sends acknowledge signal on the same
lines.
RESET (Input) : RESET: It is system reset. When this signal goes high, the
processor enter into reset state.
̅̅̅̅̅̅̅̅:
𝑳𝑶𝑪𝑲
It indicates that other system bus masters are not to allowed to gain control of the
̅̅̅̅̅̅̅̅ = 𝟎 (𝑳𝑶𝑪𝑲
system bus while 𝑳𝑶𝑪𝑲 ̅̅̅̅̅̅̅̅ is LOW).
When it goes low, all interrupts are masked and HOLD request is not granted.
Microprocessor & Programming [MAP-17431] M.S.Karande Page 7 of 12
𝑻𝑬𝑺𝑻 :
- This signal is used to test the status of math co-processor 8087
- This input signal is examined by a ‘WAIT’ instruction.
- If the ̅̅̅̅̅̅̅
𝑇𝐸𝑆𝑇 =0, execution will continue WAIT instruction (i.e NOP instruction), If the
̅̅̅̅̅̅̅
𝑇𝐸𝑆𝑇 =1, the processor will remain in an idle state.
CLK- Clock Input : The clock input provides the basic timing for processor operation
and bus control activity. Its an asymmetric square wave with 33% duty cycle.
Vcc – Power Supply ( +5V D.C.)
GND – Ground
QS1, QS0 (Queue Status) These signals indicate the status of the internal 8086
instruction queue according to the table shown below:
QSI QS0 Status
0 0 No Operation
0 1 First Byte of Op Code from Queue
1 0 Empty the Queue
1 1 Subsequent Byte from Queue
̅̅̅̅̅̅̅
𝑫𝑬𝑵: DATA ENABLE
- This signal informs the transceiver that the microprocessor is ready to send or
receive the data.
- This signal indicates the availability of valid data over the address/data lines.
̅
𝑺0, ̅
𝑺1, ̅
𝑺2: (Status Signals)
These status signals reflect the type of operation being carried out by the processor
and required by the bus controller. Intel 8288 to generate all memory / I/O access
control signals.
̅2
𝑺 ̅1
𝑺 ̅0
𝑺 Status
0 0 0 INTA
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
20 bit Physical
Address
Σ (Adder)
4 8 D1 E – Physical Address
Concepts of Pipelining
- The technique used to enable an instruction to complete with each clock cycle
is called as Pipelining
- Normally, on a non-pipelined processor, nine clock cycles are required for fetch,
decode and execute cycles for the 3 instructions (a)
- But on a pipelined processor, the fetch, decode and execute operations are
performed in parallel only five clock cycles are required to execute the same 3
instructions (b)
F D E F D E F D E F- Fetch
I1 I1 I1 I2 I2 I2 I3 I3 I3 D- Decode
2 2 1
E- Execute
Clock Cycle 2 2
1 2 3 4 25 6 7 8 9
2
F 2
I1 I2 I3 2
1
2
D 2
I1 I2 I3 2
1
2
E I1 I2 I3
1
Pipelined execution of three instructions
- Feature of fetching the next instruction while the current instruction is executing
is called Pipelining which will reduce the execution time. So pipelining improve
the execution speed of the processor.
- In pipelined processor fetch, decode and execute operation are performed
simultaneously or in parallel.
- In 8086, pipelining is implemented by providing 6 byte queue where 6 one byte
instructions can be stored well in advance and then one by one instruction goes
for decoding and execution.
- In this way 8086 perform fetch, decode and execute operation in parallel.