8086 Architecture
8086 Architecture
8086 - Architecture
1
21-12-2022
Instruction Queue
To increase the execution speed, BIU fetches as
many as six instruction bytes ahead to time from
memory
All six bytes are then held in first in first out 6 byte
register called instruction queue
Then all bytes have to be given to EU one by one
This pre fetching operation of BIU may be in parallel
with execution operation of EU, which improves the
speed execution of the instruction
2
21-12-2022
3
21-12-2022
4
21-12-2022
10
Flag Register
A 16-bit flag register is a flip-flop which indicates
some condition produced by the execution of an
instruction or controls certain operations of the EU
They are modified automatically by CPU after
mathematical operations
It has 9 flags and they are divided into two
categories:
Conditional Flags
Control Flags
5
21-12-2022
11
Conditional Flags
Conditional flags represent result of last
arithmetic or logical instruction executed
Conditional flags are as follows:
Carry Flag (CF)
Auxiliary Flag (AF)
Parity Flag (PF)
Zero Flag (ZF)
Sign Flag (SF)
Overflow Flag (OF)
12
Control Flags
Control flags are set or reset deliberately to
control the operations of the execution unit
Control flags are as follows:
Trap Flag (TF)
Interrupt Flag (IF)
Direction Flag (DF)
6
21-12-2022
13
This flag is set, when the This flag is set, if the result of This flag is set to 1, if the lower
result of any computation the computation or comparison byte of the result contains even
is negative performed by an instruction is number of 1’s ; for odd number
zero of 1’s set to zero.
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
Trap Flag
Over flow Flag If this flag is set, the processor
This flag is set, if an overflow occurs, i.e, if the result of a signed enters the single step execution
operation is large enough to accommodate in a destination
mode by generating internal
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 interrupts after the execution of
sign operations, then the overflow will be set. each instruction
Direction Flag Interrupt Flag
This is used by string manipulation instructions. If this flag bit
is ‘0’, the string is processed beginning from the lowest Causes the 8086 to recognize
address to the highest address, i.e., auto incrementing mode. external mask interrupts; clearing IF
Otherwise, the string is processed from the highest address disables these interrupts.
towards the lowest address, i.e., auto incrementing mode. 13
14
Trap Flag
Used for on-chip debugging
Setting trap flag puts the microprocessor into single
step mode for debugging
In single stepping, the microprocessor executes a
instruction and enters into single step ISR
If trap flag is set (1), the CPU automatically generates an
internal interrupt after each instruction, allowing a program to
be inspected as it executes instruction by instruction
If trap flag is reset (0), no function is performed
7
21-12-2022
15
Interrupt Flag
16
Directional Flag
This flag is specifically used in string
instructions
If directional flag is set (1), then access the
string data from higher memory location
towards lower memory location
If directional flag is reset (0), then access the
string data from lower memory location
towards higher memory location
8
21-12-2022
17
18
9
21-12-2022
19
20
10
21-12-2022
21
22
11