Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- nop :
- discard A :
- dup A : A A
- over A B : A B A
- swap A B : B A
- rot A B C : B C A
- push_null : null
- push_true : 1
- push_false : 0
- get_local A : locals[A]
- set_local A B : locals[B] = A
- get_global A : globals[A]
- set_global A B : globals[B] = A
- push_arg A : function arguments[A]
- string_constant A : strings[A]
- push_array : []
- push_set : set()
- add A B : A + B (also adds to sets or arrays)
- sub A B : A - B (also removes from sets or arrays)
- mul A B : A * B
- div A B : A / B
- mod A B : A % B
- big_shift A B : A << B if positive, A >> B if negative
- bit_and A B : A & B
- bit_or A B : A | B
- bit_xor A B : A ^ B
- get_index A B : A[B]
- set_index A B C : B[C] = A
- length A : len(A) (string length, set size, array length)
- ternary A B C : A?B:C
- not A : !A
- negate A : -A
- cmp_eq A B : A == B
- cmp_ne A B : A != B
- cmp_lt A B : A < B (or "A doesn't contain B")
- cmp_le A B : A <= B
- cmp_gt A B : A > B
- cmp_ge A B : A >= B (or "A contains B")
- call A : call functions[A]
- return : return from call
- jump A : goto labels[A]
- if_true A B : goto labels[B] if B != 0
- if_false A B : goto labels[B] if B == 0
- builtin A : escape code for more primitives
- list of builtins:
- clone A : A (new copy)
- to_num A : num(A)
- to_str A : str(A)
- array_pop A : A[-1], and last member is removed
- slice A B C : A[B:C]
- del_index A B : delete A[B]
- ---Data types---
- number
- string
- array
- set
- ---Encoding---
- Two most significant bits control how big of a signed
- integer constant to push before the instruction runs.
- Bottom 6 bits control which function to run.
- 00ffffff
- 01ffffff xxxxxxxx
- 10ffffff xxxxxxxx yyyyyyyy
- 11ffffff xxxxxxxx yyyyyyyy zzzzzzzz wwwwwwww
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement