change to uint8_t for bytecode to reduce wasted bytes

This commit is contained in:
2025-06-27 06:07:57 +01:00
parent 358127a145
commit aa65393e2c
11 changed files with 100 additions and 53 deletions

View File

@@ -10,10 +10,10 @@ size_t translate_parsed_number(Translated *translated, char *number_str, size_t
size_t number_pos = arena_push(&translated->constants, number_str, length);
set_registers(translated, to_register+1);
size_t start = push_instruction_code(translated, OP_LOAD_CONST);
push_instruction_code(translated, to_register);
size_t start = push_instruction_byte(translated, OP_LOAD_CONST);
push_instruction_byte(translated, to_register);
push_instruction_code(translated, TYPE_OP_NUMBER);
push_instruction_byte(translated, TYPE_OP_NUMBER);
push_instruction_code(translated,length);
push_instruction_code(translated, number_pos);
return start;