SAM47 INSTRUCTION SET
KS57C2308/P2308/C2316/P2316
5-46
CALLS
— Call Procedure (Short)
CALLS
dst
Operation:
Operand
Operation Summary
Bytes
Cycles
ADR11
Call direct in page (11-bits)
2
3
Description:
The
CALLS instruction unconditionally calls a subroutine located at the indicated address. The
instruction increments the PC twice to obtain the address of the following instruction. Then, it
pushes the result onto the stack, decreasing the stack pointer six times. The higher bits of the
PC, with the exception of the lower 11-bits, are cleared. The subroutine call must therefore be
located within the 2-Kbyte block (0000H–07FFH) of program memory.
Operand
Binary Code
Operation Notation
ADR11
1
1
1
0
1
a10
a9
a8
[(SP–1) (SP–2)]
←
EMB, ERB
[(SP–3) (SP–4)]
←
PC7–0
[(SP–5) (SP–6)]
←
PC10–8
a7
a6
a5
a4
a3
a2
a1
a0
PC13–11
←
00
PC10–0
←
ADR10–0
(SP)
←
(SP)–6
Example:
The stack pointer value is 00H and the label “PLAY” is assigned to program memory location
0345H. Executing the instruction
CALLS
PLAY
at location 0123H will generate the following values:
SP
=
0FAH
0FFH
=
0H
0FEH
=
EMB, ERB
0FDH
=
2H
0FCH
=
5H
0FBH
=
0H
0FAH
=
1H
PC
=
0345H
Data is written to stack locations 0FFH–0FAH as follows:
SP – 6 (0FAH)
0
PC10–PC8
SP – 5 (0FBH)
0
0
0
0
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 C2316
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: ......