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

* Improve automatic adding of operand size.

git-svn-id: trunk@611 -
daniel 20 éve
szülő
commit
51e0368aa5
1 módosított fájl, 19 hozzáadás és 11 törlés
  1. 19 11
      compiler/x86/rax86.pas

+ 19 - 11
compiler/x86/rax86.pas

@@ -559,20 +559,28 @@ begin
 {$endif ATTOP}
      end;
 
-  if (ops=1) and (opcode=A_INT) then
-    siz:=S_B;
-
-  if (ops=1) and (opcode=A_RET) then
-    siz:=S_W;
-
-  if (ops=1) and (opcode=A_PUSH) then
+  {It is valid to specify some instructions without operand size.}
+  if siz=S_NO then
     begin
-      {We are a 32 compiler, assume 32-bit by default. This is Delphi compatible
-       but bad coding practise.}
-      siz:=S_L;
-      message(asmr_w_unable_to_determine_reference_size_using_dword);
+      if (ops=1) and (opcode=A_INT) then
+        siz:=S_B;
+      if (ops=1) and (opcode=A_RET) then
+        siz:=S_W;
+      if (ops=1) and (opcode=A_PUSH) then
+        begin
+          {We are a 32 compiler, assume 32-bit by default. This is Delphi compatible
+           but bad coding practise.}
+          siz:=S_L;
+          message(asmr_w_unable_to_determine_reference_size_using_dword);
+        end;
+      if (opcode=A_JMP) or (opcode=A_CALL) then
+        if ops=1 then
+          siz:=S_NEAR
+        else
+          siz:=S_FAR;
     end;
 
+
    { GNU AS interprets FDIV without operand differently
      for version 2.9.1 and 2.10
      we add explicit args to it !! }