Geração de Código Máquina
(Implementação)
.
..
void GenerateMachineCode(Node * ast)
{
Element* datacode = CreateList();
Element* progcode = CreateList();
int i = 0;
char codeline[256];
char path[256];
char cmd1[1024];
char cmd2[1024];
datacode = InsertList(datacode, "SECTION .data\n");
datacode = InsertList(datacode, "formatout: db \"%d\", 10, 0\n");
progcode = InsertList(progcode, "SECTION .text\n");
progcode = InsertList(progcode, "global _main\n");
progcode = InsertList(progcode, "extern _printf\n");
progcode = InsertList(progcode, "_main :\n");
GenerateCode(ast, datacode, progcode);
.
..