Subroutine Call, Return (Call, Callp, Ret) - Mitsubishi MELSEC-A Series Programming Manual

Type acpu/qcpu-a (a mode)
Hide thumbs Also See for MELSEC-A Series:
Table of Contents

Advertisement

6. BASIC INSTRUCTIONS
6.5.2 Subroutine call, return
(CALL, CALLP, RET)
Bit device
X
Y
M
P
Call of subroutine
program
Head pointer number
(label) of subroutine
program
P**
Return of
subroutine
program
Functions
Available Device
L
S
B
F
T
C
CALL, CALLP
(1) Executes the subroutine program specified by the pointer (P**).
(2) Up to five levels of nesting of the CALL/CALLP instruction are allowed.
RET
(1) Executes the sequence program located at the next step to the CALL(P)
instruction when the RET instruction is executed.
(2) Indicates the end of subroutine program.
POINT
For the PC CPUs shown below, setting indicated below is required.
• A0J2HCPU, AnSCPU, AnSHCPU,A2CCPU, AnCPU, AnNCPU, A3HCPU,
A3MCPU, A3VCPU
In a sequence between the RET instruction in a subroutine program and the
END instruction at the end of a sequence program, a dummy circuit must
always be set. Otherwise, the PC will fail to operate correctly.
(A NOP instruction has the same effect. However, take it into consideration
that "NOP batch deletion" must not be executed by a peripheral device.)
Applicable
CPU
Word (16-bit) device
D
W
R
A0
A1
Z
Subroutine execution commands
CALL
P**
CALLP
P**
RET
6 − 62
All CPUs
Constant Pointer
Level
V
K
H
P
I
N
O
Setting data
Head pointer number of
P**
subroutine program (P0 to
253)
Subroutine program
MELSEC-A
M9012 (M9010, M9011)
O
O

Advertisement

Table of Contents
loading

This manual is also suitable for:

Acpu-common-p-e13j741AcpuQcpu-a

Table of Contents