You are on page 1of 6

8086 Memory Organization

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.
8086 Memory Organization
Each memory location 8086 is a byte while the 8086 is a 16-bits microprocessor?
Many of the 8086 s operation codes are single bytes.
I/O devices like printers, terminals and modems are designed to transfer ASCII encoded data.
The 8086 has a 20-bits address bus, allowing to access a memory of 220 = 1 M locations.

1048575

1048574
5

Data Bus

Segment Registers
Within the 1MB of memory space, the 8086 defines four 64 K memory blocks:
The code segment, stack segment, data segment, extra segment.
Each of these blocks of memory is used differently by the processor.
The code segment holds the program instruction codes.
The data segment holds the data of the program.
The extra segment is an extra data segment (often used for shared data).
The stack segment is used to store interrupt and subroutine return addresses.
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
C2E0h

C2E00
hegme
nt

SS

Stack
Segment

4F98h
4F980h
egment

ES

4A000h

Extra
Segment

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.

At any time only of memory can be accessed by the processor.

Logical and Physical Addresses


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

Physical

Address

Types of memory
Reference
Instruction fetch
Stack operation
General data
String source
String destination
BX used as pointer
BP used as pointer

Default Segment

Alternate Segment

CS
SS
DS
DS
ES
DS
SS

None
None
CS, ES, SS
CS, ES, SS
None
CS, ES, SS
CS, ES, SS

Offset (Logical
Address)
IP
SP
Effective address
SI
DI
Effective address
Effective address

You might also like