SI_ [constants]
SGScript instruction code/type/ID constants.
These constants are only available if meta_globals is called first.
- SI_NOP - no op
- SI_PUSH - push variable to stack
- SI_RETN - return from call with the specified number of variables off the top of the stack
- SI_JUMP - do a relative jump from after the instruction
- SI_JMPT - do a relative jump from after the instruction, if a register/constant is true
- SI_JMPF - do a relative jump from after the instruction, if a register/constant is false
- SI_CALL - do a function call with the specified function/argument list
- SI_FORPREP - prepare for
foreach
loop, retrieving the iterator - SI_FORLOAD - load key/value from iterator
- SI_FORJUMP - advance the iterator, optionally jumping if iterator reached end
- SI_LOADCONST - load constant (extended addressing) into register
- SI_GETVAR - retrieve global variable by key
- SI_SETVAR - set global variable by key
- SI_GETPROP - retrieve property from object by key
- SI_SETPROP - set property in object by key
- SI_GETINDEX - retrieve index from object by key
- SI_SETINDEX - set index in object by key
- SI_GENCLSR - generate number of closure variables, pushing them on top of stack
- SI_PUSHCLSR - copy and push closure variable from the stack
- SI_MAKECLSR - make function with attached closure variables
- SI_GETCLSR - get closure value from closure variable on stack
- SI_SETCLSR - set closure value to closure variable on stack
- SI_SET - copy variable from register/constant to another register
- SI_MCONCAT - concatenate range of variables
- SI_CONCAT - concatenate two variables
- SI_NEGATE - negate variable
- SI_BOOL_INV - do logical inversion on variable
- SI_INVERT - do bitwise inversion on variable
- SI_INC - add 1 to variable
- SI_DEC - subtract 1 from variable
- SI_ADD - add two variables
- SI_SUB - subtract two variables
- SI_MUL - multiply two variables
- SI_DIV - divide two variables
- SI_MOD - do modulo on two variables
- SI_AND - do bitwise AND on two variables
- SI_OR - do bitwise OR on two variables
- SI_XOR - do bitwise XOR on two variables
- SI_LSH - do left bit shift
- SI_RSH - do right bit shift
- SI_SEQ - compare two variables for strict equality
- SI_SNEQ - compare two variables for strict inequality
- SI_EQ - compare two variables for (weak) equality
- SI_NEQ - compare two variables for (weak) inequality
- SI_LT - test if one variable is less than other
- SI_GTE - test if one variable is greater than or equal to other
- SI_GT - test if one variable is greater than other
- SI_LTE - test if one variable is less than or equal to other
- SI_RAWCMP - return variable difference as -1/0/1
- SI_ARRAY - create an array from stack items
- SI_DICT - create a dict from stack items