This feels like a trainwreck but eh. Changed the way the opcodes are managed. Hopefully this is the right direction when I add support for multiple ASM files.

This commit is contained in:
2022-09-01 18:46:59 +00:00
parent 13f8ff194b
commit 7004fff659
7 changed files with 230 additions and 129 deletions
+7 -4
View File
@@ -36,14 +36,17 @@ int main(int argc, char* args[]) {
// if (t->type == LABEL) printf("* ");
// }
unsigned char* image = ParseTokens(list);
IRState* image = ParseTokens(list);
//Disassemble(image);
for(int i = 0; i < image->Opcodes->size; i++) {
printf("%d\n", ((IROpcode*) image->Opcodes->content[i])->Mnemonic);
}
FILE* program = fopen("program.bin", "w+b");
//FILE* program = fopen("program.bin", "w+b");
fwrite(image, 1, image[2] + image[3], program);
//fwrite(image, 1, image[2] + image[3], program);
fclose(program);
//fclose(program);
free(source_code);
}