src/compiler.c
// Emit assembly code compatible with the NASM assembler
Emit assembly code compatible with the NASM assembler
Emit assembly code compatible with the NASM assembler
void EmitNasm(char* filename, struct tree_node* root)
{
	fp = fopen(filename, "w+");
	fprintf(fp, "[BITS 16]\norg 100h\ncall main\nret\n");	
	EmitHelper(root);
	fprintf(fp, "\n");
	fclose(fp);
}
void EmitNasm ( char * filename , struct tree_node * root ) { fp = fopen ( filename , " " ) ; fprintf ( fp , " \n \n \n \n " ) ; EmitHelper ( root ) ; fprintf ( fp , " \n " ) ; fclose ( fp ) ; }
Emit assembly code compatible with the NASM assembler
Emit assembly code compatible with the NASM assembler
// Open file // Recurse and emit code // REMOVE ORG LATER // Close file