Please enable JavaScript to view this site.

This instruction allows a group of instructions to be selected for execution depending on the value of a variable.

Syntax

SELECT (i32 var)

    CASE const

        ; Instruction R3

        BREAK

    CASE const

        ; Instruction R3

        BREAK

    DEFAULT

        ; Instruction R3

END_SELECT

var

Variable that depending on its value selects which instruction group to execute

const

Its value is the numerical identifier of the instruction group. It must be an integer numeric constant, otherwise an alarm is generated at compilation

Validity

Rule, Task

Note

"Instruction group" means those instructions that are between the case identifier and the next break, or between the default identifier and the end_select identifier (if the default identifier is present).

It is possible to have multiple case identifiers associated with the same break; this means that if an instruction group is not terminated by break, subsequent instructions will also execute until the first break (or end_select identifier).

If the variable value does not satisfy any of the specified cases (i.e., it does not match any of the cost values associated with the case identifiers), the instructions in the default group are executed. This block can be omitted, and in that case no instruction is executed

 

  

Keyboard Navigation

F7 for caret browsing
Hold ALT and press letter

This Info: ALT+q
Page Header: ALT+h
Topic Header: ALT+t
Topic Body: ALT+b
Contents: ALT+c
Search: ALT+s
Exit Menu/Up: ESC