Sharp MZ-80B Owner's Manual page 95

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

Advertisement

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
Effective address is (b
5
b
4
b
3
OOOh
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.
r-O_P_C_o_de__,} 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
.
1--0_P_C_o_d_e _ _ _
__
_
_
_ _ _
__
--l }
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

Advertisement

Table of Contents
loading

Table of Contents