Download Print this page

ZiLOG Z80 Handbook page 44

Hide thumbs Also See for Z80:

Advertisement

Fig. 4-10 . Register indirect addressing
in LD A ,(BC) instruction.
BYTE 0
LD A, (BC) LOAD ACCUMULATOR
WITH LOCATION POINTED TO BY
CONTENTS OF B, C
10 0 0 0 1 0 1 0
OAH - OPCODE
Examples of the instruction format for this way of addressing are
shown for an LD A, (BC) instruction (Fig. 4-10) and an INC (HL)
instruction (Fig. 4-11). The LD A, (BC) is a one-byte instruction
that loads the contents of the memory location pointed to by regis-
ter pair BC into the A register. No condition codes are affected.
The INC (HL) instruction increments the contents of the memory
location pointed to by the HL register pair by one. The condition
codes are set on the results of the increment.
Fig. 4-11. Register indirect addressing
in INC (HL) instruction.
INC IHLI INCREMENT LOCATION
POINTED TO BY CONTENTS OF HL
BYTE 0
0 0 1 1 0 1 0 0
34H - OPCODE
When register indirect addressing is employed, the register pairs
utilized as pointers hold the memory address as a 16-bit address as
one would expect:
Register
Most Significant
Least Significant
Pair
Byte
Byte
B,C
B
C
D,E
D
E
H,L
H(igh)
L(ow)
SP
SP bits 15-8
SP bits 7-0
Register indirect addressing is primarily used for 8008 compatible
instruction groups such as the 8-Bit Load, 8-Bit Arithmetic and
Logical, and Rotate-Shift groups.
EXTENDED ADDRESSING
The extended addressing instructions hold the address of the data
in the instruction itself, in a fashion similar to many minicomputers
and larger machines. Although this means that the instruction word
is longer, all locations in memory can be addressed directly, and
this mode is many times called direct addressing. The format of
this kind of addressing is shown for an LD A, (NN) instruction and
an LD (NN ),HL instruction.
The LD A, (NN) is a classical computer instruction shown in
Fig. 4-12. Bytes 1 and 2 of the instruction specify a location in
memory. The 8-bit contents of this location are loaded into the
accumulator. No condition codes are affected. Byte 1 of the address
is the least significant byte, while byte 2 is most significant.
47

Advertisement

loading
Need help?

Need help?

Do you have a question about the Z80 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel