Browse Source

+ also support [expr1]+[expr2] for adding references in the x86 intel syntax asm reader

git-svn-id: trunk@38381 -
nickysn 7 years ago
parent
commit
8ffde52974
2 changed files with 6 additions and 1 deletions
  1. 4 0
      compiler/x86/rax86int.pas
  2. 2 1
      tests/test/tasm23.pp

+ 4 - 0
compiler/x86/rax86int.pas

@@ -1754,10 +1754,14 @@ Unit Rax86int;
 
             AS_LBRACKET :
               begin
+                if (GotPlus and Negative) or GotStar then
+                  Message(asmr_e_invalid_reference_syntax);
                 tmpoper:=Tx86Operand.create;
                 BuildReference(tmpoper);
                 AddReferences(oper,tmpoper);
                 tmpoper.Free;
+                GotPlus:=false;
+                GotStar:=false;
               end;
 
             AS_RBRACKET :

+ 2 - 1
tests/test/tasm23.pp

@@ -4,7 +4,8 @@ program tasm23;
 
 procedure t; assembler;
 asm
-  mov ax, [bx[5]][di][54][-17][45][4] { mov ax, [bx+di+5Bh] }
+  mov ax, [bx[5]][di][54][-17][45][4]      { mov ax, [bx+di+5Bh] }
+  mov ax, [[bx+5]+[di+54]+[-17]+[45]+[4]]  { mov ax, [bx+di+5Bh] }
 end;
 
 begin