86
Modified Page Zero Addressing. The Z-80A 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.
OP
Code one byte
b7
bo
Effective address
is
(b
5
b
4
b
3
000)
2
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.
f-
O_P_C_o
_de
-----1
}
Jump
relative (one byte
OP
code)
Operand 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.
f---
O_P_C_o_d_e
_ _
_____
______
--1 } one or two bytes
Low
Order Address or Low order operand
High
Order Address
or
High order operand
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
that
the two bytes
of
address
nn
are used
as
a
pointer
to
a memory location. The use
of
the parentheses always 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 1200.
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 }
f------
---
-----1 two byte
OP
code
OP
Code
Displacement
Operand added
to
index register
to
form a pointer
to
memory