
96
NOT
:
Take the opposite value of the logic. It has the highest priority.
19.3.3 SELECT Sentence
Description
Compare the value after the CASE with the value stored in the register after the SELECT. If they
are equal, execute the instruction (GOTO or CALL) after this line of CASE, and the subsequent
CASE and ELSE instructions associated with the SELECT will no longer be executed; if they are
not equal, the corresponding instruction CALL XXX/GOTO LBL X in this line will not be executed
and execute the CASE instruction or ELSE instruction in the next line.
Example:
SELECT R[0]
CASE 1
,GOTO LBL[1]
CASE 2
,GOTO LBL[2]
CASE 3
,CALL
"
RT.PRG
Supplementary: when 3 is also 1, and R[0]=1, the previous
LBL[1] will be executed for only one time
ELSE,CALL"HS.PRG” //
In actual use, this instruction does not necessarily exist
GOTO LB[4]
LBL[1]
J P[1]
GOTO LBL[4]
LBL[2]
J P[2]
GOTO LBL[4]
LBL[3]
J P[3]
LBL[4]
The above sentences mean that the program is executed sequentially from top to bottom, matching
R[0]. When R[0]=1, the program moves to P[1]. When R[0]=2, the program moves to P2. When
R[0]=3, the program moves to point P3. When R[0] is not equal to 1/2/3, the program executes the
contents of the subprogram HS.PRG of the ELSE instruction part (ELSE can also follow the
GOTO ). Then proceed sequentially.
SELECT, CASE, ELSE (not necessarily exist) need to be used together. If
one misses, and program syntax errors will be reported.