allocate 2 12 allocate StackNeed, Live Allocate space for StackNeed words on the stack. If a GC is needed during allocation there are Live number of live X registers. Also save the continuation pointer (CP) on the stack.

allocate_heap 3 13 allocate_heap StackNeed, HeapNeed, Live Allocate space for StackNeed words on the stack and ensure there is space for HeapNeed words on the heap. If a GC is needed save Live number of X registers. Also save the continuation pointer (CP) on the stack.

allocate_heap_zero 3 15 allocate_heap_zero StackNeed, HeapNeed, Live Allocate space for StackNeed words on the stack and HeapNeed words on the heap. If a GC is needed during allocation there are Live number of live X registers. Clear the new stack words. (By writing NIL.) Also save the continuation pointer (CP) on the stack.

allocate_zero 2 14 allocate_zero StackNeed, Live Allocate space for StackNeed words on the stack. If a GC is needed during allocation there are Live number of live X registers. Clear the new stack words. (By writing NIL.) Also save the continuation pointer (CP) on the stack.

apply 1 112

apply_last 2 113

badmatch 1 72

bif0 2 9 bif0 Bif, Reg Call the bif Bif and store the result in Reg.

bif1 4 10 bif1 Lbl, Bif, Arg, Reg Call the bif Bif with the argument Arg, and store the result in Reg. On failure jump to Lbl.

bif2 5 11 bif2 Lbl, Bif, Arg1, Arg2, Reg Call the bif Bif with the arguments Arg1 and Arg2, and store the result in Reg. On failure jump to Lbl.

bs_add 5 111

bs_append 8 134

bs_bits_to_bytes 3 (110) DEPRECATED

bs_bits_to_bytes2 2 (127) DEPRECATED

bs_context_to_binary 1 130

bs_final 2 (88) DEPRECATED

bs_final2 2 (126) DEPRECATED

bs_get_binary 5 (82) DEPRECATED

bs_get_binary2 7 119

bs_get_float 5 (81) DEPRECATED

bs_get_float2 7 118

bs_get_integer 5 (80) DEPRECATED

bs_get_integer2 7 117

bs_get_position 3 167 bs_get_position Ctx, Dst, Live Sets Dst to the current position of Ctx

bs_get_tail 3 165 bs_get_tail Ctx, Dst, Live Sets Dst to the tail of Ctx at the current position

bs_get_utf16 5 140

bs_get_utf32 5 142

bs_get_utf8 5 138

bs_init 2 (87) DEPRECATED

bs_init2 6 109

bs_init_bits 6 137

bs_init_writable 0 133

bs_match_string 4 132

bs_need_buf 1 (93) DEPRECATED

bs_private_append 6 135

bs_put_binary 5 90

bs_put_float 5 91

bs_put_integer 5 89

bs_put_string 2 92

bs_put_utf16 3 147

bs_put_utf32 3 148

bs_put_utf8 3 145

bs_restore 1 (86) DEPRECATED

bs_restore2 2 123

bs_save 1 (85) DEPRECATED

bs_save2 2 122

bs_set_position 2 168 bs_set_positon Ctx, Pos Sets the current position of Ctx to Pos

bs_skip_bits 4 (83) DEPRECATED

bs_skip_bits2 5 120

bs_skip_utf16 4 141

bs_skip_utf32 4 143

bs_skip_utf8 4 139

bs_start_match 2 (79) DEPRECATED

bs_start_match2 5 116

bs_start_match3 4 166 bs_start_match3 Fail, Bin, Live, Dst Starts a binary match sequence

bs_start_match4 4 170 bs_start_match4 Fail, Bin, Live, Dst As bs_start_match3, but the fail label can be 'no_fail' when we know it will never fail at runtime, or 'resume' when we know the input is a match context.

bs_test_tail 2 (84) DEPRECATED

bs_test_tail2 3 121

bs_test_unit 3 131

bs_utf16_size 3 146

bs_utf8_size 3 144

build_stacktrace 0 160 build_stacktrace Given the raw stacktrace in x(0), build a cooked stacktrace suitable for human consumption. Store it in x(0). Destroys all other registers. Do a garbage collection if necessary to allocate space on the heap for the result.

call 2 4 call Arity, Label Call the function at Label. Save the next instruction as the return address in the CP register.

call_ext 2 7 call_ext Arity, Destination Call the function of arity Arity pointed to by Destination. Save the next instruction as the return address in the CP register.

call_ext_last 3 8 call_ext_last Arity, Destination, Deallocate Deallocate and do a tail call to function of arity Arity pointed to by Destination. Do not update the CP register. Deallocate Deallocate words from the stack before the call.

call_ext_only 2 78 call_ext_only Arity, Label Do a tail recursive call to the function at Label. Do not update the CP register.

