2 Instructions
2-296
CP1E CPU Unit Instructions Reference Manual(W483)
Flags
SBN/RET
There are no flags affected by this instruction.
Function
SBN
RET
When program execution reaches RET(093), it is automatically returned to the next instruction after the
SBS(091) instruction that called the subroutine.
Precautions
• Place the subroutine program area (SBN(092) to RET(093)) in the same task as the SBS(091)
instruction of the same number. Subroutines in other tasks cannot be called.
SBN(092) indicates the beginning of the sub-
routine with the specified subroutine number.
The end of the subroutine is indicated by
RET(093).
The region of the program beginning at the
first SBN(092) instruction is the subroutine
region. A subroutine is executed only when it
has been called by SBS(091) .
SBS
n
SBN
n
RET
Subroutine
region
SBS
n
SBN
n
RET
END
Task
OK
SBS
n
END
SBN
n
RET
END
Task 1
Not allowed
Task 2