Browse Source

* fixed OP_NOT in tcgz80.a_op_reg_reg_internal

git-svn-id: branches/z80@44511 -
nickysn 5 years ago
parent
commit
c02fc4a49f
1 changed files with 8 additions and 5 deletions
  1. 8 5
      compiler/z80/cgcpu.pas

+ 8 - 5
compiler/z80/cgcpu.pas

@@ -503,13 +503,16 @@ unit cgcpu;
 
 
            OP_NOT:
            OP_NOT:
              begin
              begin
-               for i:=1 to tcgsize2size[size] do
+               getcpuregister(list,NR_A);
+               for i:=tcgsize2size[size] downto 1 do
                  begin
                  begin
-                   if src<>dst then
-                     a_load_reg_reg(list,OS_8,OS_8,src,dst);
-                   list.concat(taicpu.op_reg(A_CPL,dst));
-                   NextSrcDst;
+                   a_load_reg_reg(list,OS_8,OS_8,src,NR_A);
+                   list.concat(taicpu.op_none(A_CPL));
+                   a_load_reg_reg(list,OS_8,OS_8,NR_A,dst);
+                   if i<>1 then
+                     NextSrcDst;
                  end;
                  end;
+               ungetcpuregister(list,NR_A);
              end;
              end;
 
 
            OP_MUL,OP_IMUL:
            OP_MUL,OP_IMUL: