697
3. Instructions
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Subroutines
3
SBN/RET
Flags
z SBN/RET
There are no flags affected by this instruction.
Function
z SBN
z RET
When program execution reaches RET(093), it is automatically returned to the next instruction after the
SBS(091) or MCRO(099) instruction that called the subroutine. When the subroutine has been called
by MCRO(099), the output data in A604 through A607 is written to D through D+3 before program
execution is returned.
Precautions
• Place the subroutine program area (SBN(092) to RET(093)) in the same task as the SBS(091) or
MCRO(099) instruction of the same number. Subroutines in other tasks cannot be called.
SBN(092) indicates the beginning of the
subroutine 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) or
MCRO(099).
SBS
n
MCRO
n
SBN
n
RET
Subroutine
region
Tas k 2
Task 1 Task
Not allowed OK