Professional Documents
Culture Documents
8086 Memory Organization PDF
8086 Memory Organization PDF
Segmented Memory
Two types of memory organization are used:
Linear addressing where the entire memory is available to the processor at all the times
( Motorola 68000 family).
Segmented addressing where the memory space is divided into several segments and
the processor is limited to access program instructions and data in specific segments.
The 8086 has a 20-bits address bus, allowing to access a memory of 220 = 1 M locations.
1048575 1048574
5
7 6
5 4
3 2
1 0
Data Bus
Segment Registers
Within the 1MB of memory space, the 8086 defines four 64 K memory blocks:
There are four segment registers CS, DS, ES and SS and each of them defines the starting address
of the corresponding segment.
Each segment register is 16 bits wide while the address bus is 20 bits wide. The BIU takes care of
this by appending four 0s to the low order bits of the segment register.
Segment register 0 0 0 0
Address Bus
Code
Segment
E0000h
egment
CS
E000h
Data
Segment
DS C2E00
hegme
C2E0h nt
SS
Stack
4F98h Segment
4F980h
egment Extra
ES Segment
4A000h
4A00h
Example
Assuming the four segment register contain the values shown in the above figure, calculate the
beginning and ending addresses of the four segments.
Addresses within a segment cab be ranged from address 0 to address FFFFh. This correspond to
the 64K length of the segment. An address within a segment is called an offset or logical
address. For example, logical address 20h in the code segment shown above actually correspond
to the real address E0000h+ 20h= E0020h. this real address is called the physical address.
Physical address is the 20 bits address that being output bus the BIU on the address bus.
Offset
Segment register 0 0 0 0
Adder
Address
Physical
Types of memory Default Segment Alternate Segment Offset (Logical
Reference Address)
Instruction fetch CS None IP
Stack operation SS None SP
General data DS CS, ES, SS Effective address
String source DS CS, ES, SS SI
String destination ES None DI
BX used as pointer DS CS, ES, SS Effective address
BP used as pointer SS CS, ES, SS Effective address