The indexing operation is powerful because many programs must
have the ability to process
tables
or
lists
of data in memory. Ex-
amples of the use of indexing are provided in section II. Instruction
groups using the indexed addressing mode are the 8-Bit Load, 8-Bit
LD IIY + DI, N LOAD LOCATION IIY + DI WITH VALUE N
BYTE 3
BYTE 2
BYTE 1
BYTE 0
1 1 1 1 1 1 0 1
0 0
1 1 0 1 1 0
0 1
0 0 0 0 0 0
N
OP CODE
(M 1003H
D = 40H
EFFECTIVE
ADDRESS - 1040H
D=40H
VALUE TO BE STORED
Fig. 4-18. Indexed addressing example.
Arithmetic and Logical, Rotate and Shift, and Bit, Set, Reset, and
Test Groups.
BIT ADDRESSING
The last addressing group is the bit addressing group. Bit address-
ing is used in conjunction with the previous addressing modes to
provide testing, setting, or resetting any one of the 8-bits in an
operand. These operations would have to be performed by as many
as three instructions in the 8080 or other computers. An example
of this is provided for the SET B, (IX + D) instruction shown in
Fig. 4-19. The SET instruction sets a specified bit, and in this case
the address of the byte containing the bit to be set is given by
(IX + D), an indexed addressing operation. The bit specified in the
B field of the instruction will be set after the instruction has been
executed. No condition codes are affected. The bit to be set is as
follows:
B Field Bit to be Set
000 XXXXXXX 1
001 XXXXXX 1 X
010 XXXXX 1 XX
Oil XXXX 1 XXX
100 XXXIXXXX
101 XXIXXXXX
110 X 1 XXXXXX
111 1XXXXXXX
Other examples of the bit addressing mode are shown in Fig. 4-20,
which shows the "before" and "after" condition for various SET B,R
instructions specifying a bit set for CPU register C.
51