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

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:

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 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.

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
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

You might also like