1
STRSWITCH
Nunuhara Cabbage edited this page 2022-06-30 14:30:18 -07:00

STRSWITCH

Instruction Arguments

int32 switchno - The index of the string jump table

Stack Arguments

int32 test - The (string) test value

Description

Jump to an address in a jump table based on a (string) test value.

Example

    PUSH 0x1   ; test value "two"
    SWITCH 0x1 ; jump to address for value of 2 in jump table 1
.STRCASE 0:1 "zero"
    ...        ; not executed
.STRCASE 1:1 "one"
    ...        ; not executed
.STRCASE 2:1 "two"
    PUSH 0x1   ; executed