7-132
XCALL
(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.
P0 X0XCALL
FEND RET RET RET
END
P0
P20
P10 X10XCALL P20 X20XCALL
D0
D3
D2
D1
0
1000
100
10
D0
D3
D2
D1
0
1000
100
10
Immediately after the
execution of
XCALL instruction
D0
D3
D2
D1
1
*2
1000
*2
100
*2
10
*2
D0
D3
D2
D1
0
1000
100
110
*1
Indefinite
Indefinite
Indefinite
Indefinite
1000
100
10
0
Indefinite
Indefinite
Indefinite
Indefinite
1000
100
10
1
*1
FD0 FD0 FD0 FD0
Transfer
Transfer
After the execution
of RET instruction
Before the execution
of subroutine program
At the time of
subroutine program
execution