Sharp MZ-80A Owner's Manual page 176

Hide thumbs Also See for MZ-80A:
Table of Contents

Advertisement

186
Modified Page Zero Addressing. The
Z-80
has
a special single
byte
CALL
instruction
to
any of 8 locations
in page
zero of
memory. This instruction (which is referred
to
as a
restart) sets
the
PC
to
an
effective
address
in
page zero. The
value of this instruction is that
it
allows
a single byte
to
specify a complete 16-bit address where commonly called sub¬
routines
are
located,
thus
saving
memory
space.
I
-
1
OP Code
one byte
b?
b0
Effective address
is (bs
b4
b3
000)5
Relative
Addressing. Relative
addressing uses one byte of data following the OP code
to
specify
a
displacement from
the existing program
to
which a program
jump
can occur. This displacement
is
a signed two's complement number that
is
added
to
the
address of the OP code
of the
following
instruction.
OP Code
Operand
Jump
relative (one byte OP code)
8-bit
two's
complement displacement added
to
Address (A+2)
The value of relative addressing is that it allows jumps
to
nearby
locations while
only requiring
two
bytes of
memory
space. For
most
programs, relative
jumps are by far the
most prevalent type
of
jump due to the proximity of related
program segments. Thus,
these
instructions
can significantly reduce
memory space
requirements.
The signal displace¬
ment
can range
between
+127 and
128 from A+2.
This allows for a total displacement
of +129
to
—126 from the
jump
relative OP code address. Another
major advantage is that it allows
for relocatable code.
Extended Addressing. Extended Addressing provides for
two
bytes (16
bits)
of address
to
be included
in
the instruc¬
tion.
This data
can
be an address
to
which a program can
jump
or
it can be
an
address where
an operand
is
located.
one or
two
bytes
Extended addressing
is
required for a program
to
jump
from
any
location
in memory
to
any other
location,
or
load and
store
data
in
any memory location.
When extended addressing
is
used
to
specify the
source or
destination address of
an
operand, the notation (nn) will
be used to indicate the
content
of memory
at
nn.
where
nn
is
the 16-bit address specified
in
the instruction. This means
l.baJ the
two
bytes
of
address nn
are
used as a
pointer
to a
memory location. The esse
of
the parentheses &tways
means
that the value enclosed within them
is
used as a pointer
to
a memory location.
For
example.
(1200)
refers
to the
contents of memory
at
location 1 200.
OP Code
Low Order Address or Low order
operand
High Order Address or High order operand
Indexed
Addressing. In this type
of addressing, the byte of data following
the
OP code
contains
a displacement which
is
added
to
one
of the
two index
registers
(the
OP code specifies which index
register is
used) to
form a
pointer to
mem¬
ory. The contents of the index
register
are
not altered by
this
operation.
OP
Code
OP
Code
Displacement
two
byte
OP code
Operand added to index
register to
form a pointer
to
memory

Advertisement

Table of Contents
loading

Table of Contents