This commit is contained in:
2026-05-15 08:04:30 -05:00
parent 06e5be5c89
commit a0881e3c22
3 changed files with 25 additions and 2 deletions

View File

@@ -269,4 +269,23 @@ int main()
code_destroy(code);
free(bytecode);
}
{
printf("### Bytecode - labels\n");
const char* assembly_code =
".func 0\n"
" jmp @my_label\n"
" pushi \n"
"@my_label:\n"
" ret";
uint8_t* bytecode; size_t bytecode_sz;
assert(code_assemble(assembly_code, &bytecode, &bytecode_sz) == T_OK);
Code* code = code_new();
assert(code_load_bytecode(code, bytecode, bytecode_sz) == T_OK);
code_destroy(code);
free(bytecode);
}
}