KS57C2308/P2308/C2316/P2316
SAM47 INSTRUCTION SET
5-45
CALL
— Call Procedure
CALL
dst
Operation:
Operand
Operation Summary
Bytes
Cycles
ADR14
Call direct in page (14-bits)
3
4
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
Binary Code
Operation Notation
ADR14
1
1
0
1
1
0
1
1
[(SP–1) (SP–2)]
←
EMB, ERB
0
1
a13 a12 a11
a10
a9
a8
[(SP–3) (SP–4)]
←
PC7–0
[(SP–5) (SP–6)]
←
PC13-8
a7
a6
a5
a4
a3
a2
a1
a0
PC13–0
←
ADR13–0
(SP)
←
(SP)–6
Example:
The stack pointer value is 00H and the label “PLAY” is assigned to program memory location
0E3FH. Executing the instruction
CALL
PLAY
at location 0123H will generate the following values:
SP
=
0FAH
0FFH
=
0H
0FEH
=
EMB, ERB
0FDH
=
2H
0FCH
=
6H
0FBH
=
0H
0FAH
=
1H
PC
=
0E3FH
Data is written to stack locations 0FFH–0FAH as follows:
SP – 6 (0FAH)
PC11–PC8
SP – 5 (0FBH)
0
0
PC13
PC12
SP – 4 (0FCH)
PC3–PC0
SP – 3 (0FDH)
PC7–PC4
SP – 2 (0FEH)
0
0
EMB
ERB
SP – 1 (0FFH)
0
0
0
0
SP
←
(00H)
Summary of Contents for KS57C2308
Page 30: ...ADDRESS SPACES KS57C2308 P2308 C2316 P2316 2 22 NOTES ...
Page 168: ...SAM47 INSTRUCTION SET KS57C2308 P2308 C2316 P2316 5 94 NOTES ...
Page 170: ......
Page 206: ...POWER DOWN KS57C2308 P2308 C2316 P2316 8 8 NOTES ...
Page 210: ...RESET KS57C2308 P2308 C2316 P2316 9 4 NOTES ...
Page 222: ...I O PORTS KS57C2308 P2308 C2316 P2316 10 12 NOTES ...
Page 272: ...LCD CONTROLLER DRIVER KS57C2308 P2308 C2316 P2316 12 24 NOTES ...
Page 280: ...SERIAL I O INTERFACE KS57C2308 P2308 C2316 P2316 13 8 NOTES ...
Page 294: ...MECHANICAL DATA KS57C2308 P2308 C2316 P2316 15 2 NOTES ...
Page 310: ...KS57P2308 P2316 OTP KS57C2308 P2308 C2316 P2316 16 16 NOTES ...
Page 318: ......
Page 320: ......
Page 322: ......
Page 325: ......
Page 327: ......