Motorola HC12 Refrence Manual page 112

Table of Contents

Advertisement

CALL
(SP) – $0002 ⇒ SP
Operation:
RTN
(SP) – $0001 ⇒ SP
(PPAGE) ⇒ M
page ⇒ PPAGE
Subroutine Address ⇒ PC
Description:
Sets up conditions to return to normal program flow, then transfers con-
trol to a subroutine in expanded memory. Uses the address of the in-
struction following the CALL as a return address. For code compatibility,
CALL also executes correctly in devices that do not have expanded
memory capability.
In indexed-indirect modes, the subroutine address and the PPAGE
value are fetched from memory in the order M high byte, M low byte, and
new PPAGE value.
Expanded-memory subroutines must be terminated by an RTC instruc-
tion, which restores the return address and PPAGE value from the stack.
Condition Codes and Boolean Formulas:
S
None affected.
Addressing Modes, Machine Code, and Execution Times:
Source Form
CALL opr16a, page
CALL oprx0_xysp, page
CALL oprx9,xysp, page
CALL oprx16,xysp, page
CALL [D ,xysp ]
CALL [ oprx16,xysp ]
MOTOROLA
6-52
Call Subroutine in Expanded Memory
⇒ M
: RTN
H
L
(SP)
(SP)
Decrements the SP by two, to allow the two bytes of the return ad-
dress to be stacked.
Stacks the return address (the SP points to the high order byte of the
return address).
Decrements the SP by one, to allow the current memory page value
in the PPAGE register to be stacked.
Stacks the content of PPAGE.
Writes a new page value supplied by the instruction to PPAGE.
Transfers control to the subroutine.
X
H
I
N
Z
Address Mode
EXT
IDX
IDX1
IDX2
[D,IDX]
[IDX2]
INSTRUCTION GLOSSARY
: M
(SP + 1)
V
C
Object Code
4A hh ll pg
4B xb pg
4B xb ff pg
4B xb ee ff pg
4B xb
4B xb ee ff
CALL
Cycles
Access Detail
8
gnfSsPPP
8
gnfSsPPP
8
gnfSsPPP
9
fgnfSsPPP
10
fIignSsPPP
10
fIignSsPPP
CPU12
REFERENCE MANUAL

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cpu12

Table of Contents