feat: implement math in compiler
This commit is contained in:
@@ -4,9 +4,18 @@
|
||||
// Available opcodes
|
||||
typedef enum
|
||||
{
|
||||
FZL_OPCODE_LOADCONST, // Load const into T (temp) reg
|
||||
FZL_OPCODE_PUSHARG, // Push argument from T into args stack
|
||||
FZL_OPCODE_CALL_BUILTIN // Call builtin function
|
||||
FZL_OPCODE_LOADCONST, // Load const into T (temp) reg
|
||||
FZL_OPCODE_PUSHARG, // Push argument from T into args stack
|
||||
FZL_OPCODE_CALL_BUILTIN, // Call builtin function
|
||||
FZL_OPCODE_PUSHNUM, // Push number into stack
|
||||
|
||||
FZL_OPCODE_ADD, // Sum two numbers in arg strack
|
||||
FZL_OPCODE_SUB, // Subract two numbers in arg stack
|
||||
FZL_OPCODE_MUL, // Multiply two numbers in arg stack
|
||||
FZL_OPCODE_DIV, // Divide two numbers in arg stack
|
||||
FZL_OPCODE_POW, // Power first number in arg stack by second
|
||||
FZL_OPCODE_MOD, // Get module of two numbers in arg stack
|
||||
FZL_OPCODE_NEG, // Negotiate number in arg stack
|
||||
} fzl_opcode_t;
|
||||
|
||||
#endif // FZL_OPCODES_H
|
||||
|
||||
Reference in New Issue
Block a user