Samsung KS57C2308 Manual page 119

Single-chip cmos microcontroller
Table of Contents

Advertisement

KS57C2308/P2308/C2316/P2316
CALL
— Call Procedure
CALL
dst
Operation:
Operand
ADR14
Description:
CALL calls a subroutine located at the destination address. The instruction adds three to the
program counter to generate the return address and then pushes the result onto the stack,
decreasing the stack pointer by six. The EMB and ERB are also pushed to the stack. Program
execution continues with the instruction at this address. The subroutine may therefore begin
anywhere in the full 16-Kbyte program memory address space.
Operand
ADR14
Example:
The stack pointer value is 00H and the label "PLAY" is assigned to program memory location
0E3FH. Executing the instruction
CALL
at location 0123H will generate the following values:
SP
0FFH
0FEH =
0FDH =
0FCH =
0FBH =
0FAH =
PC
Data is written to stack locations 0FFH–0FAH as follows:
SP – 6 (0FAH)
SP – 5 (0FBH)
SP – 4 (0FCH)
SP – 3 (0FDH)
SP – 2 (0FEH)
SP – 1 (0FFH)
SP
Call direct in page (14-bits)
1
1
0
0
1
a13 a12 a11 a10
a7
a6
a5
PLAY
=
0FAH
=
0H
EMB, ERB
2H
6H
0H
1H
=
0E3FH
PC11–PC8
0
0
PC3–PC0
PC7–PC4
0
0
0
0
(00H)
Operation Summary
Binary Code
1
1
0
1
a9
a4
a3
a2
a1
PC13
PC12
EMB
ERB
0
0
SAM47 INSTRUCTION SET
Bytes
3
Operation Notation
1
[(SP–1) (SP–2)]
a8
[(SP–3) (SP–4)]
[(SP–5) (SP–6)]
a0
PC13–0
ADR13–0
(SP)
(SP)–6
Cycles
4
EMB, ERB
PC7–0
PC13-8
5-45

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

P2308C2316P2316Ks57p2308Ks57c2316Ks57p2316

Table of Contents