406
XCALL
[Main routine program]
(4)
to can be used by the XCALL instruction.
(5) The number of function devices used by a subroutine program must be identical to the number of arguments in the
XCALL instruction. Also, the function device and the type of XCALL argument should be identical.
(6) Device numbers specified in the argument of the XCALL instruction should not overlap.
If they do overlap, it will not be possible to obtain accurate calculations.
(7) Up to 16 nesting levels can be used with the XCALL instruction. However, this 16 levels is the total number of levels in
the CALL(P), FCALL(P), ECALL(P), EFCALL(P), and XCALL instructions.
(8) The device used for the argument of the XCALL instruction must not be used in a subroutine program.
If used, it will not be possible to perform correct calculations.
(Refer to the following program example.)
The processing to be executed when D1 is used in a subroutine program with D0 designated for FD0 in a subroutine
program is shown below.
[Program example]
[Operation performed after subroutine program execution]
*1:
Stores the execution result of the subroutine program.
*2:
Replaced by the value of the function device. D1 does not reflect the operation result in the subroutine program.
Occupies from D0 to D3
(
Transfer to FD1
)
.
X0
D30
Occupies from D30 to D33
(
Transfer to FD2
)
.
Occupies M0
(
Transfer to FX0
)
.
D0
M0
P0
XCALL
S1
S5
P0 X0
XCALL
FEND
RET
RET
RET
END
P0
P20
P10 X10
XCALL
P20 X20
XCALL
D0
D3
D2
D1
0
1000
100
10
D0
D3
D2
D1
0
1000
100
10
I
mmed
i
ate
ly
after
the
execut
i
on
of
XCA
LL i
nstruct
i
on
D0
D3
D2
D1
1
*
2
1000
*
2
100
*
2
10
*
2
D0
D3
D2
D1
0
1000
100
110
*
1
I
ndef
i
n
i
te
I
ndef
i
n
i
te
I
ndef
i
n
i
te
I
ndef
i
n
i
te
1000
100
10
0
I
ndef
i
n
i
te
I
ndef
i
n
i
te
I
ndef
i
n
i
te
I
ndef
i
n
i
te
1000
100
10
1
*
1
F
D0
F
D0
F
D0
F
D0
T
ransfer
T
ransfer
After
the
execut
i
on
of
R
ET i
nstruct
i
on
Before
the
execut
i
on
of
subrout
i
ne
program
At
the
t
i
me
of
subrout
i
ne
program
execut
i
on