mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-19 06:49:16 +02:00
* fixed reference writing for avr
git-svn-id: branches/avr@17042 -
This commit is contained in:
parent
b870a6eff5
commit
b6530f253a
@ -29,13 +29,18 @@ unit agavrgas;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
|
globtype,
|
||||||
aasmtai,aasmdata,
|
aasmtai,aasmdata,
|
||||||
aggas,
|
aggas,
|
||||||
cpubase;
|
cpubase;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
|
{ TAVRGNUAssembler }
|
||||||
|
|
||||||
TAVRGNUAssembler=class(TGNUassembler)
|
TAVRGNUAssembler=class(TGNUassembler)
|
||||||
constructor create(smart: boolean); override;
|
constructor create(smart: boolean); override;
|
||||||
|
function MakeCmdLine: TCmdStr; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TAVRInstrWriter=class(TCPUInstrWriter)
|
TAVRInstrWriter=class(TCPUInstrWriter)
|
||||||
@ -51,6 +56,7 @@ unit agavrgas;
|
|||||||
assemble,
|
assemble,
|
||||||
aasmcpu,
|
aasmcpu,
|
||||||
itcpugas,
|
itcpugas,
|
||||||
|
cpuinfo,
|
||||||
cgbase,cgutils;
|
cgbase,cgutils;
|
||||||
|
|
||||||
{****************************************************************************}
|
{****************************************************************************}
|
||||||
@ -84,8 +90,33 @@ unit agavrgas;
|
|||||||
// if ((index<>NR_NO) or (shiftmode<>SM_None)) and ((offset<>0) or (symbol<>nil)) then
|
// if ((index<>NR_NO) or (shiftmode<>SM_None)) and ((offset<>0) or (symbol<>nil)) then
|
||||||
// internalerror(200308293);
|
// internalerror(200308293);
|
||||||
{$endif extdebug}
|
{$endif extdebug}
|
||||||
|
if index<>NR_NO then
|
||||||
|
internalerror(2011021701)
|
||||||
|
else if base<>NR_NO then
|
||||||
|
begin
|
||||||
|
if addressmode=AM_PREDRECEMENT then
|
||||||
|
s:='-'
|
||||||
|
else
|
||||||
|
s:='';
|
||||||
|
case base of
|
||||||
|
NR_R26:
|
||||||
|
s:=s+'X';
|
||||||
|
NR_R28:
|
||||||
|
s:=s+'Y';
|
||||||
|
NR_R30:
|
||||||
|
s:=s+'Z';
|
||||||
|
else
|
||||||
|
s:=gas_regname(base);
|
||||||
|
end;
|
||||||
|
if addressmode=AM_POSTINCREMENT then
|
||||||
|
s:=s+'+';
|
||||||
|
|
||||||
if assigned(symbol) or (offset<>0) then
|
if offset>0 then
|
||||||
|
s:=s+'+'+tostr(offset)
|
||||||
|
else if offset<0 then
|
||||||
|
s:=s+tostr(offset)
|
||||||
|
end
|
||||||
|
else if assigned(symbol) or (offset<>0) then
|
||||||
begin
|
begin
|
||||||
if assigned(symbol) then
|
if assigned(symbol) then
|
||||||
s:=ReplaceForbiddenChars(symbol.name)
|
s:=ReplaceForbiddenChars(symbol.name)
|
||||||
@ -104,12 +135,7 @@ unit agavrgas;
|
|||||||
else
|
else
|
||||||
s:='('+s+')';
|
s:='('+s+')';
|
||||||
end;
|
end;
|
||||||
end
|
|
||||||
else
|
|
||||||
begin
|
|
||||||
s:='('+gas_regname(base)+')';
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
getreferencestring:=s;
|
getreferencestring:=s;
|
||||||
end;
|
end;
|
||||||
@ -129,7 +155,7 @@ unit agavrgas;
|
|||||||
top_ref:
|
top_ref:
|
||||||
if o.ref^.refaddr=addr_full then
|
if o.ref^.refaddr=addr_full then
|
||||||
begin
|
begin
|
||||||
hs:=o.ref^.symbol.name;
|
hs:=ReplaceForbiddenChars(o.ref^.symbol.name);
|
||||||
if o.ref^.offset>0 then
|
if o.ref^.offset>0 then
|
||||||
hs:=hs+'+'+tostr(o.ref^.offset)
|
hs:=hs+'+'+tostr(o.ref^.offset)
|
||||||
else
|
else
|
||||||
@ -163,6 +189,12 @@ unit agavrgas;
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function TAVRGNUAssembler.MakeCmdLine: TCmdStr;
|
||||||
|
begin
|
||||||
|
result := '-mmcu='+lower(cputypestr[current_settings.cputype])+' '+inherited MakeCmdLine;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
const
|
const
|
||||||
as_arm_gas_info : tasminfo =
|
as_arm_gas_info : tasminfo =
|
||||||
(
|
(
|
||||||
|
Loading…
Reference in New Issue
Block a user