8086 Architecture
8086 Architecture
microprocessor.
CS Register: CS holds the base (Segment) address for the Code Segment.
All programs are stored in the Code Segment. It is multiplied by 10H (16d),
to give the 20-bit physical address of the Code Segment. CS register cannot
be modified by executing any instruction except branch instructions.
DS Register: DS holds the base (Segment) address for the Data Segment. It
is multiplied by 10H (16d), to give the 20-bit physical address of the Data
Segment. Eg: If DS = 4321H then DS × 10H = 43210H è Starting address of
Data Segment.
SS Register: SS holds the base (Segment) address for the Stack Segment. It
is multiplied by 10H (16d), to give the 20-bit physical address of the Stack
Segment.
ES Register: ES holds the base (Segment) address for the Extra Segment. It
is multiplied by 10H (16d), to give the 20-bit physical address of the Extra
Segment.
Instruction Pointer (IP register): It is a 16-bit register. It holds offset of the next
instruction in the Code Segment. Address of the next instruction is calculated as CS x 10H
+ IP. IP is incremented after every instruction byte is fetched. IP gets a new value whenever
a branch occurs.
Pipelining: It is a 6-byte FIFO RAM used to implement Pipelining. Fetching the next
instruction while executing the current instruction is called Pipelining. BIU fetches the
next “six instruction-bytes” from the Code Segment and stores it into the queue.
Execution Unit (EU) removes instructions from the queue and executes them.
It fetches instructions from the Queue in BIU, decodes and executes them.
It performs arithmetic, logic and internal data transfer operations. It sends request
signals to the BIU to access the external module. It operates in synchronization
with T-States (clock cycles).
Stack Pointer (SP 16-Bits): It is holds offset address of the top of the Stack.
Stack is a set of memory locations operating in LIFO manner. SP is used with the
SS Register to calculate physical address for the Stack Segment. It used during
instructions like PUSH, POP, CALL, RET etc. During PUSH instruction, SP is
decremented by 2 and during POP it is incremented by 2.
Base Pointer (BP 16-Bits): It holds the offset address of any location in the
stack segment. It is used to access random locations of the stack.
Source Index (SI 16-Bits): It is normally used to hold the offset address for
Data segment but can also be used for other segments using Segment Overriding.
It holds offset address of source data in Data Segment, during String Operations.
c) ALU (16-Bits): It has a 16-bit ALU. It performs 8 and 16-bit arithmetic and logic
operations.
d) Instruction Register and Instruction Decoder (Present inside the Control Unit): The
EU fetches an opcode from the queue into the Instruction Register. The Instruction
Decoder decodes it and sends the information to the control circuit for execution.
What are the advantages of memory segmentation of
8086.
1. It allows the memory addressing capacity to be 1 Mbyte even though the address
associated with individual instruction is only 16-bit.
2. It allows instruction code, data, stack, and portion of program to be more than 64
KB long by using more than one code, data, stack segment, and extra segment.
3. It facilitates use of separate memory areas for program, data and stack.
4. It permits a program or its data to be put in different areas of memory, each time
the program is executed i.e. program can be relocated which is very useful in
multiprogramming.
Code segment register (CS): is used for addressing memory location in the
code segment of the memory, where the executable program is stored.
Data segment register (DS): points to the data segment of the memory
where the data is stored.
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 segment of memory which is used to
store stack data.
The number of address lines in 8086 is 20, 8086 BIU will send 20bit address, so as
to access one of the 1MB memory locations. The four segment registers actually
contain the upper 16 bits of the starting addresses of the four memory segments of
64 KB each with which the 8086 is working at that instant of time. A segment is a
logical unit of memory that may be up to 64 kilobytes long. Each segment is made
up of contiguous memory locations. It is an independent, separately addressable
unit. Starting address will always be changing. It will not be fixed.
Note that the 8086 does not work the whole 1MB memory at any given time.
However, it works only with four 64KB segments within the whole 1MB memory.
Below is the one way of positioning four 64 kilobyte segments within the 1M byte
memory space of an 8086.
Types Of Segmentation –