HP 3000 III Series Manual page 67

Table of Contents

Advertisement

System/CPU Overview
2-48. ADDRESSING CONVENTIONS
2-49. Memory Addressing
Throughout this manual the terms "displacement",
"effective
ad-
dress ",
"relative
address ",
and
"base" are used in connection
with memory addressing.
These terms are defined as follows:
Displacement is a
positive number
given
in the
instruction
word pointing
to a location plus or minus
that number of lo-
cations from a given reference cell which is also given in the
instr uction word.
Effective address
is always an absolute address.
It mayor
may
not be the location indicated by the displacement number.
The effective
address is
the
final
computed address
after
displacement
calculation,
indirect addressing (if any),
and
indexing (if any) have all been resolved.
Relative address
is the address obtained
by subtracting
the
base fran the effective address.
Base is either the program base (PB) address or the data
base
(DB) address.
The canputer system uses relative addressing almost
exclusively.
Addressing
can be
relative
to
the location
pointed to by the
P Register,
DB Register, Q :R:gister, or S-pointer.
As shown in
figure
2-14,
memory address
instructions (paragraph 2-44)
use
bits 6 through 15 for "mode and displacement" and addressing
can
be
+
or
relative to P or Q, but only + relative to DB and -
relative to S.
The relative
addressing displacement ranges
for
the
various modes
are also shown in figure 2-14.
(It should be
noted that
these ranges apply only to direct,
unindexed addres-
sing.
Indirect addressing and indexing
are discussed separately
in paragraphs 2-50 and 2-53.) The variety of displacement
ranges
is due to the particular coding required to specify a given mode.
For example, only two bits (6 and 7) are required to specify
the
P+,
P-,
and
DB+ relative modes.
This leaves bits 8 through 15
available for
displaceme~t
which,
therefore,
can be any
value
from 0 through 255.
For Q+ relative mode, bits 9 through 15 give
a displacement range fram 0 through 127.
For Q-
and
S-relative
modes,
bits 10 through
15
give
a
displacement
range
from 0
through 63.
In order to provide
the
most
efficient
usage
of
bits,
the mode
codes
are assigned according to
the respective
needs of each displacement range.
Referring to figure 2-14, note that the DB+, Q-, Q+, and S-ranges
can overlap.
Also, DB+, Q+, and S- can
actually
address
words
currently
held in the TOS registers.
P+ and P- addressing modes
are typically used for branches and referencing of literals.
The
DB+ mode is used for referencing global
variables
and
pointers
(i .e.,
indirect
addresses).
The Q+ and Q- modes are useful for
local
variable
storage
and
passing
of
procedure
parameters
respectively.
The S- mode is typically used for accessing param-
2-35

Advertisement

Table of Contents
loading

Table of Contents