3. Instructions
706
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Function
Precautions
z GSBN
GSBN(751) indicates the beginning of the
global subroutine with the specified
subroutine number.
The region of the program beginning at the
first GSBN(751) instruction is the subroutine
region. A subroutine is executed only when it
has been called by GSBS(750).
z GRET
GRET(752) indicates the end of a global
subroutine. When program execution
reaches GRET(752) it is automatically
returned to the next instruction after the
GSBS(750) instruction that called the global
subroutine.
• Always place the global subroutines in
interrupt task 0.
GSBS
n
GSBN
n
GRET
END
Cyclic or interrupt task
Interrupt task 0
Global
subroutine
region
GSBS
n
END
GSBN
n
GRET
END
GSBS
n
END
GSBN
n
GRET
END
Cyclic task 1
Not allowed OK
Cyclic task 1
Cyclic task 2 Interrupt task 0