Chapter
3.
Instruction
Set
PCHL
POP
3-42
MOVE
H&L
TO
PROGRAM
COUNTER
PCHL
loads the contents
of
the
Hand
L registers into the program counter register. Because the processor
fetches the next instruction from the updated program counter address,
PCHL
has the effect of a jump instruc·
tion.
Opcode Operand
PCHL
Operands are
not
permitted with the
PCHL
instruction.
PCHL
moves the contents of the H register to the high-order' eight bits
of
the program counter and
t.he
contents
of the L register
to
the low·order eight bits
of
the program counter.
The user program must ensure
tl.at the
Hand
L registers contain the
addres~
of an executable instructio 1 when
the
PCHL
instruction
is
executed.
Cycles:
States:
Addressi
ng:
Flags:
Example:
000
1
5
(6
on 8085)
register
none
One technique for passing data to a subroutine
is
to place the data immediately dfter the subroutine call. The
return address
pu~hed
onto
the stack
by
the CALL instruction actually addresses the data rather than the next
instruction after the
CALL. For this example, assume
that
two bytes of data follow the subroutine call. The
following coding sequence performs
a return to the next instruction after the call:
GOBACK:
POP
H
INR L
INR L
PCHL
;GET DATA ADDRESS
;ADD
2
TO
FORM
;RETURN ADDRESS
;RETURN
POP
The
POP
instruction removes two bytes of data from the stack and copies them to a register pair
or
copies the
Program
Status Word into the accumulator and the condition flags.
POP
Register
Pair
POP
copies the
contenb
of the memory location addressed
by
the stack pointer into the low·order regis .er of the
regi,ter pair.
POP
then increments the stack pointer
by
one and copies the contents of the resulting addl'ess into