Forráskód Böngészése

* patch by Christo Crause to resolve #33098: AVR - LDS assembler instruction with absolute address gives compiler error

git-svn-id: trunk@38082 -
florian 7 éve
szülő
commit
10516f21f8
3 módosított fájl, 12 hozzáadás és 1 törlés
  1. 1 0
      .gitattributes
  2. 2 1
      compiler/avr/raavrgas.pas
  3. 9 0
      tests/webtbs/tw33098.pp

+ 1 - 0
.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

+ 2 - 1
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);

+ 9 - 0
tests/webtbs/tw33098.pp

@@ -0,0 +1,9 @@
+{ %cpu=avr }
+{ %norun }
+begin
+  asm
+    lds r20, 100
+  end;
+end.
+
+