From 10516f21f88bb451f1d0be58bb513b80750157da Mon Sep 17 00:00:00 2001 From: florian Date: Tue, 30 Jan 2018 20:22:42 +0000 Subject: [PATCH] * patch by Christo Crause to resolve #33098: AVR - LDS assembler instruction with absolute address gives compiler error git-svn-id: trunk@38082 - --- .gitattributes | 1 + compiler/avr/raavrgas.pas | 3 ++- tests/webtbs/tw33098.pp | 9 +++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 tests/webtbs/tw33098.pp diff --git a/.gitattributes b/.gitattributes index d1f542dab2..2c19be3851 100644 --- a/.gitattributes +++ b/.gitattributes @@ -15967,6 +15967,7 @@ tests/webtbs/tw33004.pp svneol=native#text/pascal tests/webtbs/tw3301.pp svneol=native#text/plain tests/webtbs/tw33086.pp svneol=native#text/pascal tests/webtbs/tw3309.pp svneol=native#text/plain +tests/webtbs/tw33098.pp svneol=native#text/pascal tests/webtbs/tw3320.pp svneol=native#text/plain tests/webtbs/tw3324.pp svneol=native#text/plain tests/webtbs/tw3327.pp svneol=native#text/plain diff --git a/compiler/avr/raavrgas.pas b/compiler/avr/raavrgas.pas index 6038eebc4b..c2a043f3da 100644 --- a/compiler/avr/raavrgas.pas +++ b/compiler/avr/raavrgas.pas @@ -373,7 +373,8 @@ Unit raavrgas; oper.opr.ref.offset:=BuildConstExpression(True,False); { absolute memory addresss? } - if (actopcode in [A_LDS,A_STS]) and (actasmtoken<>AS_COMMA) then + if ((actopcode = A_LDS) and (actasmtoken <> AS_SEPARATOR)) or + ((actopcode = A_STS) and (actasmtoken <> AS_COMMA)) then begin if not(MaybeBuildReference) then Message(asmr_e_invalid_reference_syntax); diff --git a/tests/webtbs/tw33098.pp b/tests/webtbs/tw33098.pp new file mode 100644 index 0000000000..555977ee89 --- /dev/null +++ b/tests/webtbs/tw33098.pp @@ -0,0 +1,9 @@ +{ %cpu=avr } +{ %norun } +begin + asm + lds r20, 100 + end; +end. + +