Skip to content

Instruction Reference

Nicky Nickell edited this page Mar 13, 2018 · 1 revision

Misc

assign

cast

is

not

nop

Integer arithmetic:

Instructions with unspecified arguments are in the form of:

  • dest - destination, an integer variable
  • arg1 - argument 1, an integer constant or variable
  • arg2 - argument 2, an integer constant or variable

integer-add

dest = arg1 + arg2

integer-sub

dest = arg1 - arg2

integer-mul

dest = arg1 * arg2

integer-div

dest = arg1 / arg2

integer-mod

dest = arg1 % arg2

integer-neg

  • dest - destination, an integer variable
  • arg - argument, an integer constant or variable

dest = -arg

Float arithmetic:

Instructions with unspecified arguments are in the form of:

  • dest - destination, a float variable
  • arg1 - argument 1, a float constant or variable
  • arg2 - argument 2, a float constant or variable

float-add

dest = arg1 + arg2

float-sub

dest = arg1 - arg2

float-mul

dest = arg1 * arg2

float-div

dest = arg1 / arg2

float-neg

  • dest - destination, a float variable
  • arg - argument, a float constant or variable

dest = -arg

Comparison:

All arguments are in the form of:

  • dest - destination, a bool variable
  • arg1 - argument 1, a variable or a constant
  • arg2 - argument 2, a variable or a constant

compare-eq

dest = arg1 == arg2

compare-lt

dest = arg1 < arg2

compare-lte

dest = arg1 <= arg2

compare-gt

dest = arg1 > arg2

compare-gte

dest = arg1 >= arg2

Control flow

jump

  • label - label name, the jump target

jump-t

  • label - label name, the jump target
  • cond -

jump-f

  • label - label name, the jump target
  • cond -

return

  • value - return value, the local variable to return from the function

String

string-cat

Property

prop-get

prop-set

Array

array-create

array-length

array-get-element

array-set-element

array-find-element

array-rfind-element

array-add

array-insert

array-remove-last

array-remove

array-clear

array-find-struct

array-rfind-struct

Struct

struct-create

struct-get

atruct-set

Function

call-method

call-parent

call-static