Chapter
3.
Instruction Set
CC
CM
3-10
bytes, coding
it
in-line would require three hundred bytes. Coded
as
a subroutine, it requires one hundred bytes
plus nine
bytes for the three CALL instructions.
Notice that subroutines require the
use
of
the stack. This requires the application to include random access
memory for the stack. When an application has no other need for random access memory, the system designer
might elect to avoid the
use
of subroutines.
CALL
IF
CARRY
The
CC
instruction combines functions of the
jC
and
PUSH
instructions.
CC
tests the setting of the carry flag.
If the flag
is
set to one,
CC
pushes the contents
of
the program counter
onto
the stack and then jumps to the
address specified
in
bytes two and three of the
CC
instruction.
If
the flag
is
reset to zero, program execution
continues with the next sequential instruction.
Opcode Operand
CC
address
Although the use of
a label
is
most common, the address may also
be
specified
as
a number or expression.
Example:
o o 0
~---------------------------
Cycles:
States:
Addressi
ng:
Flags:
lowaddr
high
addr
3 or 5
(2
or 5 on 8085)
11
or
17
(9
or
18
on 8085)
immediate/register indirect
none
For the sake of brevity, an example
is
given for the CALL instruction but not for each of
ItS
closely related
variants.
CALL IF
MINUS
The
CM
instruction combines functions of the J M and
PUSH
instructions.
CM
tests the setting
of
the sign flag.
If the flag
is
set
to
one (indicating that the contents of the accumulator are minus),
CM
pushes the contents
of
the program counter
onto
the stack and then jumps
to
the address specified
by
the
CM
instruction. If the
flag
is
set to zero, program execution simply continues with the next sequential instruction.
Opcode
Operand
CM
address