Simple arithmitic
ADD
: Pops 2 elements, adds them together and pushes the result onto the stackSUB
Pops 2 elements, subtracts them and pushes the result onto the stackMUL
Pops 2 elements, multiplies them and pushes the result onto the stackDIV
Pops 2 elements, divides them and pushes the result onto the stackMOD
Pops 2 elements, uses the modulo operator on them and pushes the result onto the stackNEG
Pops 1 element, uses the ! operator on it and pushes the result onto the stack
Logical
EQUAL
Pops 2 elements, checks if they're equal and pushes the result onto the stackNOT_EQUAL
Pops 2 elements, checks if they're not equal and pushes the result onto the stackSTRICT_EQUAL
Pops 2 elements, checks if they're strictly equal and pushes the result onto the stackSTRICT_NOT_EQUAL
Pops 2 elements, checks if they're strictly not equal and pushes the result onto the stackGREATER_THAN
Pops 2 elements, checks if the top one is greater and pushes the result onto the stackLESS_THAN
Pops 2 elements, checks if the top one is smaller and pushes the result onto the stackLESS_THAN_EQUAL
Pops 2 elements, checks if the top one is smaller or the same and pushes the result onto the stackGREATER_THAN_EQUAL
Pops 2 elements, checks if the top one is greater or the same and pushes the result onto the stack
Bitwise
AND
Pops 2 elements, uses the&
operator and pushes the result onto the stackOR
Pops 2 elements, uses the|
operator and pushes the result onto the stackXOR
Pops 2 elements, uses the^
operator and pushes the result onto the stackNOT
Pops 2 elements, uses the~
operator and pushes the result onto the stackLEFT_SHIFT
Pops 2 elements, uses the<<
operator and pushes the result onto the stackRIGHT_SHIFT
Pops 2 elements, uses the>>
operator and pushes the result onto the stackZERO_LEFT_SHIFT
Pops 2 elements, uses the>>>
operator and pushes the result onto the stack
Stack operations
PUSH
Pushes the next byte onto the stackJMP
Jumps the pointer to the next byteJMP_IF
Jumps the pointer to the next byte if the top argument on the stack is also true (and pops that one)
Object operations
PUSH_THIS
Pushes thewindow
(or global) keyword onto the stackMEMBER_EXPRESSION
Gets the last 2 from the stack, pushes the result ofa[b]
to the stackPUSH_ARRAY
Creates an empty array and pushes it to the stackPUSH_OBJECT
Creates an empty object and pushes it to the stackPUSH_TO_ARRAY
Gets the top element from the stack, and pushes it to the second element on the stack
Other (for now)
EXECUTE_FUNCTION
Executes the function at the top of the stack, passes in the destructured arguments from the array in the second top in the stack, if the type of the var is Array. If not, just use that as the only argument
VM operations
HLT
Halts the execution