call_fun 1 75 call_fun Arity Call a fun of arity Arity. Assume arguments in registers x(0) to x(Arity-1) and that the fun is in x(Arity). Save the next instruction as the return address in the CP register.

call_last 3 5 call_last Arity, Label, Deallocate Deallocate and do a tail recursive call to the function at Label. Do not update the CP register. Before the call deallocate Deallocate words of stack.

call_only 2 6 call_only Arity, Label Do a tail recursive call to the function at Label. Do not update the CP register.

case_end 1 74

catch 2 62

catch_end 1 63

deallocate 1 18 deallocate N Restore the continuation pointer (CP) from the stack and deallocate N+1 words from the stack (the + 1 is for the CP).

fadd 4 98

fcheckerror 1 95

fclearerror 0 94

fconv 2 97

fdiv 4 101

fmove 2 96

fmul 4 100

fnegate 3 102

fsub 4 99

func_info 3 2 func_info M, F, A Define a function M:F/A

gc_bif1 5 124 gc_bif1 Lbl, Live, Bif, Arg, Reg Call the bif Bif with the argument Arg, and store the result in Reg. On failure jump to Lbl. Do a garbage collection if necessary to allocate space on the heap for the result (saving Live number of X registers).

gc_bif2 6 125 gc_bif2 Lbl, Live, Bif, Arg1, Arg2, Reg Call the bif Bif with the arguments Arg1 and Arg2, and store the result in Reg. On failure jump to Lbl. Do a garbage collection if necessary to allocate space on the heap for the result (saving Live number of X registers).

gc_bif3 7 152 gc_bif3 Lbl, Live, Bif, Arg1, Arg2, Arg3, Reg Call the bif Bif with the arguments Arg1, Arg2 and Arg3, and store the result in Reg. On failure jump to Lbl. Do a garbage collection if necessary to allocate space on the heap for the result (saving Live number of X registers).

get_hd 2 162 get_hd Source, Head Get the head (or car) part of a list (a cons cell) from Source and put it into the register Head.

get_list 3 65 get_list Source, Head, Tail Get the head and tail (or car and cdr) parts of a list (a cons cell) from Source and put them into the registers Head and Tail.

get_map_elements 3 158

get_tl 2 163 get_tl Source, Tail Get the tail (or cdr) part of a list (a cons cell) from Source and put it into the register Tail.

get_tuple_element 3 66 get_tuple_element Source, Element, Destination Get element number Element from the tuple in Source and put it in the destination register Destination.

has_map_fields 3 157

if_end 0 73

init 1 17 init N Clear the Nth stack word. (By writing NIL.)

int_band 4 (33) DEPRECATED

int_bnot 3 (38) DEPRECATED

int_bor 4 (34) DEPRECATED

int_bsl 4 (36) DEPRECATED

int_bsr 4 (37) DEPRECATED

int_bxor 4 (35) DEPRECATED

int_code_end 0 3

int_div 4 (31) DEPRECATED

int_rem 4 (32) DEPRECATED

is_atom 2 48 is_atom Lbl, Arg1 Test the type of Arg1 and jump to Lbl if it is not an atom.

is_binary 2 53 is_binary Lbl, Arg1 Test the type of Arg1 and jump to Lbl if it is not a binary.

is_bitstr 2 129 is_bitstr Lbl, Arg1 Test the type of Arg1 and jump to Lbl if it is not a bit string.

is_boolean 2 114 is_boolean Lbl, Arg1 Test the type of Arg1 and jump to Lbl if it is not a Boolean.

is_constant 2 (54) DEPRECATED

is_eq 3 41 is_eq Lbl, Arg1, Arg2 Compare two terms and jump to Lbl if Arg1 is not (numerically) equal to Arg2.

is_eq_exact 3 43 is_eq_exact Lbl, Arg1, Arg2 Compare two terms and jump to Lbl if Arg1 is not exactly equal to Arg2.

is_float 2 46 is_float Lbl, Arg1 Test the type of Arg1 and jump to Lbl if it is not a float.

is_function 2 77 is_function Lbl, Arg1 Test the type of Arg1 and jump to Lbl if it is not a function (i.e. fun or closure).

is_function2 3 115 is_function2 Lbl, Arg1, Arity Test the type of Arg1 and jump to Lbl if it is not a function of arity Arity.

is_ge 3 40 is_ge Lbl, Arg1, Arg2 Compare two terms and jump to Lbl if Arg1 is less than Arg2.

is_integer 2 45 is_integer Lbl, Arg1 Test the type of Arg1 and jump to Lbl if it is not an integer.

is_list 2 55 is_list Lbl, Arg1 Test the type of Arg1 and jump to Lbl if it is not a cons or nil.

is_lt 3 39 is_lt Lbl, Arg1, Arg2 Compare two terms and jump to Lbl if Arg1 is not less than Arg2.

is_map 2 156

