Skip to content

Tripel Instructions List

Andrea Fioraldi edited this page Mar 8, 2017 · 7 revisions

Legend

  • [num] is the size in bytes of an object
  • ? indicates that an object has variable size in the bytecode
  • a, ... , b -> c represents the stack change, where b is the stack's top and a the last operand in stack needed for the instruction evaluation.
Name Opcode (hex) Opcode (bin) Parameters Stack (before->after) Description
nop 0 00000000 do nothing
ld_i8 1 10000000 imm[1] -> number load a signed char on stack
ld_u8 2 10000000 imm[1] -> number load an unsigned char on stack
ld_i16 3 11000000 imm[2] -> number load a signed short on stack
ld_u16 4 10000000 imm[2] -> number load an unsigned char on stack
ld_i32 5 10100000 imm[4] -> number load a signed int on stack
ld_u32 6 11000000 imm[4] -> number load an unsigned char on stack
ld_i64 7 11100000 imm[8] -> number load a signed long on stack
ld_u64 8 10000000 imm[8] -> number load an unsigned long on stack
ld_f32 9 10010000 imm[4] -> number load a 32 bit float on stack
ld_f64 a 10100000 imm[8] -> number load a 64 bit float on stack
ld_null b 10110000 -> pointer load the null pointer on stack
ld_str c 11000000 index[2] -> pointer load a string pointer on stack from the strings pool
addr d 11010000 var -> pointer get the address of a var
val e 11100000 pointer -> val dereference a pointer
at f 11110000 pointer, index -> val get an element from an array
at_c 10 10000000 imm[4] pointer -> val get an element from an array (constant index)
at_1 11 10001000 pointer -> val get the element 1 from an array
at_2 12 10010000 pointer -> val get the element 2 from an array
at_3 13 10011000 pointer -> val get the element 3 from an array
ad_at 14 10100000 pointer, index -> pointer get the address of an element from an array
ad_at_c 15 10101000 index[4] pointer -> pointer get the address of an element from an array (constant index)
ad_at_1 16 10110000 pointer -> pointer get the address of the element 1 from an array
ad_at_2 17 10111000 pointer -> pointer get the address of the element 2 from an array
ad_at_3 18 11000000 pointer -> pointer get the address of the element 3 from an array
field 19 11001000 index[2] struct -> val get a field from a structure
field_0 1a 11010000 struct -> val get the field 0 from a structure
field_1 1b 11011000 struct -> val get the field 1 from a structure
field_2 1c 11100000 struct -> val get the field 2 from a structure
field_3 1d 11101000 struct -> val get the field 2 from a structure
pt_field 1e 11110000 index[2] pointer -> val get a field from a structure pointer
pt_field_0 1f 11111000 pointer -> val get the field 0 from a structure pointer
pt_field_1 20 10000000 ->
pt_field_2 21 10000100 ->
pt_field_3 22 10001000 ->
ad_field 23 10001100 ->
ad_field_0 24 10010000 ->
ad_field_1 25 10010100 ->
ad_field_2 26 10011000 ->
ad_field_3 27 10011100 ->
ad_pt_field 28 10100000 ->
ad_pt_field_0 29 10100100 ->
ad_pt_field_1 2a 10101000 ->
ad_pt_field_2 2b 10101100 ->
ad_pt_field_3 2c 10110000 ->
push 2d 10110100 ->
push_0 2e 10111000 ->
push_1 2f 10111100 ->
push_2 30 11000000 ->
push_3 31 11000100 ->
push_ad 32 11001000 ->
push_ad_0 33 11001100 ->
push_ad_1 34 11010000 ->
push_ad_2 35 11010100 ->
push_ad_3 36 11011000 ->
push_arg 37 11011100 ->
push_arg_0 38 11100000 ->
push_arg_1 39 11100100 ->
push_arg_2 3a 11101000 ->
push_arg_3 3b 11101100 ->
push_gbl 3c 11110000 ->
push_e_gbl 3d 11110100 ->
pop 3e 11111000 ->
dup 3f 11111100 ->
clear 40 10000000 ->
decl_i8 41 10000010 ->
decl_u8 42 10000100 ->
decl_i16 43 10000110 ->
decl_u16 44 10001000 ->
decl_i32 45 10001010 ->
decl_u32 46 10001100 ->
decl_i64 47 10001110 ->
decl_u64 48 10010000 ->
decl_f32 49 10010010 ->
decl_f64 4a 10010100 ->
decl_vp 4b 10010110 ->
decl_pt 4c 10011000 ->
decl_st 4d 10011010 ->
decl_e_st 4e 10011100 ->
decl_t 4f 10011110 ->
store 50 10100000 ->
store_0 51 10100010 ->
store_1 52 10100100 ->
store_2 53 10100110 ->
store_3 54 10101000 ->
store_val 55 10101010 ->
store_val_0 56 10101100 ->
store_val_1 57 10101110 ->
store_val_2 58 10110000 ->
store_val_3 59 10110010 ->
store_gbl 5a 10110100 ->
store_e_gbl 5b 10110110 ->
set_at 5c 10111000 ->
set_at_0 5d 10111010 ->
set_at_1 5e 10111100 ->
set_at_2 5f 10111110 ->
set_at_3 60 11000000 ->
set_at_c 61 11000010 ->
set_field 62 11000100 ->
set_field_0 63 11000110 ->
set_field_1 64 11001000 ->
set_field_2 65 11001010 ->
set_field_3 66 11001100 ->
set_pt_field 67 11001110 ->
set_pt_field_0 68 11010000 ->
set_pt_field_1 69 11010010 ->
set_pt_field_2 6a 11010100 ->
set_pt_field_3 6b 11010110 ->
s_alloc 6c 11011000 ->
s_alloc_c 6d 11011010 ->
gc_alloc 6e 11011100 ->
gc_alloc_c 6f 11011110 ->
gc_atom_alloc 70 11100000 ->
gc_atom_alloc_c 71 11100010 ->
call 72 11100100 ->
n_call 73 11100110 ->
e_call 74 11101000 ->
en_call 75 11101010 ->
ret 76 11101100 ->
ret_std 77 11101110 ->
func_ad 78 11110000 ->
e_func_ad 79 11110010 ->
n_func_ad 7a 11110100 ->
en_func_ad 7b 11110110 ->
call_pt 7c 11111000 ->
val_assign 7d 11111010 ->
sizeof 7e 11111100 ->
sizeof_t 7f 11111110 ->
sizeof_t_mul 80 10000000 ->
minum 81 10000001 ->
add 82 10000010 ->
sub 83 10000011 ->
mul 84 10000100 ->
div 85 10000101 ->
rem 86 10000110 ->
inc 87 10000111 ->
dec 88 10001000 ->
neg 89 10001001 ->
and 8a 10001010 ->
or 8b 10001011 ->
xor 8c 10001100 ->
not 8d 10001101 ->
shl 8e 10001110 ->
shr 8f 10001111 ->
eq 90 10010000 ->
neq 91 10010001 ->
lt 92 10010010 ->
le 93 10010011 ->
gt 94 10010100 ->
ge 95 10010101 ->
is_null 96 10010110 ->
to_bool 97 10010111 ->
to_bool_n 98 10011000 ->
jmp 99 10011001 ->
jmp_if 9a 10011010 ->
jmp_if_n 9b 10011011 ->
label 9c 10011100 ->
cast_i8 9d 10011101 ->
cast_u8 9e 10011110 ->
cast_i16 9f 10011111 ->
cast_u16 a0 10100000 ->
cast_i32 a1 10100001 ->
cast_u32 a2 10100010 ->
cast_i64 a3 10100011 ->
cast_u64 a4 10100100 ->
cast_f32 a5 10100101 ->
cast_f64 a6 10100110 ->
cast_vp a7 10100111 ->
cast_pt a8 10101000 ->
cast_st a9 10101001 ->
cast_e_st aa 10101010 ->
cast_t ab 10101011 ->
abort ac 10101100 ->
Clone this wiki locally