* store a pointer to the used tasminfo record in every assembler writer, so

that we can use assembler writers with different conventions from the
    currently set target_asm (e.g. an x86 assembler writer for inline assembly
    in LLVM IR)

git-svn-id: trunk@31628 -
This commit is contained in:
Jonas Maebe 2015-09-12 23:32:13 +00:00
parent 4bb82b0a3f
commit 991e1f49bd
21 changed files with 198 additions and 201 deletions

View File

@ -29,7 +29,7 @@ unit agcpugas;
interface interface
uses uses
globtype, globtype,systems,
aasmtai, aasmtai,
aggas, aggas,
cpubase,cpuinfo; cpubase,cpuinfo;
@ -40,11 +40,11 @@ unit agcpugas;
end; end;
TAArch64Assembler=class(TGNUassembler) TAArch64Assembler=class(TGNUassembler)
constructor create(smart: boolean); override; constructor create(info: pasminfo; smart: boolean); override;
end; end;
TAArch64AppleAssembler=class(TAppleGNUassembler) TAArch64AppleAssembler=class(TAppleGNUassembler)
constructor create(smart: boolean); override; constructor create(info: pasminfo; smart: boolean); override;
function MakeCmdLine: TCmdStr; override; function MakeCmdLine: TCmdStr; override;
end; end;
@ -65,7 +65,6 @@ unit agcpugas;
uses uses
cutils,globals,verbose, cutils,globals,verbose,
systems,
assemble, assemble,
aasmcpu, aasmcpu,
itcpugas, itcpugas,
@ -76,9 +75,9 @@ unit agcpugas;
{ AArch64 Assembler writer } { AArch64 Assembler writer }
{****************************************************************************} {****************************************************************************}
constructor TAArch64Assembler.create(smart: boolean); constructor TAArch64Assembler.create(info: pasminfo; smart: boolean);
begin begin
inherited create(smart); inherited;
InstrWriter := TAArch64InstrWriter.create(self); InstrWriter := TAArch64InstrWriter.create(self);
end; end;
@ -86,9 +85,9 @@ unit agcpugas;
{ Apple AArch64 Assembler writer } { Apple AArch64 Assembler writer }
{****************************************************************************} {****************************************************************************}
constructor TAArch64AppleAssembler.create(smart: boolean); constructor TAArch64AppleAssembler.create(info: pasminfo; smart: boolean);
begin begin
inherited create(smart); inherited;
InstrWriter := TAArch64InstrWriter.create(self); InstrWriter := TAArch64InstrWriter.create(self);
end; end;
@ -109,7 +108,7 @@ unit agcpugas;
{ Helper routines for Instruction Writer } { Helper routines for Instruction Writer }
{****************************************************************************} {****************************************************************************}
function getreferencestring(var ref : treference) : string; function getreferencestring(asminfo: pasminfo; var ref : treference) : string;
const const
darwin_addrpage2str: array[addr_page..addr_gotpageoffset] of string[11] = darwin_addrpage2str: array[addr_page..addr_gotpageoffset] of string[11] =
('@PAGE','@PAGEOFF','@GOTPAGE','@GOTPAGEOFF'); ('@PAGE','@PAGEOFF','@GOTPAGE','@GOTPAGEOFF');
@ -130,7 +129,7 @@ unit agcpugas;
(ref.shiftmode<>SM_None) or (ref.shiftmode<>SM_None) or
(ref.offset<>0) then (ref.offset<>0) then
internalerror(2014121501); internalerror(2014121501);
if target_asm.id=as_darwin then if asminfo^.id=as_darwin then
result:=ref.symbol.name+darwin_addrpage2str[ref.refaddr] result:=ref.symbol.name+darwin_addrpage2str[ref.refaddr]
else else
result:=linux_addrpage2str[ref.refaddr]+ref.symbol.name result:=linux_addrpage2str[ref.refaddr]+ref.symbol.name
@ -172,7 +171,7 @@ unit agcpugas;
addr_gotpageoffset, addr_gotpageoffset,
addr_pageoffset: addr_pageoffset:
begin begin
if target_asm.id=as_darwin then if asminfo^.id=as_darwin then
result:=result+', '+ref.symbol.name+darwin_addrpage2str[ref.refaddr] result:=result+', '+ref.symbol.name+darwin_addrpage2str[ref.refaddr]
else else
result:=result+', '+linux_addrpage2str[ref.refaddr]+ref.symbol.name result:=result+', '+linux_addrpage2str[ref.refaddr]+ref.symbol.name
@ -200,7 +199,7 @@ unit agcpugas;
end; end;
function getopstr(hp: taicpu; opnr: longint; const o: toper): string; function getopstr(asminfo: pasminfo; hp: taicpu; opnr: longint; const o: toper): string;
begin begin
case o.typ of case o.typ of
top_reg: top_reg:
@ -248,7 +247,7 @@ unit agcpugas;
getopstr:=o.ref^.symbol.name; getopstr:=o.ref^.symbol.name;
end end
else else
getopstr:=getreferencestring(o.ref^); getopstr:=getreferencestring(asminfo,o.ref^);
else else
internalerror(2014121507); internalerror(2014121507);
end; end;
@ -274,7 +273,7 @@ unit agcpugas;
// debug code // debug code
// writeln(s); // writeln(s);
// writeln(taicpu(hp).fileinfo.line); // writeln(taicpu(hp).fileinfo.line);
s:=s+sep+getopstr(taicpu(hp),i,taicpu(hp).oper[i]^); s:=s+sep+getopstr(owner.asminfo,taicpu(hp),i,taicpu(hp).oper[i]^);
sep:=','; sep:=',';
end; end;
end; end;

View File

