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

SWITCH

Instruction Arguments

int32 switchno - The index of the jump table

Stack Arguments

int32 test - The test value

Description

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

Example

    PUSH 0x2   ; test value
    SWITCH 0x1 ; jump to address for value of 2 in jump table 1
.CASE 0:1 0
    ...        ; not executed
.CASE 1:1 1
    ...        ; not executed
.CASE 2:1 2
    PUSH 0x1   ; executed