X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fz80%2Fgen.c;h=342dac243c8a9c162e76d297aed855d1c8cb40ef;hb=6efdb0c5dd65f90e09768d5e6fb562d47545c783;hp=39c048e88f1a8baa65061493efd49c52b5a5bc85;hpb=5348b1694fe65587bad6296d9ecf146b2aa962d1;p=fw%2Fsdcc diff --git a/src/z80/gen.c b/src/z80/gen.c index 39c048e8..342dac24 100644 --- a/src/z80/gen.c +++ b/src/z80/gen.c @@ -4179,13 +4179,15 @@ genXor (iCode * ic, iCode * ifx) _moveA (aopGet (AOP (right), offset, FALSE)); emit2 ("xor a,%s", aopGet (AOP (left), offset, FALSE)); - aopPut (AOP (result), "a", 0); + aopPut (AOP (result), "a", offset); } } else { if (AOP_TYPE (left) == AOP_ACC) - emit2 ("xor a,%s", aopGet (AOP (right), offset, FALSE)); + { + emit2 ("xor a,%s", aopGet (AOP (right), offset, FALSE)); + } else { _moveA (aopGet (AOP (right), offset, FALSE)); @@ -4220,14 +4222,15 @@ genXor (iCode * ic, iCode * ifx) } // faster than result <- left, anl result,right // and better if result is SFR - if (AOP_TYPE (left) == AOP_ACC) - emit2 ("xor a,%s", aopGet (AOP (right), offset, FALSE)); + if (AOP_TYPE (left) == AOP_ACC) + { + emit2 ("xor a,%s", aopGet (AOP (right), offset, FALSE)); + } else { _moveA (aopGet (AOP (right), offset, FALSE)); emit2 ("xor a,%s", aopGet (AOP (left), offset, FALSE)); - aopPut (AOP (result), "a", 0); } aopPut (AOP (result), "a", offset); }