Adjust ASM generation to account for c11 pointer arithmetic standards

This commit is contained in:
Curle 2020-09-14 02:08:14 +01:00
parent a0d2575a83
commit 610c45e3e1
Signed by: TheCurle
GPG Key ID: 2F2E62F0DA69A5AE

View File

@ -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) {