is_ne 3 42 is_ne Lbl, Arg1, Arg2 Compare two terms and jump to Lbl if Arg1 is (numerically) equal to Arg2.

is_ne_exact 3 44 is_ne_exact Lbl, Arg1, Arg2 Compare two terms and jump to Lbl if Arg1 is exactly equal to Arg2.

is_nil 2 52 is_nil Lbl, Arg1 Test the type of Arg1 and jump to Lbl if it is not nil.

is_nonempty_list 2 56 is_nonempty_list Lbl, Arg1 Test the type of Arg1 and jump to Lbl if it is not a cons.

is_number 2 47 is_number Lbl, Arg1 Test the type of Arg1 and jump to Lbl if it is not a number.

is_pid 2 49 is_pid Lbl, Arg1 Test the type of Arg1 and jump to Lbl if it is not a pid.

is_port 2 51 is_port Lbl, Arg1 Test the type of Arg1 and jump to Lbl if it is not a port.

is_reference 2 50 is_reference Lbl, Arg1 Test the type of Arg1 and jump to Lbl if it is not a reference.

is_tagged_tuple 4 159 is_tagged_tuple Lbl, Reg, N, Atom Test the type of Reg and jumps to Lbl if it is not a tuple. Test the arity of Reg and jumps to Lbl if it is not N. Test the first element of the tuple and jumps to Lbl if it is not Atom.

is_tuple 2 57 is_tuple Lbl, Arg1 Test the type of Arg1 and jump to Lbl if it is not a tuple.

jump 1 61 jump Label Jump to Label.

label 1 1 label Lbl Specify a module local label. Label gives this code address a name (Lbl) and marks the start of a basic block.

line 1 153

loop_rec 2 23 loop_rec Label, Source Loop over the message queue, if it is empty jump to Label.

loop_rec_end 1 24 loop_rec_end Label Advance the save pointer to the next message and jump back to Label.

m_div 4 (30) DEPRECATED

m_minus 4 (28) DEPRECATED

m_plus 4 (27) DEPRECATED

m_times 4 (29) DEPRECATED

make_fun 3 (76) DEPRECATED

make_fun2 1 103

move 2 64 move Source, Destination Move the source Source (a literal or a register) to the destination register Destination.

on_load 0 149

put 1 71

put_list 3 69

put_literal 2 (128) DEPRECATED

put_map_assoc 5 154

put_map_exact 5 155

put_string 3 (68) DEPRECATED

put_tuple 2 70

put_tuple2 2 164 put_tuple2 Destination, Elements Build a tuple with the elements in the list Elements and put it put into register Destination.

raise 2 108

raw_raise 0 161 raw_raise This instruction works like the erlang:raise/3 BIF, except that the stacktrace in x(2) must be a raw stacktrace. x(0) is the class of the exception (error, exit, or throw), x(1) is the exception term, and x(2) is the raw stackframe. If x(0) is not a valid class, the instruction will not throw an exception, but store the atom 'badarg' in x(0) and execute the next instruction.

recv_mark 1 150 recv_mark Label Save the end of the message queue and the address of the label Label so that a recv_set instruction can start scanning the inbox from this position.

recv_set 1 151 recv_set Label Check that the saved mark points to Label and set the save pointer in the message queue to the last position of the message queue saved by the recv_mark instruction.

remove_message 0 21 remove_message Unlink the current message from the message queue. Remove any timeout.

return 0 19 return Return to the address in the continuation pointer (CP).

select_tuple_arity 3 60 select_tuple_arity Tuple, FailLabel, Destinations Check the arity of the tuple Tuple and jump to the corresponding destination label, if no arity matches, jump to FailLabel.

select_val 3 59 select_val Arg, FailLabel, Destinations Jump to the destination label corresponding to Arg in the Destinations list, if no arity matches, jump to FailLabel.

send 0 20 send Send argument in x(1) as a message to the destination process in x(0). The message in x(1) ends up as the result of the send in x(0).

set_tuple_element 3 67 set_tuple_element NewElement, Tuple, Position Update the element at position Position of the tuple Tuple with the new element NewElement.

swap 2 169 swap Register1, Register2 Swaps the contents of two registers.

test_arity 3 58 test_arity Lbl, Arg1, Arity Test the arity of (the tuple in) Arg1 and jump to Lbl if it is not equal to Arity.

test_heap 2 16 test_heap HeapNeed, Live Ensure there is space for HeapNeed words on the heap. If a GC is needed save Live number of X registers.

timeout 0 22 timeout Reset the save point of the mailbox and clear the timeout flag.

trim 2 136 trim N, Remaining Reduce the stack usage by N words, keeping the CP on the top of the stack.

try 2 104

try_case 1 106

try_case_end 1 107

try_end 1 105

wait 1 25 wait Label Suspend the processes and set the entry point to the beginning of the receive loop at Label.