Ver código fonte

* correct assembling of test rm8,reg8

git-svn-id: trunk@5972 -
florian 18 anos atrás
pai
commit
5e2042cff8

+ 1 - 0
.gitattributes

@@ -6182,6 +6182,7 @@ tests/tbs/tb0519.pp svneol=native#text/plain
 tests/tbs/tb0520.pp svneol=native#text/plain
 tests/tbs/tb0521.pp svneol=native#text/plain
 tests/tbs/tb0522.pp svneol=native#text/plain
+tests/tbs/tb0523.pp svneol=native#text/plain
 tests/tbs/ub0060.pp svneol=native#text/plain
 tests/tbs/ub0069.pp svneol=native#text/plain
 tests/tbs/ub0119.pp svneol=native#text/plain

+ 1 - 1
compiler/i386/i386tab.inc

@@ -6345,7 +6345,7 @@
   (
     opcode  : A_TEST;
     ops     : 2;
-    optypes : (ot_reg8,ot_memory,ot_none);
+    optypes : (ot_regmem or ot_bits8,ot_reg8,ot_none);
     code    : #193#211#1#132#72;
     flags   : if_8086 or if_sm
   ),

+ 1 - 1
compiler/x86/x86ins.dat

@@ -2020,7 +2020,7 @@ void                  \2\x0F\x07                      P6,PRIV,AMD
 regmem,reg16|32|64    \300\320\1\x85\101              8086,SM
 reg16|32|64,mem       \301\320\1\x85\110              8086,SM
 reg8,reg8             \300\323\1\x84\101              8086
-reg8,mem              \301\323\1\x84\110              8086,SM
+rm8,reg8              \301\323\1\x84\110              8086,SM
 reg_eax,imm           \325\1\xA9\41                   386,SM
 reg_ax,imm            \324\1\xA9\31                   8086,SM
 reg_al,imm            \1\xA8\21                       8086,SM

+ 1 - 1
compiler/x86_64/x8664tab.inc

@@ -6289,7 +6289,7 @@
   (
     opcode  : A_TEST;
     ops     : 2;
-    optypes : (ot_reg8,ot_memory,ot_none);
+    optypes : (ot_regmem or ot_bits8,ot_reg8,ot_none);
     code    : #193#211#1#132#72;
     flags   : if_8086 or if_sm
   ),

+ 19 - 0
tests/tbs/tb0523.pp

@@ -0,0 +1,19 @@
+{ %target=i386 }
+{$asmmode intel}
+
+var
+  a : array[0..1] of byte;
+  myresult : boolean;
+begin
+  a[0]:=$ff;
+  a[1]:=$1;
+  asm
+    mov esi,offset a
+    mov dl,1
+    test byte ptr [esi+1], dl
+    setnz myresult
+  end;
+  if not(myresult) then
+    halt(1);
+  writeln('ok');
+end.