* write references of the type (IX+const), (IY+const) as const(IX) or const(IY), since that appears to

be what sdcc-sdasz80 accepts

git-svn-id: branches/z80@44527 -
This commit is contained in:
nickysn 2020-04-03 01:33:41 +00:00
parent 4099c0eed8
commit 4fe04ac53a

View File

@ -321,6 +321,28 @@ unit agsdasz80;
writer.AsmWrite('#'+tostr(longint(o.val)));
end;
top_ref:
begin
if not assigned(o.ref^.symbol) and
((o.ref^.base<>NR_NO) or (o.ref^.index<>NR_NO)) and
(o.ref^.offset<>0) then
begin
writer.AsmWrite(tostr(o.ref^.offset));
writer.AsmWrite(' (');
if o.ref^.base<>NR_NO then
begin
if o.ref^.index<>NR_NO then
internalerror(2020040201);
writer.AsmWrite(std_regname(o.ref^.base));
end
else if o.ref^.index<>NR_NO then
begin
if o.ref^.scalefactor>1 then
internalerror(2020040202);
writer.AsmWrite(std_regname(o.ref^.index));
end;
writer.AsmWrite(')');
end
else
begin
writer.AsmWrite('(');
need_plus:=false;
@ -358,6 +380,7 @@ unit agsdasz80;
writer.AsmWrite('0');
writer.AsmWrite(')');
end;
end;
else
internalerror(10001);
end;