7-115
RET
1
2
3
4
6
6
7
8
7.6 Structure creation instructions
7.6.4 Return from subroutine programs (RET)
7.6.4 Return from subroutine programs (RET)
RET
Function
(1) Indicates end of subroutine program
(2) When the RET instruction is executed, returns to the step following the CALL (P), FCALL
(P), ECALL (P), EFCALL (P) or XCALL instruction which called the subroutine program.
Operation Error
(1) In any of the following cases, an operation error occurs, the error flag (SM0) turns ON, and
an error code is stored into SD0.
• Following the execution of the CALL(P), FCALL (P), ECALL (P), EFCALL (P) or XCALL
instruction, an END, FEND, GOEND, or STOP instruction is executed before the
execution of the RET instruction. (Error code: 4211)
• An RET instruction is executed prior to the execution of the CALL (P), FCALL (P), ECALL
(P), EFCALL (P) or XCALL instruction. (Error code: 4212)
Setting
Data
Internal Devices
R, ZR
J\
U\G
Zn Constants Other
Bit Word Bit Word
–– ––
Basic
Process
High
performance
Redundant
Universal
RET
RET
Main routine
program
CALL Pn
END
Subroutine
program
RET
Pn