From a3b935b5fabc740b63c6ce4a0f83f55313806a73 Mon Sep 17 00:00:00 2001 From: epetrich Date: Fri, 18 Jul 2003 20:33:24 +0000 Subject: [PATCH] Fixed bug 772726 git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2752 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- ChangeLog | 4 ++++ src/z80/gen.c | 11 +++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 62554fdf..233b3a35 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2003-07-18 Erik Petrich + + * src/z80/gen.c: fixed some right shift bugs (#772726 among them) + 2003-07-17 Jesus Calvino-Fraga * link/z80/lklibr.c: fixed bug when there is a '.' in a library path. diff --git a/src/z80/gen.c b/src/z80/gen.c index b5f0afc9..f855a0e2 100644 --- a/src/z80/gen.c +++ b/src/z80/gen.c @@ -5965,13 +5965,16 @@ genRightShift (iCode * ic) return; } + emit2 ("ld a,%s", aopGet (AOP (right), 0, FALSE)); + emit2 ("inc a"); + freeAsmop (right, NULL, ic); + aopOp (left, ic, FALSE, FALSE); aopOp (result, ic, FALSE, FALSE); /* now move the left to the result if they are not the same */ - if (!sameRegs (AOP (left), AOP (result)) && - AOP_SIZE (result) > 1) + if (!sameRegs (AOP (left), AOP (result))) { size = AOP_SIZE (result); @@ -5984,10 +5987,6 @@ genRightShift (iCode * ic) } } - emit2 ("ld a,%s", aopGet (AOP (right), 0, FALSE)); - emit2 ("inc a"); - freeAsmop (right, NULL, ic); - tlbl = newiTempLabel (NULL); tlbl1 = newiTempLabel (NULL); size = AOP_SIZE (result); -- 2.30.2