beautypg.com

Call call – Zilog Z80380 User Manual

Page 65

background image

5-31

Z380

U

SER

'

S

M

ANUAL

Z

ILOG

DC-8297-03

CALL
CALL

CALL [cc,]dst

dst = DA

Operation:

if (cc is TRUE) then begin

if (XM) then begin

SP

SP - 4

(SP)

PC(7-0)

(SP+1)

PC(15-8)

(SP+2)

PC(23-16)

(SP+3)

PC(31-24)

PC(31-0)

dst(31-0)

else begin

SP

SP - 2

(SP)

PC(7-0)

(SP+1)

PC(15-8)

PC(15-0)

dst(15-0)

end

end

A conditional Call transfers program control to the destination address if the setting of a
selected flag satisfies the condition code “cc” specified in the instruction; an Unconditional
Call always transfers control to the destination address. The current contents of the Program
Counter (PC) are pushed onto the top of the stack; the PC value used is the address of the
first instruction byte following the Call instruction. The destination address is then loaded
into the PC and points to the first instruction of the called procedure. At the end of a
procedure a Return instruction (RET) can be used to return to the original program.

Each of the Zero, Carry, Sign, and Overflow Flags can be individually tested and a call
performed conditionally on the setting of the flag.

The operand is not enclosed in parentheses with the CALL instruction.

Flags:

S:

Unaffected

Z:

Unaffected

H:

Unaffected

V:

Unaffected

N:

Unaffected

C:

Unaffected

Addressing

Execute

Mode

Syntax

Instruction Format

Time

Note

DA:

CALL CC,addr

11-cc100 -a(low)- -a(high)

note

I, X

CALL addr

11001101 -a(low)- -a(high)

4+w

I, X

Field Encodings:

cc: 000 for NZ, 001 for Z, 010 for NC, 011 for C,
100 for PO or NV, 101 for PE or V, 110 for P or NS, 111 for M or S

Note:

2 if CC is false, 4+w if CC is true