IMMEDIATE ADDRESSING
In the immediate addressing mode, the second or third byte of
the instruction itself is the operand. Immediate addressing is valu-
able when it is necessary to load or perform an arithmetic or logical
operation with constant data. The immediate addressing instructions
ADD A,N and XOR N are examples of this addressing type.
The format of the ADD A,N instruction is shown in Fig. 4-3. The
contents of the A register are added with the contents of the second
Fig. 4-3. Immediate addressing in
ADD A,N instruction. BYTE 0
BYTE 1
byte of the instruction and the result put into the A register. If two
bytes of the ADD A,N instruction were C633H (ADD A,33H) and
the A register contained 80H, 80H and 33H would be added to
produce a result of B3H and this result would be put into the A
register. The condition codes would also be set on the results of
this instruction.
The format of the XOR N instruction is shown in Fig. 4-4. The
contents of the A register are exclusive ORed with the second byte
of the instruction and the result put into the A register. The condi-
tion codes are set on the result of the instruction. If the instruction
were EE35H and the contents of the A register were 33H, 35H and
33H would be exclusive ORed to produce 06H, which would be
put into the A register.
ADD A , N ADD VALUE N TO ACCUMULATOR
1 1 0 0 0 1 1 0
N
C6H • OP CODE
IMMED IATE VALUE
XOR N EXCLUSIVE OR IMMEDIATE AND ACCUMULATOR
BYTE 0
BYTE 1
1 1 1 0 1 1 1 0
EEH - OP CODE
IMMED IATE VALUE
N
Fig. 4-4. Immediate addressing in XOR N instruction.
In general, the immediate addressing mode is used for instruc-
tions in the 8-bit Arithmetic and Logical Group discussed in the
next chapter.
EXTENDED IMMEDIATE ADDRESSING
When the instruction is an immediate kind of instruction, but
16 bits of immediate data are required, the instruction format is
of the "extended" immediate kind. The extended addressing mode
is used in only a few instructions in the 16-Bit Load Group of in-
43
Need help?
Do you have a question about the Z80 and is the answer not in the manual?
Questions and answers