|
@@ -349,9 +349,9 @@ unit agsdasz80;
|
|
;
|
|
;
|
|
end;
|
|
end;
|
|
if o.ref^.offset<>0 then
|
|
if o.ref^.offset<>0 then
|
|
- writer.AsmWrite('('+o.ref^.symbol.name+'+'+tostr(o.ref^.offset)+')')
|
|
|
|
|
|
+ writer.AsmWrite('('+ReplaceForbiddenAsmSymbolChars(o.ref^.symbol.name)+'+'+tostr(o.ref^.offset)+')')
|
|
else
|
|
else
|
|
- writer.AsmWrite(o.ref^.symbol.name);
|
|
|
|
|
|
+ writer.AsmWrite(ReplaceForbiddenAsmSymbolChars(o.ref^.symbol.name));
|
|
end
|
|
end
|
|
else if not assigned(o.ref^.symbol) and
|
|
else if not assigned(o.ref^.symbol) and
|
|
((o.ref^.base<>NR_NO) or (o.ref^.index<>NR_NO)) and
|
|
((o.ref^.base<>NR_NO) or (o.ref^.index<>NR_NO)) and
|
|
@@ -397,7 +397,7 @@ unit agsdasz80;
|
|
AddSymbol(o.ref^.symbol.name,false);}
|
|
AddSymbol(o.ref^.symbol.name,false);}
|
|
if need_plus then
|
|
if need_plus then
|
|
writer.AsmWrite('+');
|
|
writer.AsmWrite('+');
|
|
- writer.AsmWrite(o.ref^.symbol.name);
|
|
|
|
|
|
+ writer.AsmWrite(ReplaceForbiddenAsmSymbolChars(o.ref^.symbol.name));
|
|
need_plus:=true;
|
|
need_plus:=true;
|
|
end;
|
|
end;
|
|
if o.ref^.offset<>0 then
|
|
if o.ref^.offset<>0 then
|
|
@@ -435,7 +435,7 @@ unit agsdasz80;
|
|
end
|
|
end
|
|
else
|
|
else
|
|
begin
|
|
begin
|
|
- writer.AsmWrite(o.ref^.symbol.name);
|
|
|
|
|
|
+ writer.AsmWrite(ReplaceForbiddenAsmSymbolChars(o.ref^.symbol.name));
|
|
//if SmartAsm then
|
|
//if SmartAsm then
|
|
// AddSymbol(o.ref^.symbol.name,false);
|
|
// AddSymbol(o.ref^.symbol.name,false);
|
|
if o.ref^.offset>0 then
|
|
if o.ref^.offset>0 then
|
|
@@ -460,7 +460,7 @@ unit agsdasz80;
|
|
begin
|
|
begin
|
|
sym:=TAsmSymbol(current_asmdata.AsmSymbolDict[i]);
|
|
sym:=TAsmSymbol(current_asmdata.AsmSymbolDict[i]);
|
|
if sym.bind in [AB_EXTERNAL,AB_EXTERNAL_INDIRECT] then
|
|
if sym.bind in [AB_EXTERNAL,AB_EXTERNAL_INDIRECT] then
|
|
- writer.AsmWriteln(#9'.globl'#9+sym.name);
|
|
|
|
|
|
+ writer.AsmWriteln(#9'.globl'#9+ReplaceForbiddenAsmSymbolChars(sym.name));
|
|
end;
|
|
end;
|
|
writer.AsmWriteln('; End externals');
|
|
writer.AsmWriteln('; End externals');
|
|
end;
|
|
end;
|
|
@@ -632,7 +632,7 @@ unit agsdasz80;
|
|
begin
|
|
begin
|
|
if tai_label(hp).labsym.is_used then
|
|
if tai_label(hp).labsym.is_used then
|
|
begin
|
|
begin
|
|
- writer.AsmWrite(tai_label(hp).labsym.name);
|
|
|
|
|
|
+ writer.AsmWrite(ReplaceForbiddenAsmSymbolChars(tai_label(hp).labsym.name));
|
|
if tai_label(hp).labsym.bind in [AB_GLOBAL,AB_PRIVATE_EXTERN] then
|
|
if tai_label(hp).labsym.bind in [AB_GLOBAL,AB_PRIVATE_EXTERN] then
|
|
writer.AsmWriteLn('::')
|
|
writer.AsmWriteLn('::')
|
|
else
|
|
else
|
|
@@ -644,16 +644,16 @@ unit agsdasz80;
|
|
if not(tai_symbol(hp).has_value) then
|
|
if not(tai_symbol(hp).has_value) then
|
|
begin
|
|
begin
|
|
if tai_symbol(hp).is_global then
|
|
if tai_symbol(hp).is_global then
|
|
- writer.AsmWriteLn(tai_symbol(hp).sym.name + '::')
|
|
|
|
|
|
+ writer.AsmWriteLn(ReplaceForbiddenAsmSymbolChars(tai_symbol(hp).sym.name) + '::')
|
|
else
|
|
else
|
|
- writer.AsmWriteLn(tai_symbol(hp).sym.name + ':');
|
|
|
|
|
|
+ writer.AsmWriteLn(ReplaceForbiddenAsmSymbolChars(tai_symbol(hp).sym.name) + ':');
|
|
end
|
|
end
|
|
else
|
|
else
|
|
begin
|
|
begin
|
|
if tai_symbol(hp).is_global then
|
|
if tai_symbol(hp).is_global then
|
|
- writer.AsmWriteLn(tai_symbol(hp).sym.name + '==' + tostr(tai_symbol(hp).value))
|
|
|
|
|
|
+ writer.AsmWriteLn(ReplaceForbiddenAsmSymbolChars(tai_symbol(hp).sym.name) + '==' + tostr(tai_symbol(hp).value))
|
|
else
|
|
else
|
|
- writer.AsmWriteLn(tai_symbol(hp).sym.name + '=' + tostr(tai_symbol(hp).value));
|
|
|
|
|
|
+ writer.AsmWriteLn(ReplaceForbiddenAsmSymbolChars(tai_symbol(hp).sym.name) + '=' + tostr(tai_symbol(hp).value));
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
ait_symbol_end :
|
|
ait_symbol_end :
|
|
@@ -662,9 +662,9 @@ unit agsdasz80;
|
|
ait_datablock :
|
|
ait_datablock :
|
|
begin
|
|
begin
|
|
if tai_datablock(hp).is_global or SmartAsm then
|
|
if tai_datablock(hp).is_global or SmartAsm then
|
|
- writer.AsmWrite(tai_datablock(hp).sym.name + '::')
|
|
|
|
|
|
+ writer.AsmWrite(ReplaceForbiddenAsmSymbolChars(tai_datablock(hp).sym.name) + '::')
|
|
else
|
|
else
|
|
- writer.AsmWrite(tai_datablock(hp).sym.name + ':');
|
|
|
|
|
|
+ writer.AsmWrite(ReplaceForbiddenAsmSymbolChars(tai_datablock(hp).sym.name) + ':');
|
|
{if SmartAsm then
|
|
{if SmartAsm then
|
|
AddSymbol(tai_datablock(hp).sym.name,true);}
|
|
AddSymbol(tai_datablock(hp).sym.name,true);}
|
|
writer.AsmWriteLn(#9'.rs'#9+tostr(tai_datablock(hp).size));
|
|
writer.AsmWriteLn(#9'.rs'#9+tostr(tai_datablock(hp).size));
|
|
@@ -689,9 +689,9 @@ unit agsdasz80;
|
|
if assigned(tai_const(hp).sym) then
|
|
if assigned(tai_const(hp).sym) then
|
|
begin
|
|
begin
|
|
if assigned(tai_const(hp).endsym) then
|
|
if assigned(tai_const(hp).endsym) then
|
|
- s:=tai_const(hp).endsym.name+'-'+tai_const(hp).sym.name
|
|
|
|
|
|
+ s:=ReplaceForbiddenAsmSymbolChars(tai_const(hp).endsym.name)+'-'+ReplaceForbiddenAsmSymbolChars(tai_const(hp).sym.name)
|
|
else
|
|
else
|
|
- s:=tai_const(hp).sym.name;
|
|
|
|
|
|
+ s:=ReplaceForbiddenAsmSymbolChars(tai_const(hp).sym.name);
|
|
if tai_const(hp).value<>0 then
|
|
if tai_const(hp).value<>0 then
|
|
s:=s+tostr_with_plus(tai_const(hp).value);
|
|
s:=s+tostr_with_plus(tai_const(hp).value);
|
|
if consttype in [aitconst_64bit,aitconst_64bit_unaligned] then
|
|
if consttype in [aitconst_64bit,aitconst_64bit_unaligned] then
|
|
@@ -736,9 +736,9 @@ unit agsdasz80;
|
|
if assigned(tai_const(hp).sym) then
|
|
if assigned(tai_const(hp).sym) then
|
|
begin
|
|
begin
|
|
if assigned(tai_const(hp).endsym) then
|
|
if assigned(tai_const(hp).endsym) then
|
|
- s:=tai_const(hp).endsym.name+'-'+tai_const(hp).sym.name
|
|
|
|
|
|
+ s:=ReplaceForbiddenAsmSymbolChars(tai_const(hp).endsym.name)+'-'+ReplaceForbiddenAsmSymbolChars(tai_const(hp).sym.name)
|
|
else
|
|
else
|
|
- s:=tai_const(hp).sym.name;
|
|
|
|
|
|
+ s:=ReplaceForbiddenAsmSymbolChars(tai_const(hp).sym.name);
|
|
if tai_const(hp).value<>0 then
|
|
if tai_const(hp).value<>0 then
|
|
s:=s+tostr_with_plus(tai_const(hp).value);
|
|
s:=s+tostr_with_plus(tai_const(hp).value);
|
|
end
|
|
end
|