diff --git a/src/Assembler.c b/src/Assembler.c index 5ee92c3..bd7adf8 100644 --- a/src/Assembler.c +++ b/src/Assembler.c @@ -449,8 +449,16 @@ void AsNewSymb(int ID) { TypeSize = PrimitiveSize(Symbols[ID].Type); - fprintf(OutputFile, "\t.comm\t%s, %d, %d\n", Symbols[ID].Name, TypeSize, TypeSize); + fprintf(OutputFile, "\t.data\n" + "\t.globl\t%s\n", + Symbols[ID].Name); + switch(TypeSize) { + case 1: fprintf(OutputFile, "%s:\t.byte\t0\n", Symbols[ID].Name); + case 4: fprintf(OutputFile, "%s:\t.long\t0\n", Symbols[ID].Name); + case 8: fprintf(OutputFile, "%s:\t.quad\t0\n", Symbols[ID].Name); + default: DieDecimal("Unknown type in AsNewSymbol", TypeSize); + } } int AsCall(int Register, int FuncID) {