feat: implement math in compiler

This commit is contained in:
samsonium
2026-10-11 02:10:54 +03:00
parent 981603105b
commit b9c43c6ad2
8 changed files with 506 additions and 83 deletions
+12 -3
View File
@@ -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