Logical And Physical Addresses - Intel iAPX 86/88 User Manual

Table of Contents

Advertisement

8086/8088 CPU
PHYSICAL
ADDRESS
r
t
. .
r
'r
2
2
OFFSET
2
C4H
C3H
C2H
C1H
COH
BFH
BEH
BDH
BCH
BBH
BAH
B9H
B8H
B7H
B6H
B5H
B4H
B3H
B2H
B1H
BOH
LOGICAL
ADDRESSES
...
SEGMENT
BASE
'- SEGMENT
BASE
(3H)
.. I
2
2
2
2
2
2
2
OFFSET
2
(13H)
2
2
2
2
2
2
2
2
2
2
"
"
Figure 1-11 Logical and Physical Addresses
physical location. In the example (see Figure 1-11) physi-
cal memory location 2C3H is contained in two different
overlapping segments, one beginning at 2BOH and the
other at 2COH.
Whenever the BIU accesses memory -to fetch an instruc-
tion or to obtain or store a variable -it generates a physical
address from a logical address. This is done by shifting
the segment base value four bit positions and adding the
offset as illustrated in Figure 1-12. Note that this addition
process provides for modulo 64k addressing (addresses
wrap around from the end of a segment to the beginning
of the same segment).
The BIU obtains the logical address of a memory location
from different sources, depending on the type of refer-
ence that is being made (see Table 1-2). Instructions are
always fetched from the current code segment; IP con-
tains the offset of the target instruction from the begin-
ning of the segment. Stack instructions always operate on
the current stack segment; SP contains the offset of the
top of the stack. Most variables (memory operands) are
assumed to reside in the current data segment, although a
program can instruct the BIU to access a variable in one
of the other currently addressable segments. The offset of
1-9
a memory variable is calculated by the EU. This calcula-
tion is based on the addressing mode specified in the in-
struction; the result is called the operand's effective
address (EA).
Strings are addressed differently than other variables. The
source operand of a string instruction is assumed to lie in
the current data segment, but another currently address-
able segment may be specified. Its offset is taken from
register SI, the source index register. The destination op-
erand of a string instruction always resides in the current
extra segment; its offset is taken from 01, the destination
index register. The string instructions automatically ad-
just SI and DI as they process the strings one byte or word
at a time.
When register BP, the base pointer register, is designated
as a base register in an instruction, the variable is assumed
to reside in the current stack segment. Therefore, register
BP provides a convenient way to address data on the
stack. However, BP can also be used to access data in any
of the other currently addressable segments.
The BIU's segment assumptions are a convenience to pro-
grammers in most cases. However, it is possible for a pro-
grammer to explicitly direct the BIU to access a variable
in any of the currently addressable segments. (The only
210912-001

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Iapx 186/188

Table of Contents