add instructions for loading string const to register

This commit is contained in:
2025-06-13 15:42:48 +01:00
parent 0adf3c247a
commit 937a6598fa
6 changed files with 13 additions and 3064 deletions

View File

@@ -4,5 +4,10 @@
void translate_parsed_string(Translated *translated, ParsedValue *parsedValue) {
size_t string_pos = arena_push_string(&translated->constants, (char*)parsedValue->data);
// set_registers(translated, 1);
set_registers(translated, 1);
push_instruction_code(translated, OP_LOAD_CONST);
push_instruction_code(translated, 0);
push_instruction_code(translated, OP_TYPE_STRING);
push_instruction_code(translated,strlen(parsedValue->data)+1);
push_instruction_code(translated, string_pos);
}