How to use subroutines – IAI America XSEL-QX User Manual

Page 421

Advertising
background image

397

Appendix

14. How to Use Subroutines

Description

When the same processes are performed several times in one program, a group of these steps that are
isolated from others and called together as a set is called a “Subroutine.” Subroutines are used to reduce
program steps and make the program less convoluted. Up to 99 subroutines can be used in one program.
Subroutine calls can be nested by up to 15 times.

How to Use

The following commands are used to declare/call subroutines:
EXSR Call

subroutine

BGSR

Declare start of subroutine (declaration of start a group of steps)

EDSR

Declare end of subroutine (declaration of start of a group of steps)

Example of Use

Note

Using a GOTO command to jump out of a subroutine to TAG outside the subroutine is prohibited.

Subroutine

The same tasks are
consolidated into one location.

Advertising
This manual is related to the following products: