Răsfoiți Sursa

* allow also 8 byte string constants in assembler, resolves #28640

git-svn-id: trunk@49066 -
florian 4 ani în urmă
părinte
comite
6218254e53
5 a modificat fișierele cu 41 adăugiri și 0 ștergeri
  1. 2 0
      .gitattributes
  2. 5 0
      compiler/raatt.pas
  3. 5 0
      compiler/x86/rax86int.pas
  4. 15 0
      tests/webtbs/tw28640.pp
  5. 14 0
      tests/webtbs/tw28640a.pp

+ 2 - 0
.gitattributes

@@ -18146,6 +18146,8 @@ tests/webtbs/tw2853e.pp svneol=native#text/plain
 tests/webtbs/tw2859.pp svneol=native#text/plain
 tests/webtbs/tw28593.pp svneol=native#text/plain
 tests/webtbs/tw28632.pp -text svneol=native#text/plain
+tests/webtbs/tw28640.pp svneol=native#text/pascal
+tests/webtbs/tw28640a.pp svneol=native#text/pascal
 tests/webtbs/tw28641.pp svneol=native#text/plain
 tests/webtbs/tw2865.pp svneol=native#text/plain
 tests/webtbs/tw28650.pp svneol=native#text/pascal

+ 5 - 0
compiler/raatt.pas

@@ -1594,6 +1594,11 @@ unit raatt;
                  4 :
                   l:=ord(actasmpattern[4]) + ord(actasmpattern[3]) shl 8 +
                      Ord(actasmpattern[2]) shl 16 + ord(actasmpattern[1]) shl 24;
+                 8 :
+                  begin
+                    move(actasmpattern[1],l,8);
+                    l:=SwapEndian(l);
+                  end;
                 else
                   Message1(asmr_e_invalid_string_as_opcode_operand,actasmpattern);
                 end;

+ 5 - 0
compiler/x86/rax86int.pas

@@ -1494,6 +1494,11 @@ Unit Rax86int;
                  4 :
                   l:=ord(actasmpattern[4]) + ord(actasmpattern[3]) shl 8 +
                      Ord(actasmpattern[2]) shl 16 + ord(actasmpattern[1]) shl 24;
+                 8 :
+                  begin
+                    move(actasmpattern[1],l,8);
+                    l:=SwapEndian(l);
+                  end;
                 else
                   Message1(asmr_e_invalid_string_as_opcode_operand,actasmpattern);
                 end;

+ 15 - 0
tests/webtbs/tw28640.pp

@@ -0,0 +1,15 @@
+{ %cpu=x86_64 }
+function test : int64;assembler;
+  {$ASMMODE INTEL}
+  asm
+        MOV RAX,'=TXEHTAP' // FAIL: LONG STRING "PATHEXT="
+  end;
+var
+  s : string[8];
+  l : int64 absolute s[1];
+begin
+  l:=test;
+  s[0]:=#8;
+  if s<>'PATHEXT=' then
+    halt(1);
+end.

+ 14 - 0
tests/webtbs/tw28640a.pp

@@ -0,0 +1,14 @@
+{ %cpu=x86_64 }
+function test : int64;assembler;
+  asm
+        MOV $'=TXEHTAP',%RAX // FAIL: LONG STRING "PATHEXT="
+  end;
+var
+  s : string[8];
+  l : int64 absolute s[1];
+begin
+  l:=test;
+  s[0]:=#8;
+  if s<>'PATHEXT=' then
+    halt(1);
+end.