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:
+7
-4
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user