feat: implement functions

This commit is contained in:
samsonium
2026-10-15 02:23:43 +03:00
parent cc3087296f
commit 2c206822ca
15 changed files with 391 additions and 36 deletions
+13 -1
View File
@@ -20,6 +20,17 @@ void fzl_vm_print_ops(fzl_vm_t *vm)
switch (vm->ops[i])
{
case FZL_OPCODE_CALL:
{
size_t ip = vm->ops[++i];
printf("Call IP: %lu\n", ip);
break;
}
case FZL_OPCODE_RET:
printf("Return\n");
break;
case FZL_OPCODE_LOADCONST:
{
size_t const_n = vm->ops[++i];
@@ -79,6 +90,7 @@ void fzl_vm_print_ops(fzl_vm_t *vm)
case FZL_OPCODE_CMP_EQ:
printf("CMP_EQ\n");
break;
case FZL_OPCODE_CMP_NEQ:
printf("CMP_NEQ\n");
@@ -113,7 +125,7 @@ void fzl_vm_print_ops(fzl_vm_t *vm)
break;
case FZL_OPCODE_JMP:
printf("JMP IP %ld\n", vm->ops[++i]);
printf("JMP IP: %ld\n", vm->ops[++i]);
break;
default: