Specifications

SECTION 8 COMMAND DESCRIPTIONS
40
BRANCHING COMMANDS
Branching Commands cause the program to go to a specific line number or label. This sometimes will
occur if a condition exists, like an input being activated. The most common use will be to have a machine
operator activate a switch before the machine begins operation. Another use of these types of commands
would be for a program to continuously go from the bottom of the program back to the top of the program.
The Branching Commands cause the program to ‘branch’ to another part of the program based on a set of
conditions, like a switch being pressed, a register value equal to a number, a bit set, or many other
conditions.
GOSUB COMMAND
When the Gosub Command is implemented, the program will go to the specified line and then the
Return Command will send it back to the line below the original Gosub Command. This must be
used in conjunction with the Return Command.
This sample will cause the next instruction to go to the label Function 2, execute the lines 68
through 74, and then return to line 15..
Line Command Parameter 1 Parameter 2 Comments
14 Gosub FUNCTION2
*
67 Label FUNCTION2
*
75 Return Returns to Line 15
GOTO COMMAND
The Goto Command causes the program to go directly to the specified line. This line can be
described by a Line Number, a Register Value, or a Label. When using a Register Value, you must
make sure that there is a value stored in that Register. If there is a value, for example 10, then
this command will cause the program to jump to line 10 for the next command.
This sample will cause the next instruction to go to the Label Top.
Line Command Parameter 1 Parameter 2 Comments
14 Goto TOP
IF BIT COMMAND
The IF BIT COMMAND is a conditional statement used to execute another command based on
whether or not a certain Input condition is met.
Line Command Parameter 1 Parameter 2 Comments
1 If I1 = 0 Then TOP Else CONTINUE
IF REGISTER COMMAND
The IF REGISTER COMMAND is a conditional statement used to execute another command
based on whether or not a certain Register condition is met.
Line Command Parameter 1 Parameter 2 Comments
1 If R1 = 0 Then TOP Else CONTINUE
LABEL COMMAND
The LABEL command is simply used to label a line. As mentioned before, labels are commonly
used with branching statements.
Line Command Parameter 1 Parameter 2 Comments
1 Label TOP