@ -175,7 +175,7 @@ implementation
function TGNUAssembler.NextSetLabel: string; function TGNUAssembler.NextSetLabel: string;
begin begin
inc(setcount); inc(setcount);
result := target_asm.labelprefix+'$set$'+tostr(setcount); result := asminfo^.labelprefix+'$set$'+tostr(setcount);
end; end;
function is_smart_section(atype:TAsmSectiontype):boolean; function is_smart_section(atype:TAsmSectiontype):boolean;
@ -636,7 +636,7 @@ implementation
begin begin
if not assigned(p) then if not assigned(p) then
exit; exit;
replaceforbidden:=target_asm.dollarsign<>'$'; replaceforbidden:=asminfo^.dollarsign<>'$';
last_align := 2; last_align := 2;
InlineLevel:=0; InlineLevel:=0;
@ -661,7 +661,7 @@ implementation
ait_comment : ait_comment :
Begin Begin
writer.AsmWrite(target_asm.comment); writer.AsmWrite(asminfo^.comment);
writer.AsmWritePChar(tai_comment(hp).str); writer.AsmWritePChar(tai_comment(hp).str);
writer.AsmLn; writer.AsmLn;
End; End;
@ -670,7 +670,7 @@ implementation
begin begin
if (cs_asm_regalloc in current_settings.globalswitches) then if (cs_asm_regalloc in current_settings.globalswitches) then
begin begin
writer.AsmWrite(#9+target_asm.comment+'Register '); writer.AsmWrite(#9+asminfo^.comment+'Register ');
repeat repeat
writer.AsmWrite(std_regname(Tai_regalloc(hp).reg)); writer.AsmWrite(std_regname(Tai_regalloc(hp).reg));
if (hp.next=nil) or if (hp.next=nil) or
@ -706,7 +706,7 @@ implementation
else else
begin begin
{$ifdef EXTDEBUG} {$ifdef EXTDEBUG}
writer.AsmWrite(target_asm.comment); writer.AsmWrite(asminfo^.comment);
writer.AsmWriteln(' sec_none'); writer.AsmWriteln(' sec_none');
{$endif EXTDEBUG} {$endif EXTDEBUG}
end; end;
@ -1212,7 +1212,7 @@ implementation
begin begin
if tf_needs_symbol_size in target_info.flags then if tf_needs_symbol_size in target_info.flags then
begin begin
s:=target_asm.labelprefix+'e'+tostr(symendcount); s:=asminfo^.labelprefix+'e'+tostr(symendcount);
inc(symendcount); inc(symendcount);
writer.AsmWriteLn(s+':'); writer.AsmWriteLn(s+':');
writer.AsmWrite(#9'.size'#9); writer.AsmWrite(#9'.size'#9);
@ -1558,9 +1558,9 @@ implementation
begin begin
if not (current_asmdata.asmlists[hal].empty) then if not (current_asmdata.asmlists[hal].empty) then
begin begin
writer.AsmWriteLn(target_asm.comment+'Begin asmlist '+AsmlistTypeStr[hal]); writer.AsmWriteLn(asminfo^.comment+'Begin asmlist '+AsmlistTypeStr[hal]);
writetree(current_asmdata.asmlists[hal]); writetree(current_asmdata.asmlists[hal]);
writer.AsmWriteLn(target_asm.comment+'End asmlist '+AsmlistTypeStr[hal]); writer.AsmWriteLn(asminfo^.comment+'End asmlist '+AsmlistTypeStr[hal]);
end; end;
end; end;

View File

@ -29,14 +29,14 @@ unit agarmgas;
interface interface
uses uses
globtype, globtype,systems,
aasmtai, aasmtai,
aggas, aggas,
cpubase,cpuinfo; cpubase,cpuinfo;
type type
TARMGNUAssembler=class(TGNUassembler) TARMGNUAssembler=class(TGNUassembler)
constructor create(smart: boolean); override; constructor create(info: pasminfo; smart: boolean); override;
function MakeCmdLine: TCmdStr; override; function MakeCmdLine: TCmdStr; override;
procedure WriteExtraHeader; override; procedure WriteExtraHeader; override;
end; end;
@ -46,7 +46,7 @@ unit agarmgas;
end; end;
TArmAppleGNUAssembler=class(TAppleGNUassembler) TArmAppleGNUAssembler=class(TAppleGNUassembler)
constructor create(smart: boolean); override; constructor create(info: pasminfo; smart: boolean); override;
end; end;
@ -79,7 +79,6 @@ unit agarmgas;
uses uses
cutils,globals,verbose, cutils,globals,verbose,
systems,
assemble, assemble,
aasmcpu, aasmcpu,
itcpugas, itcpugas,
@ -89,9 +88,9 @@ unit agarmgas;
{ GNU Arm Assembler writer } { GNU Arm Assembler writer }
{****************************************************************************} {****************************************************************************}
constructor TArmGNUAssembler.create(smart: boolean); constructor TArmGNUAssembler.create(info: pasminfo; smart: boolean);
begin begin
inherited create(smart); inherited;
InstrWriter := TArmInstrWriter.create(self); InstrWriter := TArmInstrWriter.create(self);
end; end;
@ -135,9 +134,9 @@ unit agarmgas;
{ GNU/Apple ARM Assembler writer } { GNU/Apple ARM Assembler writer }
{****************************************************************************} {****************************************************************************}
constructor TArmAppleGNUAssembler.create(smart: boolean); constructor TArmAppleGNUAssembler.create(info: pasminfo; smart: boolean);
begin begin
inherited create(smart); inherited;
InstrWriter := TArmInstrWriter.create(self); InstrWriter := TArmInstrWriter.create(self);
end; end;

View File

@ -44,6 +44,8 @@ interface
type type
TAssembler=class(TObject) TAssembler=class(TObject)
public public
{assembler info}
asminfo : pasminfo;
{filenames} {filenames}
path : TPathStr; path : TPathStr;
name : string; name : string;
@ -54,7 +56,7 @@ interface
SmartAsm : boolean; SmartAsm : boolean;
SmartFilesCount, SmartFilesCount,
SmartHeaderCount : longint; SmartHeaderCount : longint;
Constructor Create(smart:boolean);virtual; Constructor Create(info: pasminfo; smart:boolean);virtual;
Destructor Destroy;override; Destructor Destroy;override;
procedure NextSmartName(place:tcutplace); procedure NextSmartName(place:tcutplace);
procedure MakeObject;virtual;abstract; procedure MakeObject;virtual;abstract;
@ -183,8 +185,8 @@ interface
{# Constructs the command line for calling the assembler } {# Constructs the command line for calling the assembler }
function MakeCmdLine: TCmdStr; virtual; function MakeCmdLine: TCmdStr; virtual;
public public
Constructor Create(smart:boolean);override; Constructor Create(info: pasminfo; smart: boolean);override;
Constructor CreateWithWriter(wr: TExternalAssemblerOutputFile; freewriter, smart: boolean); Constructor CreateWithWriter(info: pasminfo; wr: TExternalAssemblerOutputFile; freewriter, smart: boolean);
procedure MakeObject;override; procedure MakeObject;override;
destructor Destroy; override; destructor Destroy; override;
@ -218,7 +220,7 @@ interface
property CObjOutput:TObjOutputclass read FCObjOutput write FCObjOutput; property CObjOutput:TObjOutputclass read FCObjOutput write FCObjOutput;
property CInternalAr : TObjectWriterClass read FCInternalAr write FCInternalAr; property CInternalAr : TObjectWriterClass read FCInternalAr write FCInternalAr;
public public
constructor create(smart:boolean);override; constructor Create(info: pasminfo; smart: boolean);override;
destructor destroy;override; destructor destroy;override;
procedure MakeObject;override; procedure MakeObject;override;
end; end;
@ -274,8 +276,9 @@ Implementation
TAssembler TAssembler
*****************************************************************************} *****************************************************************************}
Constructor TAssembler.Create(smart:boolean); Constructor TAssembler.Create(info: pasminfo; smart: boolean);
begin begin
asminfo:=info;
{ load start values } { load start values }
AsmFileName:=current_module.AsmFilename; AsmFileName:=current_module.AsmFilename;
ObjFileName:=current_module.ObjFileName; ObjFileName:=current_module.ObjFileName;
@ -724,13 +727,13 @@ Implementation
begin begin
DoPipe:=(cs_asm_pipe in current_settings.globalswitches) and DoPipe:=(cs_asm_pipe in current_settings.globalswitches) and
(([cs_asm_extern,cs_asm_leave,cs_link_on_target] * current_settings.globalswitches) = []) and (([cs_asm_extern,cs_asm_leave,cs_link_on_target] * current_settings.globalswitches) = []) and
((target_asm.id in [as_gas,as_ggas,as_darwin,as_powerpc_xcoff])); ((asminfo^.id in [as_gas,as_ggas,as_darwin,as_powerpc_xcoff]));
end; end;
Constructor TExternalAssembler.Create(smart:boolean); Constructor TExternalAssembler.Create(info: pasminfo; smart: boolean);
begin begin
inherited create(smart); inherited;
if not assigned(fwriter) then if not assigned(fwriter) then
begin begin
fwriter:=TExternalAssemblerOutputFile.Create(self); fwriter:=TExternalAssemblerOutputFile.Create(self);
@ -744,11 +747,11 @@ Implementation
end; end;
constructor TExternalAssembler.CreateWithWriter(wr: TExternalAssemblerOutputFile; freewriter,smart: boolean); constructor TExternalAssembler.CreateWithWriter(info: pasminfo; wr: TExternalAssemblerOutputFile; freewriter,smart: boolean);
begin begin
fwriter:=wr; fwriter:=wr;
ffreewriter:=freewriter; ffreewriter:=freewriter;
Create(smart); Create(info,smart);
end; end;
@ -802,14 +805,14 @@ Implementation
if cs_link_on_target in current_settings.globalswitches then if cs_link_on_target in current_settings.globalswitches then
begin begin
{ If linking on target, don't add any path PM } { If linking on target, don't add any path PM }
FindAssembler:=utilsprefix+ChangeFileExt(target_asm.asmbin,target_info.exeext); FindAssembler:=utilsprefix+ChangeFileExt(asminfo^.asmbin,target_info.exeext);
exit; exit;
end end
else else
UtilExe:=utilsprefix+ChangeFileExt(target_asm.asmbin,source_info.exeext); UtilExe:=utilsprefix+ChangeFileExt(asminfo^.asmbin,source_info.exeext);
if lastas<>ord(target_asm.id) then if lastas<>ord(asminfo^.id) then
begin begin
lastas:=ord(target_asm.id); lastas:=ord(asminfo^.id);
{ is an assembler passed ? } { is an assembler passed ? }
if utilsdirectory<>'' then if utilsdirectory<>'' then
asfound:=FindFile(UtilExe,utilsdirectory,false,LastASBin); asfound:=FindFile(UtilExe,utilsdirectory,false,LastASBin);
@ -886,7 +889,7 @@ Implementation
function TExternalAssembler.MakeCmdLine: TCmdStr; function TExternalAssembler.MakeCmdLine: TCmdStr;
begin begin
result:=target_asm.asmcmd; result:=asminfo^.asmcmd;
{$ifdef arm} {$ifdef arm}
if (target_info.system=system_arm_darwin) then if (target_info.system=system_arm_darwin) then
Replace(result,'$ARCH',lower(cputypestr[current_settings.cputype])); Replace(result,'$ARCH',lower(cputypestr[current_settings.cputype]));
@ -955,7 +958,7 @@ Implementation
begin begin
if (infile<>lastinfile) then if (infile<>lastinfile) then
begin begin
writer.AsmWriteLn(target_asm.comment+'['+infile.name+']'); writer.AsmWriteLn(asminfo^.comment+'['+infile.name+']');
if assigned(lastinfile) then if assigned(lastinfile) then
lastinfile.close; lastinfile.close;
end; end;
@ -964,7 +967,7 @@ Implementation
begin begin
if (hp.fileinfo.line<>0) and if (hp.fileinfo.line<>0) and
(infile.linebuf^[hp.fileinfo.line]>=0) then (infile.linebuf^[hp.fileinfo.line]>=0) then
writer.AsmWriteLn(target_asm.comment+'['+tostr(hp.fileinfo.line)+'] '+ writer.AsmWriteLn(asminfo^.comment+'['+tostr(hp.fileinfo.line)+'] '+
fixline(infile.GetLineStr(hp.fileinfo.line))); fixline(infile.GetLineStr(hp.fileinfo.line)));
{ set it to a negative value ! { set it to a negative value !
to make that is has been read already !! PM } to make that is has been read already !! PM }
@ -980,11 +983,11 @@ Implementation
begin begin
{$ifdef EXTDEBUG} {$ifdef EXTDEBUG}
if assigned(hp.problem) then if assigned(hp.problem) then
writer.AsmWriteLn(target_asm.comment+'Temp '+tostr(hp.temppos)+','+ writer.AsmWriteLn(asminfo^.comment+'Temp '+tostr(hp.temppos)+','+
tostr(hp.tempsize)+' '+hp.problem^) tostr(hp.tempsize)+' '+hp.problem^)
else else
{$endif EXTDEBUG} {$endif EXTDEBUG}
writer.AsmWriteLn(target_asm.comment+'Temp '+tostr(hp.temppos)+','+ writer.AsmWriteLn(asminfo^.comment+'Temp '+tostr(hp.temppos)+','+
tostr(hp.tempsize)+' '+tempallocstr[hp.allocation]); tostr(hp.tempsize)+' '+tempallocstr[hp.allocation]);
end; end;
@ -1004,16 +1007,16 @@ Implementation
begin begin
case tai_realconst(hp).realtyp of case tai_realconst(hp).realtyp of
aitrealconst_s32bit: aitrealconst_s32bit:
writer.AsmWriteLn(target_asm.comment+'value: '+single2str(tai_realconst(hp).value.s32val)); writer.AsmWriteLn(asminfo^.comment+'value: '+single2str(tai_realconst(hp).value.s32val));
aitrealconst_s64bit: aitrealconst_s64bit:
writer.AsmWriteLn(target_asm.comment+'value: '+double2str(tai_realconst(hp).value.s64val)); writer.AsmWriteLn(asminfo^.comment+'value: '+double2str(tai_realconst(hp).value.s64val));
{$if defined(cpuextended) and defined(FPC_HAS_TYPE_EXTENDED)} {$if defined(cpuextended) and defined(FPC_HAS_TYPE_EXTENDED)}
{ can't write full 80 bit floating point constants yet on non-x86 } { can't write full 80 bit floating point constants yet on non-x86 }
aitrealconst_s80bit: aitrealconst_s80bit:
writer.AsmWriteLn(target_asm.comment+'value: '+extended2str(tai_realconst(hp).value.s80val)); writer.AsmWriteLn(asminfo^.comment+'value: '+extended2str(tai_realconst(hp).value.s80val));
{$endif cpuextended} {$endif cpuextended}
aitrealconst_s64comp: aitrealconst_s64comp:
writer.AsmWriteLn(target_asm.comment+'value: '+extended2str(tai_realconst(hp).value.s64compval)); writer.AsmWriteLn(asminfo^.comment+'value: '+extended2str(tai_realconst(hp).value.s64compval));
else else
internalerror(2014050604); internalerror(2014050604);
end; end;
@ -1127,9 +1130,9 @@ Implementation
TInternalAssembler TInternalAssembler
*****************************************************************************} *****************************************************************************}
constructor TInternalAssembler.create(smart:boolean); constructor TInternalAssembler.Create(info: pasminfo; smart: boolean);
begin begin
inherited create(smart); inherited;
ObjOutput:=nil; ObjOutput:=nil;
ObjData:=nil; ObjData:=nil;
SmartAsm:=smart; SmartAsm:=smart;
@ -2007,7 +2010,7 @@ Implementation
startsecorder: TAsmSectionOrder; startsecorder: TAsmSectionOrder;
begin begin
if not(cs_asm_leave in current_settings.globalswitches) and if not(cs_asm_leave in current_settings.globalswitches) and
not(af_needar in target_asm.flags) then not(af_needar in asminfo^.flags) then
ObjWriter:=CInternalAr.CreateAr(current_module.staticlibfilename) ObjWriter:=CInternalAr.CreateAr(current_module.staticlibfilename)
else else
ObjWriter:=TObjectwriter.create; ObjWriter:=TObjectwriter.create;
@ -2151,7 +2154,7 @@ Implementation
begin begin
if not assigned(CAssembler[target_asm.id]) then if not assigned(CAssembler[target_asm.id]) then
Message(asmw_f_assembler_output_not_supported); Message(asmw_f_assembler_output_not_supported);
a:=CAssembler[target_asm.id].Create(smart); a:=CAssembler[target_asm.id].Create(@target_asm,smart);
a.MakeObject; a.MakeObject;
a.Free; a.Free;
end; end;

