Browse Source

* fixed OP_AND,OP_OR,OP_XOR in tcgz80.a_op_reg_reg_internal

git-svn-id: branches/z80@44510 -
nickysn 5 years ago
parent
commit
052313d649
1 changed files with 10 additions and 5 deletions
  1. 10 5
      compiler/z80/cgcpu.pas

+ 10 - 5
compiler/z80/cgcpu.pas

@@ -591,11 +591,16 @@ unit cgcpu;
 
            OP_AND,OP_OR,OP_XOR:
              begin
-                for i:=1 to tcgsize2size[size] do
-                  begin
-                    list.concat(taicpu.op_reg_reg(topcg2asmop[op],dst,src));
-                    NextSrcDst;
-                  end;
+               getcpuregister(list,NR_A);
+               for i:=tcgsize2size[size] downto 1 do
+                 begin
+                   a_load_reg_reg(list,OS_8,OS_8,dst,NR_A);
+                   list.concat(taicpu.op_reg_reg(topcg2asmop[op],NR_A,src));
+                   a_load_reg_reg(list,OS_8,OS_8,NR_A,dst);
+                   if i<>1 then
+                     NextSrcDst;
+                 end;
+               ungetcpuregister(list,NR_A);
              end;
            else
              internalerror(2011022004);