8086 Architecture
8086 Architecture
The Execution unit tells the BIU where to fetch instructions or data
from
decodes instructions and
Executes instructions
Control Circuitry:
It directs internal operations.
A decoder in the EU translates instructions fetched from memory
Into series of actions which the EU carries out
SUBTRACT
XOR
INCREMENT
DECREMENT
COMPLEMENT
FLAG REGISTERS:
A flag is a flip flop that indicates some condition produced by
execution of an instruction or controls certain operation of the EU.
It is 16 bit
2. Control flags
Conditional Flags
Carry Flag (CY): This flag indicates an overflow condition for unsigned
integer arithmetic. It is also used in multiple-precision arithmetic.
Parity Flag (PF):This flag is used to indicate the parity of result. If lower
order 8-bits of the result contains even number of 1’s, the Parity Flag is set
and for odd number of 1’s, the Parity flag is reset.
Zero Flag (ZF):It is set; if the result of arithmetic or logical operation is zero
else it is reset.
Sign Flag (SF):In sign magnitude format the sign of number is indicated by
MSB bit. If the result of operation is negative, sign flag is set.
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): It is used for single step control. It allows user to execute one
instruction of a program at a time for debugging. When trap flag is set,
program can be run in single step mode.
Direction Flag (DF):It is used in string operation. If it is set, string bytes are
accessed from higher memory address to lower memory address. When it is
reset, the string bytes are accessed from lower memory address to higher
memory address.
Instruction Queue:
BIU gets upto 6 bytes of next instructions and stores them in the
instruction queue. When EU executes instructions and is ready for its next
instruction, then it simply reads the instruction from this instruction queue
resulting in increased execution speed. Fetching the next instruction while
the current instruction executes is called pipelining.( based on FIFO) .This is
much faster than sending out an addresses to the system memory and
waiting for memory to send back the next instruction byte or bytes .Here
the Queue will be dumped and then reloaded from the new Address.
Segment Register:
The 8086 20 bit addresses So it can address upto 220 in memory ( 1 Mbyte)
but at any instant it can address upto 4 64 KB segments. This four segments
holds the upper 16 bits of the starting address of four memory segments
that the 8086 is working with it at particular time .The BIU always inserts
zeros for the lowest 4 bits of the 20 bit starting address
Example : If the code segment register contains 348AH then the code
segment starts at 348A0H .In other words a 64Kbyte segment can be
located anywhere within 1MByte address Space but the segment will
always starts at an address with zeros in the lowest 4 bits
Stack: is a section of memory set aside to store addresses and data while
subprogram executes is often called segment base . The stack segment
register always holds the upper 16 bit starting address of program stack.
The extra segment register and data segment register is used to hold the
upper 16 bit starting addresses of two memory segments that are used for
data .
Instruction Pointer holds the 16 bit address or offset of the next code byte
within the code segment. The value contained in the Instruction Pointer
called as Offset because the value must be added to the segment base
address in CS to produce the required 20 bit address.
These three registers are used to store temporary storage of data like
general purpose registers .They hold the 16 bit offset data of the data word
in one of the segment
Programming model