View File

@ -29,7 +29,7 @@ unit agavrgas;
interface interface
uses uses
globtype, globtype,systems,
aasmtai,aasmdata, aasmtai,aasmdata,
aggas, aggas,
cpubase; cpubase;
@ -39,7 +39,7 @@ unit agavrgas;
{ TAVRGNUAssembler } { TAVRGNUAssembler }
TAVRGNUAssembler=class(TGNUassembler) TAVRGNUAssembler=class(TGNUassembler)
constructor create(smart: boolean); override; constructor create(info: pasminfo; smart: boolean); override;
function MakeCmdLine: TCmdStr; override; function MakeCmdLine: TCmdStr; override;
end; end;
@ -52,7 +52,6 @@ unit agavrgas;
uses uses
cutils,globals,verbose, cutils,globals,verbose,
systems,
assemble, assemble,
aasmbase,aasmcpu, aasmbase,aasmcpu,
itcpugas, itcpugas,
@ -63,9 +62,9 @@ unit agavrgas;
{ GNU Arm Assembler writer } { GNU Arm Assembler writer }
{****************************************************************************} {****************************************************************************}
constructor TAVRGNUAssembler.create(smart: boolean); constructor TAVRGNUAssembler.create(info: pasminfo; smart: boolean);
begin begin
inherited create(smart); inherited;
InstrWriter := TAVRInstrWriter.create(self); InstrWriter := TAVRInstrWriter.create(self);
end; end;

View File

