Call – Zilog Z16F2810 User Manual

Page 95

Advertising
background image

UM018809-0611

CALL Instruction

ZNEO

®

CPU Core

User Manual

79

CALL

Definition

CALL Procedure

Syntax

CALL dst

Operation

SP

SP4

(SP)

PC

PC

destination address

Description

A CALL instruction decrements the Stack Pointer (R15) by four and stores the current Program
Counter value on the top of the stack. The pushed PC value points to the first instruction follow-
ing the CALL instruction. Then the destination address is loaded into the Program Counter and
execution of the procedure begins. After the procedure completes, it uses a RET instruction to
pop the previous PC value and return from the procedure.

In assembly language, the destination is specified as a label or 32-bit address operand. When pos-
sible, the ZNEO CPU assembler automatically calculates a relative offset and generates relative
CALL opcodes to produce more efficient object code. For a relative CALL, the destination
address is the PC value plus two times the relative operand value.

In the CALL (Rs) syntax, if the contents of Rs are odd the least significant bit is discarded, so that
the call destination address is always an even number.

To invoke a 32-bit addressed call explicitly, use the CALLA instruction.

Flags

Flags are not affected by this instruction.

Syntax and Opcodes

Instruction, Operands

Word 0

Word 1

Word 2

CALL (Rs)

{F21H, Rs}

CALL rel12

{DH, rel12}

CALL rel24

{F1H, rel[23:16]}

rel[15:0]

Advertising
This manual is related to the following products: