* write absolute references correctly on avr, resolves #32040

git-svn-id: trunk@37419 -
This commit is contained in:
florian 2017-10-07 21:09:20 +00:00
parent d9bc656852
commit 3d3298f64d
3 changed files with 44 additions and 1 deletions

1
.gitattributes vendored
View File

@ -15786,6 +15786,7 @@ tests/webtbs/tw3185.pp svneol=native#text/plain
tests/webtbs/tw3190.pp svneol=native#text/plain
tests/webtbs/tw31945.pp svneol=native#text/pascal
tests/webtbs/tw3197.pp svneol=native#text/plain
tests/webtbs/tw32040.pp svneol=native#text/pascal
tests/webtbs/tw32043.pp svneol=native#text/pascal
tests/webtbs/tw3207.pp svneol=native#text/plain
tests/webtbs/tw3210.pp svneol=native#text/plain

View File

@ -119,7 +119,9 @@ unit agavrgas;
if assigned(symbol) then
s:=ReplaceForbiddenAsmSymbolChars(symbol.name);
if offset<0 then
if s='' then
s:=tostr(offset)
else if offset<0 then
s:=s+tostr(offset)
else if offset>0 then
s:=s+'+'+tostr(offset);

40
tests/webtbs/tw32040.pp Normal file
View File

@ -0,0 +1,40 @@
{ %cpu=avr }
{ %norun }
const
c0 = 0;
c1 = 1;
c2 = $02;
c10 = $10;
c22 = $22;
c100 = $100;
c1000 = $1000;
c3070 = $3070;
procedure something; assembler; nostackframe;
asm
ldi ZL, lo8(c0);
ldi ZH, hi8(c0);
ldi ZL, lo8(c1);
ldi ZH, hi8(c1);
ldi ZL, lo8(c2);
ldi ZH, hi8(c2);
ldi ZL, lo8(c10);
ldi ZH, hi8(c10);
ldi ZL, lo8(c22);
ldi ZH, hi8(c22);
ldi ZL, lo8(c100);
ldi ZH, hi8(c100);
ldi ZL, lo8(c1000);
ldi ZH, hi8(c1000);
ldi ZL, lo8(c3070);
ldi ZH, hi8(c3070);
ldi ZL, lo8(0x3070);
ldi ZH, hi8(0x3070);
ldi ZL, lo8(0x300);
ldi ZH, hi8(0x300);
end;
begin
end.