@ -28,7 +28,7 @@ unit agjasmin;
interface interface
uses uses
cclasses, cclasses,systems,
globtype,globals, globtype,globals,
symconst,symbase,symdef,symsym, symconst,symbase,symdef,symsym,
aasmbase,aasmtai,aasmdata,aasmcpu, aasmbase,aasmtai,aasmdata,aasmcpu,
@ -70,7 +70,7 @@ interface
procedure WriteSymtableProcdefs(st: TSymtable); procedure WriteSymtableProcdefs(st: TSymtable);
procedure WriteSymtableStructDefs(st: TSymtable); procedure WriteSymtableStructDefs(st: TSymtable);
public public
constructor Create(smart: boolean); override; constructor Create(info: pasminfo; smart: boolean); override;
function MakeCmdLine: TCmdStr;override; function MakeCmdLine: TCmdStr;override;
procedure WriteTree(p:TAsmList);override; procedure WriteTree(p:TAsmList);override;
procedure WriteAsmList;override; procedure WriteAsmList;override;
@ -101,7 +101,7 @@ implementation
uses uses
SysUtils, SysUtils,
cutils,cfileutl,systems,script, cutils,cfileutl,script,
fmodule,finput,verbose, fmodule,finput,verbose,
symtype,symcpu,symtable,jvmdef, symtype,symcpu,symtable,jvmdef,
itcpujas,cpubase,cpuinfo,cgutils, itcpujas,cpubase,cpuinfo,cgutils,
@ -336,7 +336,7 @@ implementation
begin begin
if (infile<>lastinfile) then if (infile<>lastinfile) then
begin begin
writer.AsmWriteLn(target_asm.comment+'['+infile.name+']'); writer.AsmWriteLn(asminfo^.comment+'['+infile.name+']');
if assigned(lastinfile) then if assigned(lastinfile) then
lastinfile.close; lastinfile.close;
end; end;
@ -345,7 +345,7 @@ implementation
begin begin
if (hp1.fileinfo.line<>0) and if (hp1.fileinfo.line<>0) and
((infile.linebuf^[hp1.fileinfo.line]>=0) or (InlineLevel>0)) then ((infile.linebuf^[hp1.fileinfo.line]>=0) or (InlineLevel>0)) then
writer.AsmWriteLn(target_asm.comment+'['+tostr(hp1.fileinfo.line)+'] '+ writer.AsmWriteLn(asminfo^.comment+'['+tostr(hp1.fileinfo.line)+'] '+
fixline(infile.GetLineStr(hp1.fileinfo.line))); fixline(infile.GetLineStr(hp1.fileinfo.line)));
{ set it to a negative value ! { set it to a negative value !
to make that is has been read already !! PM } to make that is has been read already !! PM }
@ -362,7 +362,7 @@ implementation
ait_comment : ait_comment :
Begin Begin
writer.AsmWrite(target_asm.comment); writer.AsmWrite(asminfo^.comment);
writer.AsmWritePChar(tai_comment(hp).str); writer.AsmWritePChar(tai_comment(hp).str);
writer.AsmLn; writer.AsmLn;
End; End;
@ -371,7 +371,7 @@ implementation
begin begin
if (cs_asm_regalloc in current_settings.globalswitches) then if (cs_asm_regalloc in current_settings.globalswitches) then
begin begin
writer.AsmWrite(#9+target_asm.comment+'Register '); writer.AsmWrite(#9+asminfo^.comment+'Register ');
repeat repeat
writer.AsmWrite(std_regname(Tai_regalloc(hp).reg)); writer.AsmWrite(std_regname(Tai_regalloc(hp).reg));
if (hp.next=nil) or if (hp.next=nil) or
@ -392,11 +392,11 @@ implementation
begin begin
{$ifdef EXTDEBUG} {$ifdef EXTDEBUG}
if assigned(tai_tempalloc(hp).problem) then if assigned(tai_tempalloc(hp).problem) then
writer.AsmWriteLn(target_asm.comment+'Temp '+tostr(tai_tempalloc(hp).temppos)+','+ writer.AsmWriteLn(asminfo^.comment+'Temp '+tostr(tai_tempalloc(hp).temppos)+','+
tostr(tai_tempalloc(hp).tempsize)+' '+tai_tempalloc(hp).problem^) tostr(tai_tempalloc(hp).tempsize)+' '+tai_tempalloc(hp).problem^)
else else
{$endif EXTDEBUG} {$endif EXTDEBUG}
writer.AsmWriteLn(target_asm.comment+'Temp '+tostr(tai_tempalloc(hp).temppos)+','+ writer.AsmWriteLn(asminfo^.comment+'Temp '+tostr(tai_tempalloc(hp).temppos)+','+
tostr(tai_tempalloc(hp).tempsize)+' '+tempallocstr[tai_tempalloc(hp).allocation]); tostr(tai_tempalloc(hp).tempsize)+' '+tempallocstr[tai_tempalloc(hp).allocation]);
end; end;
end; end;
@ -686,7 +686,7 @@ implementation
if jasminjarfound then if jasminjarfound then
Message1(exec_t_using_assembler,jasminjar); Message1(exec_t_using_assembler,jasminjar);
end; end;
result:=target_asm.asmcmd; result:=asminfo^.asmcmd;
filenames:=ScriptFixFileName(AsmFileName); filenames:=ScriptFixFileName(AsmFileName);
if cs_asm_extern in current_settings.globalswitches then if cs_asm_extern in current_settings.globalswitches then
filenames:=maybequoted(filenames); filenames:=maybequoted(filenames);
@ -1078,9 +1078,9 @@ implementation
nestedstructs.free; nestedstructs.free;
end; end;
constructor TJasminAssembler.Create(smart: boolean); constructor TJasminAssembler.Create(info: pasminfo; smart: boolean);
begin begin
inherited CreateWithWriter(TJasminAssemblerOutputFile.Create(self),true,smart); inherited CreateWithWriter(info,TJasminAssemblerOutputFile.Create(self),true,smart);
InstrWriter:=TJasminInstrWriter.Create(self); InstrWriter:=TJasminInstrWriter.Create(self);
asmfiles:=TCmdStrList.Create; asmfiles:=TCmdStrList.Create;
end; end;
@ -1098,9 +1098,9 @@ implementation
(* (*
for hal:=low(TasmlistType) to high(TasmlistType) do for hal:=low(TasmlistType) to high(TasmlistType) do
begin begin
writer.AsmWriteLn(target_asm.comment+'Begin asmlist '+AsmlistTypeStr[hal]); writer.AsmWriteLn(asminfo^.comment+'Begin asmlist '+AsmlistTypeStr[hal]);
writetree(current_asmdata.asmlists[hal]); writetree(current_asmdata.asmlists[hal]);
writer.AsmWriteLn(target_asm.comment+'End asmlist '+AsmlistTypeStr[hal]); writer.AsmWriteLn(asminfo^.comment+'End asmlist '+AsmlistTypeStr[hal]);
end; end;
*) *)
{ print all global variables } { print all global variables }

View File

@ -26,7 +26,7 @@ unit agllvm;
interface interface
uses uses
globtype,globals, globtype,globals,systems,
aasmbase,aasmtai,aasmdata, aasmbase,aasmtai,aasmdata,
assemble; assemble;
@ -46,7 +46,7 @@ interface
procedure WriteOrdConst(hp: tai_const); procedure WriteOrdConst(hp: tai_const);
procedure WriteTai(const replaceforbidden: boolean; const do_line: boolean; var InlineLevel: cardinal; var asmblock: boolean; var hp: tai); procedure WriteTai(const replaceforbidden: boolean; const do_line: boolean; var InlineLevel: cardinal; var asmblock: boolean; var hp: tai);
public public
constructor create(smart: boolean); override; constructor create(info: pasminfo; smart: boolean); override;
function MakeCmdLine: TCmdStr; override; function MakeCmdLine: TCmdStr; override;
procedure WriteTree(p:TAsmList);override; procedure WriteTree(p:TAsmList);override;
procedure WriteAsmList;override; procedure WriteAsmList;override;
@ -77,7 +77,7 @@ implementation
uses uses
SysUtils, SysUtils,
cutils,cfileutl,systems, cutils,cfileutl,
fmodule,verbose, fmodule,verbose,
aasmcnst,symconst,symdef,symtable, aasmcnst,symconst,symdef,symtable,
llvmbase,aasmllvm,itllvm,llvmdef, llvmbase,aasmllvm,itllvm,llvmdef,
@ -519,7 +519,7 @@ implementation
begin begin
if not assigned(p) then if not assigned(p) then
exit; exit;
replaceforbidden:=target_asm.dollarsign<>'$'; replaceforbidden:=asminfo^.dollarsign<>'$';
InlineLevel:=0; InlineLevel:=0;
asmblock:=false; asmblock:=false;
@ -580,16 +580,16 @@ implementation
begin begin
case tai_realconst(hp).realtyp of case tai_realconst(hp).realtyp of
aitrealconst_s32bit: aitrealconst_s32bit:
writer.AsmWriteLn(target_asm.comment+'value: '+single2str(tai_realconst(hp).value.s32val)); writer.AsmWriteLn(asminfo^.comment+'value: '+single2str(tai_realconst(hp).value.s32val));
aitrealconst_s64bit: aitrealconst_s64bit:
writer.AsmWriteLn(target_asm.comment+'value: '+double2str(tai_realconst(hp).value.s64val)); writer.AsmWriteLn(asminfo^.comment+'value: '+double2str(tai_realconst(hp).value.s64val));
{$if defined(cpuextended) and defined(FPC_HAS_TYPE_EXTENDED)} {$if defined(cpuextended) and defined(FPC_HAS_TYPE_EXTENDED)}
{ can't write full 80 bit floating point constants yet on non-x86 } { can't write full 80 bit floating point constants yet on non-x86 }
aitrealconst_s80bit: aitrealconst_s80bit:
writer.AsmWriteLn(target_asm.comment+'value: '+extended2str(tai_realconst(hp).value.s80val)); writer.AsmWriteLn(asminfo^.comment+'value: '+extended2str(tai_realconst(hp).value.s80val));
{$endif cpuextended} {$endif cpuextended}
aitrealconst_s64comp: aitrealconst_s64comp:
writer.AsmWriteLn(target_asm.comment+'value: '+extended2str(tai_realconst(hp).value.s64compval)); writer.AsmWriteLn(asminfo^.comment+'value: '+extended2str(tai_realconst(hp).value.s64compval));
else else
internalerror(2014050604); internalerror(2014050604);
end; end;
@ -617,7 +617,7 @@ implementation
consttyp: taiconst_type; consttyp: taiconst_type;
begin begin
if fdecllevel=0 then if fdecllevel=0 then
writer.AsmWrite(target_asm.comment+' const '); writer.AsmWrite(asminfo^.comment+' const ');
consttyp:=hp.consttype; consttyp:=hp.consttype;
case consttyp of case consttyp of
aitconst_got, aitconst_got,
@ -641,7 +641,7 @@ implementation
aitconst_64bit_unaligned: aitconst_64bit_unaligned:
begin begin
if fdecllevel=0 then if fdecllevel=0 then
writer.AsmWrite(target_asm.comment); writer.AsmWrite(asminfo^.comment);
{ can't have compile-time differences between symbols; these are { can't have compile-time differences between symbols; these are
normally for PIC, but llvm takes care of that for us } normally for PIC, but llvm takes care of that for us }
if assigned(hp.endsym) then if assigned(hp.endsym) then
@ -758,7 +758,7 @@ implementation
case hp.typ of case hp.typ of
ait_comment : ait_comment :
begin begin
writer.AsmWrite(target_asm.comment); writer.AsmWrite(asminfo^.comment);
writer.AsmWritePChar(tai_comment(hp).str); writer.AsmWritePChar(tai_comment(hp).str);
if fdecllevel<>0 then if fdecllevel<>0 then
internalerror(2015090601); internalerror(2015090601);
@ -769,7 +769,7 @@ implementation
begin begin
if (cs_asm_regalloc in current_settings.globalswitches) then if (cs_asm_regalloc in current_settings.globalswitches) then
begin begin
writer.AsmWrite(#9+target_asm.comment+'Register '); writer.AsmWrite(#9+asminfo^.comment+'Register ');
repeat repeat
writer.AsmWrite(std_regname(Tai_regalloc(hp).reg)); writer.AsmWrite(std_regname(Tai_regalloc(hp).reg));
if (hp.next=nil) or if (hp.next=nil) or
@ -800,7 +800,7 @@ implementation
ait_datablock : ait_datablock :
begin begin
writer.AsmWrite(target_asm.comment); writer.AsmWrite(asminfo^.comment);
writer.AsmWriteln('datablock'); writer.AsmWriteln('datablock');
end; end;
@ -817,7 +817,7 @@ implementation
ait_string : ait_string :
begin begin
if fdecllevel=0 then if fdecllevel=0 then
writer.AsmWrite(target_asm.comment); writer.AsmWrite(asminfo^.comment);
writer.AsmWrite('c"'); writer.AsmWrite('c"');
for i:=1 to tai_string(hp).len do for i:=1 to tai_string(hp).len do
begin begin
@ -850,7 +850,7 @@ implementation
begin begin
{ should be emitted as part of the variable/function def } { should be emitted as part of the variable/function def }
//internalerror(2013010704); //internalerror(2013010704);
writer.AsmWriteln(target_asm.comment+'global/privateextern label: '+tai_label(hp).labsym.name); writer.AsmWriteln(asminfo^.comment+'global/privateextern label: '+tai_label(hp).labsym.name);
end; end;
if replaceforbidden then if replaceforbidden then
writer.AsmWrite(ReplaceForbiddenAsmSymbolChars(tai_label(hp).labsym.name)) writer.AsmWrite(ReplaceForbiddenAsmSymbolChars(tai_label(hp).labsym.name))
@ -863,7 +863,7 @@ implementation
ait_symbol : ait_symbol :
begin begin
if fdecllevel=0 then if fdecllevel=0 then
writer.AsmWrite(target_asm.comment); writer.AsmWrite(asminfo^.comment);
writer.AsmWriteln(LlvmAsmSymName(tai_symbol(hp).sym)); writer.AsmWriteln(LlvmAsmSymName(tai_symbol(hp).sym));
{ todo } { todo }
if tai_symbol(hp).has_value then if tai_symbol(hp).has_value then
@ -1056,9 +1056,9 @@ implementation
end; end;
constructor TLLVMAssember.create(smart: boolean); constructor TLLVMAssember.create(info: pasminfo; smart: boolean);
begin begin
inherited create(smart); inherited;
InstrWriter:=TLLVMInstrWriter.create(self); InstrWriter:=TLLVMInstrWriter.create(self);
end; end;

View File

@ -26,13 +26,13 @@ unit ag68kgas;
interface interface
uses uses
cclasses,cpubase, cclasses,cpubase,systems,
globals,globtype, globals,globtype,
aasmbase,aasmtai,aasmdata,aasmcpu,assemble,aggas; aasmbase,aasmtai,aasmdata,aasmcpu,assemble,aggas;
type type
Tm68kGNUAssembler=class(TGNUassembler) Tm68kGNUAssembler=class(TGNUassembler)
constructor create(smart: boolean); override; constructor create(info: pasminfo; smart: boolean); override;
function MakeCmdLine : TCmdStr; override; function MakeCmdLine : TCmdStr; override;
end; end;
@ -49,7 +49,7 @@ interface
implementation implementation
uses uses
cutils,systems, cutils,
cgbase,cgutils,cpuinfo, cgbase,cgutils,cpuinfo,
verbose,itcpugas; verbose,itcpugas;
@ -58,9 +58,9 @@ interface
{ GNU m68k Assembler writer } { GNU m68k Assembler writer }
{****************************************************************************} {****************************************************************************}
constructor Tm68kGNUAssembler.create(smart: boolean); constructor Tm68kGNUAssembler.create(info: pasminfo; smart: boolean);
begin begin
inherited create(smart); inherited;
InstrWriter := Tm68kInstrWriter.create(self); InstrWriter := Tm68kInstrWriter.create(self);
end; end;

View File

@ -26,13 +26,13 @@ unit cpugas;
interface interface
uses uses
cpubase, aasmbase, globtype, cpubase, aasmbase, globtype, systems,
aasmtai, aasmcpu, assemble, aggas; aasmtai, aasmcpu, assemble, aggas;
type type
TMIPSGNUAssembler = class(TGNUassembler) TMIPSGNUAssembler = class(TGNUassembler)
nomacro, noreorder, noat : boolean; nomacro, noreorder, noat : boolean;
constructor create(smart: boolean); override; constructor create(info: pasminfo; smart: boolean); override;
{# Constructs the command line for calling the assembler } {# Constructs the command line for calling the assembler }
function MakeCmdLine: TCmdStr; override; function MakeCmdLine: TCmdStr; override;
end; end;
@ -52,7 +52,7 @@ unit cpugas;
implementation implementation
uses uses
cutils, systems, cpuinfo, cutils, cpuinfo,
globals, verbose, itcpugas, cgbase, cgutils; globals, verbose, itcpugas, cgbase, cgutils;
@ -69,10 +69,10 @@ unit cpugas;
{ GNU MIPS Assembler writer } { GNU MIPS Assembler writer }
{****************************************************************************} {****************************************************************************}
constructor TMIPSGNUAssembler.create(smart: boolean); constructor TMIPSGNUAssembler.create(info: pasminfo; smart: boolean);
begin begin
inherited create(smart); inherited;
InstrWriter := TMIPSInstrWriter.create(self); InstrWriter:=TMIPSInstrWriter.create(self);
nomacro:=false; nomacro:=false;
noreorder:=false; noreorder:=false;
noat:=false; noat:=false;

View File

@ -243,11 +243,11 @@ interface
TObjSectionArray = array[0..high(smallint)] of TObjSection; TObjSectionArray = array[0..high(smallint)] of TObjSection;
TDJCoffAssembler = class(tinternalassembler) TDJCoffAssembler = class(tinternalassembler)
constructor create(smart:boolean);override; constructor create(info: pasminfo; smart:boolean);override;
end; end;
TPECoffassembler = class(tinternalassembler) TPECoffassembler = class(tinternalassembler)
constructor create(smart:boolean);override; constructor create(info: pasminfo; smart:boolean);override;
end; end;
@ -2843,9 +2843,9 @@ const pemagic : array[0..3] of byte = (
TDJCoffAssembler TDJCoffAssembler
****************************************************************************} ****************************************************************************}
constructor TDJCoffAssembler.Create(smart:boolean); constructor TDJCoffAssembler.Create(info: pasminfo; smart:boolean);
begin begin
inherited Create(smart); inherited;
CObjOutput:=TDJCoffObjOutput; CObjOutput:=TDJCoffObjOutput;
CInternalAr:=tarobjectwriter; CInternalAr:=tarobjectwriter;
end; end;
@ -2855,9 +2855,9 @@ const pemagic : array[0..3] of byte = (
TPECoffAssembler TPECoffAssembler
****************************************************************************} ****************************************************************************}
constructor TPECoffAssembler.Create(smart:boolean); constructor TPECoffAssembler.Create(info: pasminfo; smart:boolean);
begin begin
inherited Create(smart); inherited;
CObjOutput:=TPECoffObjOutput; CObjOutput:=TPECoffObjOutput;
CInternalAr:=tarobjectwriter; CInternalAr:=tarobjectwriter;
end; end;

