Segment Locations In Physical Memory - Intel iAPX 86/88 User Manual

Table of Contents

Advertisement

8086/8088 CPU
FULLY
OVERLAPP~D
1
SEGMENT 0
PARTLY
OVERLAP~I
CONTIGUOUS~ ~
-!
SEGMENTC
I
SEGMENT A
1
SEGMENTB
I
I
1
I
- j
DISJOINT
I
SEGMENT E
LOGICAL
SEGMENTS
""1 _ _ _
-+1 ___ -+-1 ___ -+1 ___ --..17
}~~S~~~L
t
t
t
t
OH
10000H
20000H
30000H
Figure 1·9 Segment Locations in Physical memory
assigned (by software) a base address, which is its starting
location in the memory space. All segments begin on
16-byte memory boundaries. There are no other restric-
tions on segment locations. Segments may be adjacent,
disjoint, partially overlapped, or fully overlapped (see
Figure 1-9). A physical memory location may be mapped
into (contained in) one or more logical segments.
The segment registers point to (contain the base address
values of) the four currently addressable segments (see
Figure 1-10). Programs obtain access to code and data in
other segments by changing the segment registers to point
to the desired segments.
FFFFFH
DATA:
os:
I
B
/---
CODE:
CS:
I
1---,
D
STACK: SS:
I
H
1-,
I
I
EXTRA: ES:
I
h
I
I
I I I
I
L
I
-: 8
I
L_
OH
Figure 1·10 Currently Addressable Segments
1·8
Every application will define and use segments differ-
ently. The currently addressable segments provide a gen-
erous work space; 64k bytes for code, a 64k byte stack
and 128k bytes of data storage. Many applications can
be
written to simply initialize the segment registers and then
forget them. Larger applications should be designed with
careful consideration given to segment definition.
The segment structure of the 8086/8088 memory space
supports modular software design by discouraging huge,
monolithic programs. The segments also can be used to
advantage in many programming situation. Thke, for ex-
ample, the case of an editor for several on-line terminals.
A 64k test buffer (probably an extra segment) could be
assigned to each terminal. A single program could main-
tain all the buffers by simply changing register ES to point
to the buffer of the terminal requiring service.
PHYSICAL ADDRESS GENERATION
In theory, it is useful to think of every memory location as
having two kinds of addresses, physical and logical. A
physical address is the 20-bit value that uniquely identi-
fies each byte location in the megabyte memory space.
Physical addresses range from OR to FFFFFH. All ex-
changes between the CPU and memory components use
this physical address.
Programs deal with logical, rather than physical ad-
dresses and allow code to be developed without prior
knowledge of where the code is to be located in memory
an facilitate dynamic management of memory resources.
A logical address consists of a segment base value and an
offset value. For any given memory location, the segment
base value locates the first byte of the containing segment
and the offset value is the distance, in bytes, of the target
location from the beginning of the segment. Segment base
and offset values are unsigned 16-bit quantities. The
lowest-addressed byte in a segment has an offset of O.
Many different logical addresses can map to the same
210912·001

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Iapx 186/188

Table of Contents