Chapter
3.
Instruction
Set
SHLID
3-58
The assembler's relocation feature treats
all
external and relocatable symbols
as
16-bit addresses. When one of
these symbols appears
in
the operand expression of
an
immediate instruction, it must be preceded
by
either the
HIGH
or
LOW
operator to specify which byte of the address
is
to
be
used
in
the evaluation of the expression.
When neither operator
is
pre~ent,
the a'>sembler assumes the
LOW
operator and issues an error message.
Opcode
Operand
SBI
data
The operand
mu'>t
specify the data to
be
subtracted. This data may
be
in
the form
of
a number, an ASCII
constant, the label
of
some perviously defined value, or an expression. The data may not exceed one byte.
Cycles:
S
ta tes:
Addressing:
Flags:
Example:
2
7
immediate
Z,S,P,CY,AC
The following sequence of instruction> enables the program to test the setting
of
the carry flag:
XRA A
581
The exclusive OR with the accumulator clears the accumulator to zeros but
doe,>
not affect the setting of the
carry
flag.
(The
XRA
instruction
is
explained later
in
this chapter.)
When
the carry flag
i'>
OFF,
S81
I yields
a minus one. When the flag
,s
<,et
ON,
SBI
1 yields a minus 'woo
NOTE
This eXJmple
i'>
included for illustrative purposes.
In
most
ca,e" the carry flag can
be
tested more efficiently
by
u'iing
th~
J
NC
in>truction (jump if
no
carry).
STORE H AN D L
DIRECT
SHLD stores a copy
of
the
1_
register
in
the memory location specified
in
bytes two Jnd three of the SHLD
instruction. SHLD then
Stori~S
a copy of the H register
in
the next higher memory location.
Op
co
de
Operand
SHLD address
The address may
be
stated
J'>
it
number, a previously defined label,
or
an
expression.