View File

@ -104,7 +104,7 @@ interface
end; end;
TElfAssembler = class(tinternalassembler) TElfAssembler = class(tinternalassembler)
constructor create(smart:boolean);override; constructor create(info: pasminfo; smart:boolean);override;
end; end;
PSectionRec=^TSectionRec; PSectionRec=^TSectionRec;
@ -1301,9 +1301,9 @@ implementation
TELFAssembler TELFAssembler
****************************************************************************} ****************************************************************************}
constructor TElfAssembler.Create(smart:boolean); constructor TElfAssembler.Create(info: pasminfo; smart:boolean);
begin begin
inherited Create(smart); inherited;
CObjOutput:=TElfObjectOutput; CObjOutput:=TElfObjectOutput;
CInternalAr:=tarobjectwriter; CInternalAr:=tarobjectwriter;
end; end;

View File

@ -146,7 +146,7 @@ type
TMachoAssembler=class(TInternalAssembler) TMachoAssembler=class(TInternalAssembler)
public public
constructor create(smart:boolean);override; constructor create(info: pasminfo; smart:boolean);override;
end; end;
@ -354,9 +354,9 @@ uses
{ TMachoAssembler } { TMachoAssembler }
constructor TMachoAssembler.create(smart: boolean); constructor TMachoAssembler.create(info: pasminfo; smart: boolean);
begin begin
inherited create(smart); inherited;
CObjOutput:=TMachoObjectOutput; CObjOutput:=TMachoObjectOutput;
CInternalAr:=tarobjectwriter; CInternalAr:=tarobjectwriter;
end; end;

View File

@ -302,7 +302,7 @@ const NLM_MAX_DESCRIPTION_LENGTH = 127;
end; end;
TNLMCoffassembler = class(tinternalassembler) TNLMCoffassembler = class(tinternalassembler)
constructor create(smart:boolean);override; constructor create(info: pasminfo; smart:boolean);override;
end; end;
TNLMCoffObjData = class(TCoffObjData) TNLMCoffObjData = class(TCoffObjData)
@ -1471,9 +1471,9 @@ function SecOpts(SecOptions:TObjSectionOptions):string;
TDJCoffAssembler TDJCoffAssembler
****************************************************************************} ****************************************************************************}
constructor TNLMCoffAssembler.Create(smart:boolean); constructor TNLMCoffAssembler.Create(info: pasminfo; smart:boolean);
begin begin
inherited Create(smart); inherited;
CObjOutput:=TNLMCoffObjOutput; CObjOutput:=TNLMCoffObjOutput;
CInternalAr:=tarobjectwriter; CInternalAr:=tarobjectwriter;
end; end;

View File

@ -304,7 +304,7 @@ interface
end; end;
TOmfAssembler = class(tinternalassembler) TOmfAssembler = class(tinternalassembler)
constructor create(smart:boolean);override; constructor create(info: pasminfo; smart:boolean);override;
end; end;
implementation implementation
@ -2534,9 +2534,9 @@ implementation
TOmfAssembler TOmfAssembler
****************************************************************************} ****************************************************************************}
constructor TOmfAssembler.Create(smart:boolean); constructor TOmfAssembler.Create(info: pasminfo; smart:boolean);
begin begin
inherited Create(smart); inherited;
CObjOutput:=TOmfObjOutput; CObjOutput:=TOmfObjOutput;
CInternalAr:=TOmfLibObjectWriter; CInternalAr:=TOmfLibObjectWriter;
end; end;

View File

