fixed bug #466029
[fw/sdcc] / src / z80 / gen.c
index c8c6df5cf302e736d0d4445091db587bf5852b40..474d89815f8c91e93c140c0f6222f331c6c9ab06 100644 (file)
@@ -3399,7 +3399,8 @@ genCmp (operand * left, operand * right,
              else
                {
                  /* Subtract through, propagating the carry */
-                 emit2 ("%s a,%s", offset == 0 ? "sub" : "sbc", aopGet (AOP (right), offset++, FALSE));
+                 emit2 ("%s a,%s", offset == 0 ? "sub" : "sbc", aopGet (AOP (right), offset, FALSE));
+                 offset++;
                }
            }
        }