beautypg.com

Call nn – Zilog Z08470 User Manual

Page 290

background image

Z80 Instruction Set

UM008007-0715

278

Z80 CPU
User Manual

CALL nn

Operation

(SP – 1) ← PCH, (SP – 2) ← PCL, PC ← nn

Op Code

CALL

Operand

nn

The first of the two n operands in the assembled object code above is the least-significant
byte of a 2-byte memory address.

Description

The current contents of the Program Counter (PC) are pushed onto the top of the external
memory stack. The operands nn are then loaded to the PC to point to the address in mem-
ory at which the first op code of a subroutine is to be fetched. At the end of the subroutine,
a RETurn instruction can be used to return to the original program flow by popping the top
of the stack back to the PC. The push is accomplished by first decrementing the current
contents of the Stack Pointer (register pair SP), loading the high-order byte of the PC con-
tents to the memory address now pointed to by the SP; then decrementing SP again, and
loading the low-order byte of the PC contents to the top of stack.

Because this process is a 3-byte instruction, the Program Counter was incremented by
three before the push is executed.

Condition Bits Affected

None.

M Cycles

T States

4 MHz E.T.

5

17 (4, 3, 4, 3, 3)

4.25

1

1

0

0

1

1

0

1

CD

n

n

This manual is related to the following products: