00 | PUSHINT8 | - | | - | Pushes a 1-byte signed integer onto the stack. |
01 | PUSHINT16 | - | | - | Pushes a 2-byte signed integer onto the stack. |
02 | PUSHINT32 | - | | - | Pushes a 4-byte signed integer onto the stack. |
03 | PUSHINT64 | - | | - | Pushes a 8-byte signed integer onto the stack. |
04 | PUSHINT128 | - | | - | Pushes a 16-byte signed integer onto the stack. |
05 | PUSHINT256 | - | | - | Pushes a 32-byte signed integer onto the stack. |
08 | PUSHT | - | | - | Pushes the boolean value true onto the stack. |
09 | PUSHF | - | | - | Pushes the boolean value false onto the stack. |
0A | PUSHA | - | | - | Converts the 4-bytes offset to an Pointer, and pushes it onto the stack.. |
0B | PUSHNULL | - | | - | The item null is pushed onto the stack. |
0C | PUSHDATA1 | - | | - | The next byte contains the number of bytes to be pushed onto the stack. |
0D | PUSHDATA2 | - | | - | The next two bytes contain the number of bytes to be pushed onto the stack. |
0E | PUSHDATA4 | - | | - | The next four bytes contain the number of bytes to be pushed onto the stack. |
0F | PUSHM1 | - | | - | The number -1 is pushed onto the stack. |
10 | PUSH0 | - | | - | The number 0 is pushed onto the stack. |
11 | PUSH1 | - | | - | The number 1 is pushed onto the stack. |
12 | PUSH2 | - | | - | The number 2 is pushed onto the stack. |
13 | PUSH3 | - | | - | The number 3 is pushed onto the stack. |
14 | PUSH4 | - | | - | The number 4 is pushed onto the stack. |
15 | PUSH5 | - | | - | The number 5 is pushed onto the stack. |
16 | PUSH6 | - | | - | The number 6 is pushed onto the stack. |
17 | PUSH7 | - | | - | The number 7 is pushed onto the stack. |
18 | PUSH8 | - | | - | The number 8 is pushed onto the stack. |
19 | PUSH9 | - | | - | The number 9 is pushed onto the stack. |
1A | PUSH10 | - | | - | The number 10 is pushed onto the stack. |
1B | PUSH11 | - | | - | The number 11 is pushed onto the stack. |
1C | PUSH12 | - | | - | The number 12 is pushed onto the stack. |
1D | PUSH13 | - | | - | The number 13 is pushed onto the stack. |
1E | PUSH14 | - | | - | The number 14 is pushed onto the stack. |
1F | PUSH15 | - | | - | The number 15 is pushed onto the stack. |
20 | PUSH16 | - | | - | The number 16 is pushed onto the stack. |
21 | NOP | - | - | - | The NOP operation does nothing. It is intended to fill in space if opcodes are patched. |
22 | JMP | - | - | - | Unconditionally transfers control to a target instruction. The target instruction is represented as a 1-byte signed offset from the beginning of the current instruction. |
23 | JMP | - | - | - | Unconditionally transfers control to a target instruction. The target instruction is represented as a 4-bytes signed offset from the beginning of the current instruction. |
24 | JMPIF | | - | - | Transfers control to a target instruction if the value is true, not null, or non-zero. The target instruction is represented as a 1-byte signed offset from the beginning of the current instruction. |
25 | JMPIFL | | - | - | Transfers control to a target instruction if the value is true, not null, or non-zero. The target instruction is represented as a 4-bytes signed offset from the beginning of the current instruction. |
26 | JMPIFNOT | | - | - | Transfers control to a target instruction if the value is false, a null reference, or zero. The target instruction is represented as a 1-byte signed offset from the beginning of the current instruction. |
27 | JMPIFNOTL | | - | - | Transfers control to a target instruction if the value is false, a null reference, or zero. The target instruction is represented as a 4-bytes signed offset from the beginning of the current instruction. |
28 | JMPEQ | | - | - | Transfers control to a target instruction if two values are equal. The target instruction is represented as a 1-byte signed offset from the beginning of the current instruction. |
29 | JMPEQL | | - | - | Transfers control to a target instruction if two values are equal. The target instruction is represented as a 4-bytes signed offset from the beginning of the current instruction. |
2A | JMPNE | | - | - | Transfers control to a target instruction when two values are not equal. The target instruction is represented as a 1-byte signed offset from the beginning of the current instruction. |
2B | JMPNEL | | - | - | Transfers control to a target instruction when two values are not equal. The target instruction is represented as a 4-bytes signed offset from the beginning of the current instruction. |
2C | JMPGT | | - | - | Transfers control to a target instruction if the first value is greater than the second value. The target instruction is represented as a 1-byte signed offset from the beginning of the current instruction. |
2D | JMPGTL | | - | - | Transfers control to a target instruction if the first value is greater than the second value. The target instruction is represented as a 4-bytes signed offset from the beginning of the current instruction. |
2E | JMPGE | | - | - | Transfers control to a target instruction if the first value is greater than or equal to the second value. The target instruction is represented as a 1-byte signed offset from the beginning of the current instruction. |
2F | JMPGEL | | - | - | Transfers control to a target instruction if the first value is greater than or equal to the second value. The target instruction is represented as a 4-bytes signed offset from the beginning of the current instruction. |
30 | JMPLT | | - | - | Transfers control to a target instruction if the first value is less than the second value. The target instruction is represented as a 1-byte signed offset from the beginning of the current instruction. |
31 | JMPLTL | | - | - | Transfers control to a target instruction if the first value is less than the second value. The target instruction is represented as a 4-bytes signed offset from the beginning of the current instruction. |
32 | JMPLE | | - | - | Transfers control to a target instruction if the first value is less than or equal to the second value. The target instruction is represented as a 1-byte signed offset from the beginning of the current instruction. |
33 | JMPLEL | | - | - | Transfers control to a target instruction if the first value is less than or equal to the second value. The target instruction is represented as a 4-bytes signed offset from the beginning of the current instruction. |
34 | CALL | - | - | - | Calls the function at the target address which is represented as a 1-byte signed offset from the beginning of the current instruction. |
35 | CALLL | - | - | - | Calls the function at the target address which is represented as a 4-bytes signed offset from the beginning of the current instruction. |
36 | CALLA | - | - | - | Pop the address of a function from the stack, and call the function. |
37 | CALLT | - | - | - | Calls the function which is described by the token. |
38 | ABORT | - | - | - | It turns the vm state to FAULT immediately, and cannot be caught. |
39 | ASSERT | | - | - | Pop the top value of the stack. If it's false, exit vm execution and set vm state to FAULT. |
3A | THROW | | - | - | Pop the top value of the stack, and throw it. |
3B | TRY | - | - | - | TRY CatchOffset(sbyte) FinallyOffset(sbyte). If there's no catch body, set CatchOffset 0. If there's no finally body, set FinallyOffset 0. |
3C | TRYL | - | - | - | TRYL CatchOffset(int) FinallyOffset(int). If there's no catch body, set CatchOffset 0. If there's no finally body, set FinallyOffset 0. |
3D | ENDTRY | - | - | - | Ensures that the appropriate surrounding finally blocks are executed. And then unconditionally transfers control to the specific target instruction, represented as a 1-byte signed offset from the beginning of the current instruction. |
3E | ENDTRYL | - | - | - | Ensures that the appropriate surrounding finally blocks are executed. And then unconditionally transfers control to the specific target instruction, represented as a 4-byte signed offset from the beginning of the current instruction. |
3F | ENDFINALLY | - | - | - | End finally, If no exception happen or be catched, vm will jump to the target instruction of ENDTRY/ENDTRYL. Otherwise, vm will rethrow the exception to upper layer. |
40 | RET | - | - | - | Returns from the current method. |
41 | SYSCALL | - | - | - | Calls to an interop service. |
43 | DEPTH | - | | - | Puts the number of stack items onto the stack. |
45 | DROP | | | - | Removes the top stack item. |
46 | NIP | | | - | Removes the second-to-top stack item. |
48 | XDROP | | - | - | The item n back in the main stack is removed. |
49 | CLEAR | | - | - | Clear the stack |
4A | DUP | | | - | Duplicates the top stack item. |
4B | OVER | | | - | Copies the second-to-top stack item to the top. |
4D | PICK | | | - | The item n back in the stack is copied to the top. |
4E | TUCK | | | - | The item at the top of the stack is copied and inserted before the second-to-top item. |
50 | SWAP | | | - | The top two items on the stack are swapped. |
51 | ROT | | | - | The top three items on the stack are rotated to the left. |
52 | ROLL | | | - | The item n back in the stack is moved to the top. |
53 | REVERSE3 | | | - | Reverse the order of the top 3 items on the stack. |
54 | REVERSE4 | | | - | Reverse the order of the top 4 items on the stack. |
55 | REVERSEN | | | - | Pop the number N on the stack, and reverse the order of the top N items on the stack. |
56 | INITSSLOT | - | - | - | Initialize the static field list for the current execution context. |
57 | INITSLOT | - | - | - | Initialize the argument slot and the local variable list for the current execution context. |
58 | LDSFLD0 | - | | - | Loads the static field at index 0 onto the evaluation stack. |
59 | LDSFLD1 | - | | - | Loads the static field at index 1 onto the evaluation stack. |
5A | LDSFLD2 | - | | - | Loads the static field at index 2 onto the evaluation stack. |
5B | LDSFLD3 | - | | - | Loads the static field at index 3 onto the evaluation stack. |
5C | LDSFLD4 | - | | - | Loads the static field at index 4 onto the evaluation stack. |
5D | LDSFLD5 | - | | - | Loads the static field at index 5 onto the evaluation stack. |
5E | LDSFLD6 | - | | - | Loads the static field at index 6 onto the evaluation stack. |
5F | LDSFLD | - | | - | Loads the static field at a specified index onto the evaluation stack. The index is represented as a 1-byte unsigned integer. |
60 | STSFLD0 | | | - | Stores the value on top of the evaluation stack in the static field list at index 0. |
61 | STSFLD1 | | | - | Stores the value on top of the evaluation stack in the static field list at index 1. |
62 | STSFLD2 | | | - | Stores the value on top of the evaluation stack in the static field list at index 2. |
63 | STSFLD3 | | | - | Stores the value on top of the evaluation stack in the static field list at index 0. |
64 | STSFLD4 | | | - | Stores the value on top of the evaluation stack in the static field list at index 4. |
65 | STSFLD5 | | | - | Stores the value on top of the evaluation stack in the static field list at index 5. |
66 | STSFLD6 | | | - | Stores the value on top of the evaluation stack in the static field list at index 6. |
67 | STSFLD | | | - | Stores the value on top of the evaluation stack in the static field list at a specified index. The index is represented as a 1-byte unsigned integer. |
68 | LDLOC0 | - | | - | Loads the local variable at index 0 onto the evaluation stack. |
69 | LDLOC1 | - | | - | Loads the local variable at index 1 onto the evaluation stack. |
6A | LDLOC2 | - | | - | Loads the local variable at index 2 onto the evaluation stack. |
6B | LDLOC3 | - | | - | Loads the local variable at index 3 onto the evaluation stack. |
6C | LDLOC4 | - | | - | Loads the local variable at index 4 onto the evaluation stack. |
6D | LDLOC5 | - | | - | Loads the local variable at index 5 onto the evaluation stack. |
6E | LDLOC6 | - | | - | Loads the local variable at index 7 onto the evaluation stack. |
6F | LDLOC | - | | - | Loads the local variable at a specified index onto the evaluation stack. The index is represented as a 1-byte unsigned integer. |
70 | STLOC0 | - | | - | Stores the value on top of the evaluation stack in the local variable list at index 0. |
71 | STLOC1 | - | | - | Stores the value on top of the evaluation stack in the local variable list at index 1. |
72 | STLOC2 | - | | - | Stores the value on top of the evaluation stack in the local variable list at index 2. |
73 | STLOC3 | - | | - | Stores the value on top of the evaluation stack in the local variable list at index 3. |
74 | STLOC4 | - | | - | Stores the value on top of the evaluation stack in the local variable list at index 4. |
75 | STLOC5 | - | | - | Stores the value on top of the evaluation stack in the local variable list at index 5. |
76 | STLOC6 | - | | - | Stores the value on top of the evaluation stack in the local variable list at index 6. |
77 | STLOC | - | | - | Stores the value on top of the evaluation stack in the local variable list at a specified index. The index is represented as a 1-byte unsigned integer. |
78 | LDARG0 | - | | - | Loads the argument at index 0 onto the evaluation stack. |
79 | LDARG1 | - | | - | Loads the argument at index 1 onto the evaluation stack. |
7A | LDARG2 | - | | - | Loads the argument at index 2 onto the evaluation stack. |
7B | LDARG3 | - | | - | Loads the argument at index 3 onto the evaluation stack. |
7C | LDARG4 | - | | - | Loads the argument at index 4 onto the evaluation stack. |
7D | LDARG5 | - | | - | Loads the argument at index 5 onto the evaluation stack. |
7E | LDARG6 | - | | - | Loads the argument at index 6 onto the evaluation stack. |
7F | LDARG | - | | - | Loads the argument at a specified index onto the evaluation stack. The index is represented as a 1-byte unsigned integer. |
80 | STARG0 | | - | - | Stores the value on top of the evaluation stack in the argument slot at index 0. |
81 | STARG1 | | - | - | Stores the value on top of the evaluation stack in the argument slot at index 1. |
82 | STARG2 | | - | - | Stores the value on top of the evaluation stack in the argument slot at index 2. |
83 | STARG3 | | - | - | Stores the value on top of the evaluation stack in the argument slot at index 3. |
84 | STARG4 | | - | - | Stores the value on top of the evaluation stack in the argument slot at index 4. |
85 | STARG5 | | - | - | Stores the value on top of the evaluation stack in the argument slot at index 5. |
86 | STARG6 | | - | - | Stores the value on top of the evaluation stack in the argument slot at index 6. |
87 | STARG | | - | - | Stores the value on top of the evaluation stack in the argument slot at a specified index. The index is represented as a 1-byte unsigned integer. |
88 | NEWBUFFER | - | | new Buffer(a) | Creates a new Buffer and pushes it onto the stack. |
89 | MEMCPY | | - | c.Slice(d, e).CopyTo(a.InnerBuffer.Span[b..]) | Copies a range of bytes from one Buffer to another. Using this opcode will require to dup the destination buffer. |
8B | CAT | | | a.Concat(b) | Concatenates two strings. |
8C | SUBSTR | | | a.Slice(b, c) | Concatenates two strings. |
8D | LEFT | | | a[..b] | Keeps only characters left of the specified point in a string. |
90 | INVERT | | | ~a | Flips all the bits in the input. |
91 | AND | | | a&b | Boolean and between each bit in the inputs. |
92 | OR | | | a|b | Boolean or between each bit in the inputs. |
93 | XOR | | | ab | Boolean exclusive or between each bit in the inputs. |
97 | EQUAL | | | a.Equals(b) | Returns 1 if the inputs are exactly equal, 0 otherwise. |
98 | NOTEQUAL | | | !a.Equals(b) | Returns 1 if the inputs are not equal, 0 otherwise. |
99 | SIGN | | | a.Sign | Puts the sign of top stack item on top of the main stack. If value is negative, put -1; if positive, put 1; if value is zero, put 0. |
9A | ABS | | | abs(a) | The input is made positive. |
9B | NEGATE | | | -a | The sign of the input is flipped. |
9C | INC | | | a+1 | 1 is added to the input. |
9D | DEC | | | a-1 | 1 is subtracted from the input. |
9E | ADD | | | a+b | a is added to b. |
9F | SUB | | | a-b | b is subtracted from a. |
A0 | MUL | | | a*b | a is multiplied by b. |
A1 | DIV | | | a/b | a is divided by b. |
A2 | MOD | | | a%b | Returns the remainder after dividing a by b. |
A3 | POW | | | ab | The result of raising value to the exponent power. |
A4 | SQRT | | | sqrt(a) | Returns the square root of a specified number. |
A5 | MODMUL | | | a*b%c | Performs modulus division on a number multiplied by another number. |
A6 | MODPOW | | | modpow(a, b, c) | Performs modulus division on a number raised to the power of another number. If the exponent is -1, it will have the calculation of the modular inverse. |
A8 | SHL | | | a << b | Shifts a left b bits, preserving sign. |
A9 | SHR | | | a << b | Shifts a right b bits, preserving sign. |
AA | NOT | | | !a | If the input is 0 or 1, it is flipped. Otherwise, the output will be 0. |
AB | BOOLAND | | | a && b | If both a and b are not 0, the output is 1. Otherwise, 0. |
AC | BOOLOR | | | a || b | If a or b is not 0, the output is 1. Otherwise, 0. |
B1 | NZ | | | a != 0 | If a or b is not 0, the output is 1. Otherwise, 0. |
B3 | NUMEQUAL | | | b == a | Returns 1 if the numbers are equal, 0 otherwise. |
B4 | NUMNOTEQUAL | | | b != a | Returns 1 if the numbers are not equal, 0 otherwise. |
B5 | LT | | | a < b | Returns 1 if a is less than b, 0 otherwise. |
B6 | LE | | | a <= b | Returns 1 if a is less than or equal to b, 0 otherwise. |
B7 | GT | | | a > b | Returns 1 if a is greater than b, 0 otherwise. |
B8 | GE | | | a >= b | Returns 1 if a is greater than or equal to b, 0 otherwise. |
B9 | MIN | | | - | Returns the smallest of a and b. |
BA | MAX | | | - | Returns the largest of a and b. |
BB | WITHIN | | | - | Returns 1 if x is within the specified range (left-inclusive), 0 otherwise. |
BE | PACKMAP | | | - | A value n is taken from top of main stack. The next n*2 items on main stack are removed, put inside n-sized map and this map is put on top of the main stack. |
BF | PACKSTRUCT | | | - | A value n is taken from top of main stack. The next n items on main stack are removed, put inside n-sized struct and this struct is put on top of the main stack. |
C0 | PACK | | | - | A value n is taken from top of main stack. The next n items on main stack are removed, put inside n-sized array and this array is put on top of the main stack. |
C1 | UNPACK | | | - | A collection is removed from top of the main stack. Its elements are put on top of the main stack (in reverse order) and the collection size is also put on main stack. |
C2 | NEWARRAY0 | - | | - | An empty array (with size 0) is put on top of the main stack. |
C3 | NEWARRAY | | | - | A value n is taken from top of main stack. A null-filled array with size n is put on top of the main stack. |
C4 | NEWARRAYT | | | - | A value n is taken from top of main stack. An array of type T with size n is put on top of the main stack. |
C5 | NEWSTRUCT0 | - | | - | An empty struct (with size 0) is put on top of the main stack. |
C6 | NEWSTRUCT | | zero-filled struct with size n | | | - | A value n is taken from top of main stack. A zero-filled struct with size n is put on top of the main stack. |
C8 | NEWMAP | - | | - | A Map is created and put on top of the main stack. |
CA | SIZE | | | - | An array is removed from top of the main stack. Its size is put on top of the main stack. |
CB | HASKEY | | | - | An input index n (or key) and an array (or map) are removed from the top of the main stack. Puts True on top of main stack if array[n] (or map[n]) exist, and False otherwise. |
CC | KEYS | | | - | A map is taken from top of the main stack. The keys of this map are put on top of the main stack. |
CD | VALUES | | | - | A map is taken from top of the main stack. The values of this map are put on top of the main stack. |
CE | PICKITEM | | | - | An input index n (or key) and an array (or map) are taken from main stack. Element array[n] (or map[n]) is put on top of the main stack. |
CF | APPEND | | | - | The item on top of main stack is removed and appended to the second item on top of the main stack. |
D0 | SETITEM | | | - | A value v, index n (or key) and an array (or map) are taken from main stack. Attribution array[n]=v (or map[n]=v) is performed. |
D1 | REVERSEITEMS | | - | - | An array is removed from the top of the main stack and its elements are reversed. |
D2 | REMOVE | | - | - | An input index n (or key) and an array (or map) are removed from the top of the main stack. Element array[n] (or map[n]) is removed. |
D3 | CLEARITEMS | | - | - | Remove all the items from the compound-type. |
D4 | POPITEM | | | - | Remove the last element from an array, and push it onto the stack. |
D8 | ISNULL | | | - | Returns true if the input is null; |
D9 | ISTYPE | | | - | Returns true if the top item of the stack is of the specified type; |
DB | CONVERT | | | - | Converts the top item of the stack to the specified type. |
E0 | ABORTMSG | | - | - | Pops the top stack item. Then, turns the vm state to FAULT immediately, and cannot be caught. The top stack |
E1 | ASSERTMSG | | - | - | Pops the top two stack items. If the second-to-top stack value is false, exits the vm execution and sets the vm state to FAULT. In this case, the top stack value is used as reason for the exit. Otherwise, it is ignored. |