@ -734,7 +734,7 @@ interface
case hp.typ of case hp.typ of
ait_comment: ait_comment:
begin begin
writer.AsmWrite(target_asm.comment); writer.AsmWrite(asminfo^.comment);
writer.AsmWritePChar(tai_comment(hp).str); writer.AsmWritePChar(tai_comment(hp).str);
writer.AsmLn; writer.AsmLn;
end; end;
@ -744,7 +744,7 @@ interface
ait_section: ait_section:
begin begin
{if LastSecType<>sec_none then {if LastSecType<>sec_none then
writer.AsmWriteLn('_'+target_asm.secnames[LastSecType]+#9#9'ENDS');} writer.AsmWriteLn('_'+asminfo^.secnames[LastSecType]+#9#9'ENDS');}
if tai_section(hp).sectype<>sec_none then if tai_section(hp).sectype<>sec_none then
begin begin
@ -911,7 +911,7 @@ interface
(* (*
ait_real_64bit : ait_real_64bit :
begin begin
writer.AsmWriteLn(target_asm.comment+'value: '+double2str(tai_real_64bit(hp).value)); writer.AsmWriteLn(asminfo^.comment+'value: '+double2str(tai_real_64bit(hp).value));
d:=tai_real_64bit(hp).value; d:=tai_real_64bit(hp).value;
{ swap the values to correct endian if required } { swap the values to correct endian if required }
if source_info.endian <> target_info.endian then if source_info.endian <> target_info.endian then
@ -930,7 +930,7 @@ interface
ait_real_32bit : ait_real_32bit :
begin begin
writer.AsmWriteLn(target_asm.comment+'value: '+single2str(tai_real_32bit(hp).value)); writer.AsmWriteLn(asminfo^.comment+'value: '+single2str(tai_real_32bit(hp).value));
sin:=tai_real_32bit(hp).value; sin:=tai_real_32bit(hp).value;
{ swap the values to correct endian if required } { swap the values to correct endian if required }
if source_info.endian <> target_info.endian then if source_info.endian <> target_info.endian then
@ -1221,9 +1221,9 @@ interface
for hal:=low(TasmlistType) to high(TasmlistType) do for hal:=low(TasmlistType) to high(TasmlistType) do
begin begin
writer.AsmWriteLn(target_asm.comment+'Begin asmlist '+AsmListTypeStr[hal]); writer.AsmWriteLn(asminfo^.comment+'Begin asmlist '+AsmListTypeStr[hal]);
writetree(current_asmdata.asmlists[hal]); writetree(current_asmdata.asmlists[hal]);
writer.AsmWriteLn(target_asm.comment+'End asmlist '+AsmListTypeStr[hal]); writer.AsmWriteLn(asminfo^.comment+'End asmlist '+AsmListTypeStr[hal]);
end; end;
writer.AsmWriteLn(#9'end'); writer.AsmWriteLn(#9'end');

View File

@ -31,7 +31,7 @@ unit agppcvasm;
interface interface
uses uses
aasmbase, aasmbase,systems,
aasmtai,aasmdata, aasmtai,aasmdata,
aggas, aggas,
cpubase,cgutils, cpubase,cgutils,
@ -43,7 +43,7 @@ unit agppcvasm;
end; end;
TPPCVASM=class(TGNUassembler) TPPCVASM=class(TGNUassembler)
constructor create(smart: boolean); override; constructor create(info: pasminfo; smart: boolean); override;
function MakeCmdLine: TCmdStr; override; function MakeCmdLine: TCmdStr; override;
end; end;
@ -59,7 +59,7 @@ unit agppcvasm;
uses uses
cutils,cfileutl,globals,verbose, cutils,cfileutl,globals,verbose,
cgbase,systems, cgbase,
assemble,script, assemble,script,
itcpugas,cpuinfo, itcpugas,cpuinfo,
aasmcpu; aasmcpu;
@ -359,15 +359,15 @@ unit agppcvasm;
{****************************************************************************} {****************************************************************************}
constructor TPPCVASM.create(smart: boolean); constructor TPPCVASM.create(info: pasminfo; smart: boolean);
begin begin
inherited create(smart); inherited;
InstrWriter := TPPCInstrWriter.create(self); InstrWriter := TPPCInstrWriter.create(self);
end; end;
function TPPCVASM.MakeCmdLine: TCmdStr; function TPPCVASM.MakeCmdLine: TCmdStr;
begin begin
result:=target_asm.asmcmd; result:=asminfo^.asmcmd;
if (cs_link_on_target in current_settings.globalswitches) then if (cs_link_on_target in current_settings.globalswitches) then
begin begin

View File

@ -31,7 +31,7 @@ unit agppcgas;
interface interface
uses uses
aasmbase, systems,aasmbase,
aasmtai,aasmdata, aasmtai,aasmdata,
aggas, aggas,
cpubase,cgutils, cpubase,cgutils,
@ -43,17 +43,17 @@ unit agppcgas;
end; end;
TPPCGNUAssembler=class(TGNUassembler) TPPCGNUAssembler=class(TGNUassembler)
constructor create(smart: boolean); override; constructor create(info: pasminfo; smart: boolean); override;
procedure WriteExtraHeader; override; procedure WriteExtraHeader; override;
end; end;
TPPCAppleGNUAssembler=class(TAppleGNUassembler) TPPCAppleGNUAssembler=class(TAppleGNUassembler)
constructor create(smart: boolean); override; constructor create(info: pasminfo; smart: boolean); override;
function MakeCmdLine: TCmdStr; override; function MakeCmdLine: TCmdStr; override;
end; end;
TPPCAIXAssembler=class(TPPCGNUAssembler) TPPCAIXAssembler=class(TPPCGNUAssembler)
constructor create(smart: boolean); override; constructor create(info: pasminfo; smart: boolean); override;
protected protected
function sectionname(atype: TAsmSectiontype; const aname: string; aorder: TAsmSectionOrder): string; override; function sectionname(atype: TAsmSectiontype; const aname: string; aorder: TAsmSectionOrder): string; override;
procedure WriteExtraHeader; override; procedure WriteExtraHeader; override;
@ -63,9 +63,6 @@ unit agppcgas;
topstr = string[4]; topstr = string[4];
function getreferencestring(var ref : treference) : string;
function getopstr_jmp(const o:toper) : string;
function getopstr(const o:toper) : string;
function branchmode(o: tasmop): topstr; function branchmode(o: tasmop): topstr;
function cond2str(op: tasmop; c: tasmcond): string; function cond2str(op: tasmop; c: tasmcond): string;
@ -73,7 +70,7 @@ unit agppcgas;
uses uses
cutils,globals,verbose, cutils,globals,verbose,
cgbase,systems, cgbase,
assemble, assemble,
itcpugas,cpuinfo, itcpugas,cpuinfo,
aasmcpu; aasmcpu;
@ -91,7 +88,7 @@ unit agppcgas;
{$endif cpu64bitaddr} {$endif cpu64bitaddr}
function getreferencestring(var ref : treference) : string; function getreferencestring(asminfo: pasminfo; var ref : treference) : string;
var var
s : string; s : string;
begin begin
@ -111,7 +108,7 @@ unit agppcgas;
(offset<>0) or (offset<>0) or
not assigned(symbol) then not assigned(symbol) then
internalerror(2011122701); internalerror(2011122701);
if target_asm.dollarsign<>'$' then if asminfo^.dollarsign<>'$' then
getreferencestring:=ReplaceForbiddenAsmSymbolChars(symbol.name)+'('+gas_regname(NR_RTOC)+')' getreferencestring:=ReplaceForbiddenAsmSymbolChars(symbol.name)+'('+gas_regname(NR_RTOC)+')'
else else
getreferencestring:=symbol.name+'('+gas_regname(NR_RTOC)+')'; getreferencestring:=symbol.name+'('+gas_regname(NR_RTOC)+')';
@ -126,7 +123,7 @@ unit agppcgas;
s := s+'('; s := s+'(';
if assigned(symbol) then if assigned(symbol) then
begin begin
if target_asm.dollarsign<>'$' then if asminfo^.dollarsign<>'$' then
begin begin
s:=s+ReplaceForbiddenAsmSymbolChars(symbol.name); s:=s+ReplaceForbiddenAsmSymbolChars(symbol.name);
if assigned(relsymbol) then if assigned(relsymbol) then
@ -190,7 +187,7 @@ unit agppcgas;
end; end;
function getopstr_jmp(const o:toper) : string; function getopstr_jmp(asminfo: pasminfo; const o:toper) : string;
var var
hs : string; hs : string;
begin begin
@ -205,7 +202,7 @@ unit agppcgas;
if o.ref^.refaddr<>addr_full then if o.ref^.refaddr<>addr_full then
internalerror(200402267); internalerror(200402267);
hs:=o.ref^.symbol.name; hs:=o.ref^.symbol.name;
if target_asm.dollarsign<>'$' then if asminfo^.dollarsign<>'$' then
hs:=ReplaceForbiddenAsmSymbolChars(hs); hs:=ReplaceForbiddenAsmSymbolChars(hs);
if o.ref^.offset>0 then if o.ref^.offset>0 then
hs:=hs+'+'+tostr(o.ref^.offset) hs:=hs+'+'+tostr(o.ref^.offset)
@ -222,7 +219,7 @@ unit agppcgas;
end; end;
function getopstr(const o:toper) : string; function getopstr(asminfo: pasminfo; const o:toper) : string;
var var
hs : string; hs : string;
begin begin
@ -235,7 +232,7 @@ unit agppcgas;
if o.ref^.refaddr=addr_full then if o.ref^.refaddr=addr_full then
begin begin
hs:=o.ref^.symbol.name; hs:=o.ref^.symbol.name;
if target_asm.dollarsign<>'$' then if asminfo^.dollarsign<>'$' then
hs:=ReplaceForbiddenAsmSymbolChars(hs); hs:=ReplaceForbiddenAsmSymbolChars(hs);
if o.ref^.offset>0 then if o.ref^.offset>0 then
hs:=hs+'+'+tostr(o.ref^.offset) hs:=hs+'+'+tostr(o.ref^.offset)
@ -245,7 +242,7 @@ unit agppcgas;
getopstr:=hs; getopstr:=hs;
end end
else else
getopstr:=getreferencestring(o.ref^); getopstr:=getreferencestring(asminfo,o.ref^);
else else
internalerror(2002070604); internalerror(2002070604);
end; end;
@ -367,7 +364,7 @@ unit agppcgas;
{ first write the current contents of s, because the symbol } { first write the current contents of s, because the symbol }
{ may be 255 characters } { may be 255 characters }
owner.writer.AsmWrite(s); owner.writer.AsmWrite(s);
s:=getopstr_jmp(taicpu(hp).oper[0]^); s:=getopstr_jmp(owner.asminfo,taicpu(hp).oper[0]^);
end; end;
end end
else else
@ -387,7 +384,7 @@ unit agppcgas;
// debug code // debug code
// writeln(s); // writeln(s);
// writeln(taicpu(hp).fileinfo.line); // writeln(taicpu(hp).fileinfo.line);
s:=s+sep+getopstr(taicpu(hp).oper[i]^); s:=s+sep+getopstr(owner.asminfo,taicpu(hp).oper[i]^);
sep:=','; sep:=',';
end; end;
end; end;
@ -400,9 +397,9 @@ unit agppcgas;
{ GNU PPC Assembler writer } { GNU PPC Assembler writer }
{****************************************************************************} {****************************************************************************}
constructor TPPCGNUAssembler.create(smart: boolean); constructor TPPCGNUAssembler.create(info: pasminfo; smart: boolean);
begin begin
inherited create(smart); inherited;
InstrWriter := TPPCInstrWriter.create(self); InstrWriter := TPPCInstrWriter.create(self);
end; end;
@ -424,9 +421,9 @@ unit agppcgas;
{ GNU/Apple PPC Assembler writer } { GNU/Apple PPC Assembler writer }
{****************************************************************************} {****************************************************************************}
constructor TPPCAppleGNUAssembler.create(smart: boolean); constructor TPPCAppleGNUAssembler.create(info: pasminfo; smart: boolean);
begin begin
inherited create(smart); inherited;
InstrWriter := TPPCInstrWriter.create(self); InstrWriter := TPPCInstrWriter.create(self);
end; end;
@ -453,9 +450,9 @@ unit agppcgas;
{ AIX PPC Assembler writer } { AIX PPC Assembler writer }
{****************************************************************************} {****************************************************************************}
constructor TPPCAIXAssembler.create(smart: boolean); constructor TPPCAIXAssembler.create(info: pasminfo; smart: boolean);
begin begin
inherited create(smart); inherited;
InstrWriter := TPPCInstrWriter.create(self); InstrWriter := TPPCInstrWriter.create(self);
end; end;

View File

@ -26,13 +26,13 @@ unit cpugas;
interface interface
uses uses
cpubase, cpubase,systems,
aasmtai,aasmdata,aasmcpu,assemble,aggas, aasmtai,aasmdata,aasmcpu,assemble,aggas,
cgutils,globtype; cgutils,globtype;
type type
TGasSPARC=class(TGnuAssembler) TGasSPARC=class(TGnuAssembler)
constructor create(smart: boolean); override; constructor create(info: pasminfo; smart: boolean); override;
{# Constructs the command line for calling the assembler } {# Constructs the command line for calling the assembler }
function MakeCmdLine: TCmdStr; override; function MakeCmdLine: TCmdStr; override;
end; end;
@ -46,7 +46,7 @@ interface
implementation implementation
uses uses
cutils,systems,globals,cpuinfo,procinfo, cutils,globals,cpuinfo,procinfo,
verbose,itcpugas,cgbase; verbose,itcpugas,cgbase;
@ -54,9 +54,9 @@ implementation
{ GNU PPC Assembler writer } { GNU PPC Assembler writer }
{****************************************************************************} {****************************************************************************}
constructor TGasSPARC.create(smart: boolean); constructor TGasSPARC.create(info: pasminfo; smart: boolean);
begin begin
inherited create(smart); inherited;
InstrWriter := TSPARCInstrWriter.create(self); InstrWriter := TSPARCInstrWriter.create(self);
end; end;

View File

@ -28,22 +28,22 @@ unit agx86att;
interface interface
uses uses
cclasses,cpubase, cclasses,cpubase,systems,
globals,globtype,cgutils, globals,globtype,cgutils,
aasmbase,aasmtai,aasmdata,assemble,aggas; aasmbase,aasmtai,aasmdata,assemble,aggas;
type type
Tx86ATTAssembler=class(TGNUassembler) Tx86ATTAssembler=class(TGNUassembler)
constructor create(smart: boolean); override; constructor create(info: pasminfo; smart: boolean); override;
function MakeCmdLine: TCmdStr; override; function MakeCmdLine: TCmdStr; override;
end; end;
Tx86AppleGNUAssembler=class(TAppleGNUassembler) Tx86AppleGNUAssembler=class(TAppleGNUassembler)
constructor create(smart: boolean); override; constructor create(info: pasminfo; smart: boolean); override;
end; end;
Tx86AoutGNUAssembler=class(TAoutGNUassembler) Tx86AoutGNUAssembler=class(TAoutGNUassembler)
constructor create(smart: boolean); override; constructor create(info: pasminfo; smart: boolean); override;
end; end;
@ -65,7 +65,7 @@ interface
implementation implementation
uses uses
cutils,systems, cutils,
verbose, verbose,
itcpugas, itcpugas,
cgbase, cgbase,
@ -76,9 +76,9 @@ interface
Tx86ATTAssembler Tx86ATTAssembler
****************************************************************************} ****************************************************************************}
constructor Tx86ATTAssembler.create(smart: boolean); constructor Tx86ATTAssembler.create(info: pasminfo; smart: boolean);
begin begin
inherited create(smart); inherited;
InstrWriter := Tx86InstrWriter.create(self); InstrWriter := Tx86InstrWriter.create(self);
end; end;
@ -124,9 +124,9 @@ interface
Tx86AppleGNUAssembler Tx86AppleGNUAssembler
****************************************************************************} ****************************************************************************}
constructor Tx86AppleGNUAssembler.create(smart: boolean); constructor Tx86AppleGNUAssembler.create(info: pasminfo; smart: boolean);
begin begin
inherited create(smart); inherited;
InstrWriter := Tx86InstrWriter.create(self); InstrWriter := Tx86InstrWriter.create(self);
{ Apple's assembler does not support a size suffix for popcount } { Apple's assembler does not support a size suffix for popcount }
Tx86InstrWriter(InstrWriter).fskipPopcountSuffix := true; Tx86InstrWriter(InstrWriter).fskipPopcountSuffix := true;
@ -138,9 +138,9 @@ interface
Tx86AoutGNUAssembler Tx86AoutGNUAssembler
****************************************************************************} ****************************************************************************}
constructor Tx86AoutGNUAssembler.create(smart: boolean); constructor Tx86AoutGNUAssembler.create(info: pasminfo; smart: boolean);
begin begin
inherited create(smart); inherited;
InstrWriter := Tx86InstrWriter.create(self); InstrWriter := Tx86InstrWriter.create(self);
end; end;

View File

@ -256,7 +256,7 @@ implementation
writer.AsmWrite('['); writer.AsmWrite('[');
if assigned(symbol) then if assigned(symbol) then
begin begin
if (target_asm.id = as_i386_tasm) then if (asminfo^.id = as_i386_tasm) then
writer.AsmWrite('dword ptr '); writer.AsmWrite('dword ptr ');
writer.AsmWrite(symbol.name); writer.AsmWrite(symbol.name);
first:=false; first:=false;
@ -269,7 +269,7 @@ implementation
first:=false; first:=false;
{$ifdef x86_64} {$ifdef x86_64}
{ ml64 needs [$+foo] instead of [rip+foo] } { ml64 needs [$+foo] instead of [rip+foo] }
if (base=NR_RIP) and (target_asm.id=as_x86_64_masm) then if (base=NR_RIP) and (asminfo^.id=as_x86_64_masm) then
writer.AsmWrite('$') writer.AsmWrite('$')
else else
{$endif x86_64} {$endif x86_64}
@ -398,7 +398,7 @@ implementation
begin begin
if o.ref^.refaddr=addr_no then if o.ref^.refaddr=addr_no then
begin begin
if (target_asm.id <> as_i386_tasm) then if (asminfo^.id <> as_i386_tasm) then
begin begin
if s=S_FAR then if s=S_FAR then
writer.AsmWrite('far ptr ') writer.AsmWrite('far ptr ')
@ -491,7 +491,7 @@ implementation
case hp.typ of case hp.typ of
ait_comment : ait_comment :
Begin Begin
writer.AsmWrite(target_asm.comment); writer.AsmWrite(asminfo^.comment);
writer.AsmWritePChar(tai_comment(hp).str); writer.AsmWritePChar(tai_comment(hp).str);
writer.AsmLn; writer.AsmLn;
End; End;
@ -499,7 +499,7 @@ implementation
ait_regalloc : ait_regalloc :
begin begin
if (cs_asm_regalloc in current_settings.globalswitches) then if (cs_asm_regalloc in current_settings.globalswitches) then
writer.AsmWriteLn(target_asm.comment+'Register '+masm_regname(tai_regalloc(hp).reg)+ writer.AsmWriteLn(asminfo^.comment+'Register '+masm_regname(tai_regalloc(hp).reg)+
regallocstr[tai_regalloc(hp).ratype]); regallocstr[tai_regalloc(hp).ratype]);
end; end;
@ -513,7 +513,7 @@ implementation
begin begin
if tai_section(hp).sectype<>sec_none then if tai_section(hp).sectype<>sec_none then
begin begin
if target_asm.id=as_x86_64_masm then if asminfo^.id=as_x86_64_masm then
begin begin
if LasTSecType<>sec_none then if LasTSecType<>sec_none then
writer.AsmWriteLn(secnamesml64[LasTSecType]+#9#9'ENDS'); writer.AsmWriteLn(secnamesml64[LasTSecType]+#9#9'ENDS');
@ -756,7 +756,7 @@ implementation
{ nasm prefers prefix on a line alone { nasm prefers prefix on a line alone
writer.AsmWriteln(#9#9+prefix); but not masm PM writer.AsmWriteln(#9#9+prefix); but not masm PM
prefix:=''; } prefix:=''; }
if target_asm.id in [as_i386_nasmcoff,as_i386_nasmwin32,as_i386_nasmwdosx, if asminfo^.id in [as_i386_nasmcoff,as_i386_nasmwin32,as_i386_nasmwdosx,
as_i386_nasmelf,as_i386_nasmobj,as_i386_nasmbeos,as_i386_nasmhaiku] then as_i386_nasmelf,as_i386_nasmobj,as_i386_nasmbeos,as_i386_nasmhaiku] then
begin begin
writer.AsmWriteln(prefix); writer.AsmWriteln(prefix);
@ -765,7 +765,7 @@ implementation
end end
else else
prefix:= ''; prefix:= '';
if (target_asm.id = as_i386_wasm) and if (asminfo^.id = as_i386_wasm) and
(taicpu(hp).opsize=S_W) and (taicpu(hp).opsize=S_W) and
(fixed_opcode=A_PUSH) and (fixed_opcode=A_PUSH) and
(taicpu(hp).oper[0]^.typ=top_const) then (taicpu(hp).oper[0]^.typ=top_const) then
@ -773,7 +773,7 @@ implementation
writer.AsmWriteln(#9#9'DB 66h,68h ; pushw imm16'); writer.AsmWriteln(#9#9'DB 66h,68h ; pushw imm16');
writer.AsmWrite(#9#9'DW'); writer.AsmWrite(#9#9'DW');
end end
else if (target_asm.id=as_x86_64_masm) and else if (asminfo^.id=as_x86_64_masm) and
(fixed_opcode=A_MOVQ) then (fixed_opcode=A_MOVQ) then
writer.AsmWrite(#9#9'mov') writer.AsmWrite(#9#9'mov')
else else
@ -831,7 +831,7 @@ implementation
{$endif i8086} {$endif i8086}
{ I was told that this isn't necesarry because } { I was told that this isn't necesarry because }
{ the labels generated by FPC are unique (FK) } { the labels generated by FPC are unique (FK) }
{ writer.AsmWriteLn(#9'LOCALS '+target_asm.labelprefix); } { writer.AsmWriteLn(#9'LOCALS '+asminfo^.labelprefix); }
{ TODO: PARA is incorrect, must use actual section align } { TODO: PARA is incorrect, must use actual section align }
if lasTSectype<>sec_none then if lasTSectype<>sec_none then
writer.AsmWriteLn('_'+secnames[lasTSectype]+#9#9+ writer.AsmWriteLn('_'+secnames[lasTSectype]+#9#9+
@ -880,7 +880,7 @@ implementation
sym:=TAsmSymbol(current_asmdata.AsmSymbolDict[i]); sym:=TAsmSymbol(current_asmdata.AsmSymbolDict[i]);
if sym.bind=AB_EXTERNAL then if sym.bind=AB_EXTERNAL then
begin begin
case target_asm.id of case asminfo^.id of
as_i386_masm, as_i386_masm,
as_i386_wasm : as_i386_wasm :
writer.AsmWriteln(#9'EXTRN'#9+sym.name+': NEAR'); writer.AsmWriteln(#9'EXTRN'#9+sym.name+': NEAR');
@ -900,7 +900,7 @@ implementation
begin begin
DoAssemble:=Inherited DoAssemble; DoAssemble:=Inherited DoAssemble;
{ masm does not seem to recognize specific extensions and uses .obj allways PM } { masm does not seem to recognize specific extensions and uses .obj allways PM }
if (target_asm.id in [as_i386_masm,as_i386_wasm]) then if (asminfo^.id in [as_i386_masm,as_i386_wasm]) then
begin begin
masmobjfn:=ChangeFileExt(objfilename,'.obj'); masmobjfn:=ChangeFileExt(objfilename,'.obj');
if not(cs_asm_extern in current_settings.globalswitches) then if not(cs_asm_extern in current_settings.globalswitches) then
@ -923,13 +923,13 @@ implementation
if current_module.mainsource<>'' then if current_module.mainsource<>'' then
comment(v_info,'Start writing intel-styled assembler output for '+current_module.mainsource); comment(v_info,'Start writing intel-styled assembler output for '+current_module.mainsource);
{$endif} {$endif}
if target_asm.id<>as_x86_64_masm then if asminfo^.id<>as_x86_64_masm then
begin begin
writer.AsmWriteLn(#9'.386p'); writer.AsmWriteLn(#9'.386p');
{ masm 6.11 does not seem to like LOCALS PM } { masm 6.11 does not seem to like LOCALS PM }
if (target_asm.id = as_i386_tasm) then if (asminfo^.id = as_i386_tasm) then
begin begin
writer.AsmWriteLn(#9'LOCALS '+target_asm.labelprefix); writer.AsmWriteLn(#9'LOCALS '+asminfo^.labelprefix);
end; end;
{$ifdef i8086} {$ifdef i8086}
writer.AsmWriteLn('DGROUP'#9'GROUP'#9'_BSS,_DATA'); writer.AsmWriteLn('DGROUP'#9'GROUP'#9'_BSS,_DATA');
@ -942,9 +942,9 @@ implementation
for hal:=low(TasmlistType) to high(TasmlistType) do for hal:=low(TasmlistType) to high(TasmlistType) do
begin begin
writer.AsmWriteLn(target_asm.comment+'Begin asmlist '+AsmListTypeStr[hal]); writer.AsmWriteLn(asminfo^.comment+'Begin asmlist '+AsmListTypeStr[hal]);
writetree(current_asmdata.asmlists[hal]); writetree(current_asmdata.asmlists[hal]);
writer.AsmWriteLn(target_asm.comment+'End asmlist '+AsmListTypeStr[hal]); writer.AsmWriteLn(asminfo^.comment+'End asmlist '+AsmListTypeStr[hal]);
end; end;
{ better do this at end of WriteTree, but then there comes a trouble with { better do this at end of WriteTree, but then there comes a trouble with
@ -952,7 +952,7 @@ implementation
if LastSecType <> sec_none then if LastSecType <> sec_none then
begin begin
if target_asm.id=as_x86_64_masm then if asminfo^.id=as_x86_64_masm then
writer.AsmWriteLn(secnamesml64[LasTSecType]+#9#9'ENDS') writer.AsmWriteLn(secnamesml64[LasTSecType]+#9#9'ENDS')
else else
writer.AsmWriteLn('_'+secnames[LasTSecType]+#9#9'ENDS'); writer.AsmWriteLn('_'+secnames[LasTSecType]+#9#9'ENDS');

View File

@ -668,7 +668,7 @@ interface
case hp.typ of case hp.typ of
ait_comment : ait_comment :
Begin Begin
writer.AsmWrite(target_asm.comment); writer.AsmWrite(asminfo^.comment);
writer.AsmWritePChar(tai_comment(hp).str); writer.AsmWritePChar(tai_comment(hp).str);
writer.AsmLn; writer.AsmLn;
End; End;
@ -676,7 +676,7 @@ interface
ait_regalloc : ait_regalloc :
begin begin
if (cs_asm_regalloc in current_settings.globalswitches) then if (cs_asm_regalloc in current_settings.globalswitches) then
writer.AsmWriteLn(#9#9+target_asm.comment+'Register '+nasm_regname(tai_regalloc(hp).reg)+' '+ writer.AsmWriteLn(#9#9+asminfo^.comment+'Register '+nasm_regname(tai_regalloc(hp).reg)+' '+
regallocstr[tai_regalloc(hp).ratype]); regallocstr[tai_regalloc(hp).ratype]);
end; end;
@ -743,7 +743,7 @@ interface
aitconst_sleb128bit, aitconst_sleb128bit,
aitconst_128bit: aitconst_128bit:
begin begin
writer.AsmWriteLn(target_asm.comment+'Unsupported const type '+ writer.AsmWriteLn(asminfo^.comment+'Unsupported const type '+
ait_const2str[consttype]); ait_const2str[consttype]);
end; end;
{$ifdef i8086} {$ifdef i8086}
@ -963,7 +963,7 @@ interface
assigned(taicpu(hp).oper[1]^.ref^.symbol) and assigned(taicpu(hp).oper[1]^.ref^.symbol) and
(taicpu(hp).oper[1]^.ref^.base=NR_NO)) then (taicpu(hp).oper[1]^.ref^.base=NR_NO)) then
begin begin
writer.AsmWrite(target_asm.comment); writer.AsmWrite(asminfo^.comment);
writer.AsmWriteln('Converting LEA to MOV instruction'); writer.AsmWriteln('Converting LEA to MOV instruction');
taicpu(hp).opcode:=A_MOV; taicpu(hp).opcode:=A_MOV;
end; end;
@ -1082,10 +1082,10 @@ interface
ait_varloc: ait_varloc:
begin begin
if tai_varloc(hp).newlocationhi<>NR_NO then if tai_varloc(hp).newlocationhi<>NR_NO then
writer.AsmWriteLn(target_asm.comment+'Var '+tai_varloc(hp).varsym.realname+' located in register '+ writer.AsmWriteLn(asminfo^.comment+'Var '+tai_varloc(hp).varsym.realname+' located in register '+
std_regname(tai_varloc(hp).newlocationhi)+':'+std_regname(tai_varloc(hp).newlocation)) std_regname(tai_varloc(hp).newlocationhi)+':'+std_regname(tai_varloc(hp).newlocation))
else else
writer.AsmWriteLn(target_asm.comment+'Var '+tai_varloc(hp).varsym.realname+' located in register '+ writer.AsmWriteLn(asminfo^.comment+'Var '+tai_varloc(hp).varsym.realname+' located in register '+
std_regname(tai_varloc(hp).newlocation)); std_regname(tai_varloc(hp).newlocation));
end; end;
else else
@ -1168,9 +1168,9 @@ interface
begin begin
if not (current_asmdata.asmlists[hal].empty) then if not (current_asmdata.asmlists[hal].empty) then
begin begin
writer.AsmWriteLn(target_asm.comment+'Begin asmlist '+AsmListTypeStr[hal]); writer.AsmWriteLn(asminfo^.comment+'Begin asmlist '+AsmListTypeStr[hal]);
writetree(current_asmdata.asmlists[hal]); writetree(current_asmdata.asmlists[hal]);
writer.AsmWriteLn(target_asm.comment+'End asmlist '+AsmListTypeStr[hal]); writer.AsmWriteLn(asminfo^.comment+'End asmlist '+AsmListTypeStr[hal]);
end; end;
end; end;