From 99c1a9524d6858ae2cb526e0daabef6c3af766af Mon Sep 17 00:00:00 2001 From: tecodev Date: Fri, 16 Jun 2006 08:40:32 +0000 Subject: [PATCH] * src/pic16/gen.c (shiftR2Left2Result): fixed bug #1507127 git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4227 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- ChangeLog | 4 ++++ src/pic16/gen.c | 8 +++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index dcdbdd0c..867e7144 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2006-06-16 Raphael Neider + + * src/pic16/gen.c (shiftR2Left2Result): fixed bug #1507127 + 2006-06-13 Maarten Brock * debugger/mcs51/cmd.c (cmdListFunctions): fixed bugs 1181163 and diff --git a/src/pic16/gen.c b/src/pic16/gen.c index 2d4bfe00..2ac93042 100644 --- a/src/pic16/gen.c +++ b/src/pic16/gen.c @@ -9087,8 +9087,9 @@ static void shiftR2Left2Result (operand *left, int offl, case 1: case 2: case 3: + /* obtain sign from left operand */ if(sign) - pic16_emitpcode(POC_RLCFW,pic16_popGet(AOP(result),offr+MSB16)); + pic16_emitpcode(POC_RLCFW,pic16_popGet(AOP(left),offr+MSB16)); else emitCLRC; @@ -9104,9 +9105,10 @@ static void shiftR2Left2Result (operand *left, int offl, while(--shCount) { if(sign) - pic16_emitpcode(POC_RLCFW,pic16_popGet(AOP(result),offr+MSB16)); + /* now get sign from already assigned result (avoid BANKSEL) */ + pic16_emitpcode(POC_RLCFW,pic16_popGet(AOP(result),offr+MSB16)); else - emitCLRC; + emitCLRC; pic16_emitpcode(POC_RRCF,pic16_popGet(AOP(result),offr+MSB16)); pic16_emitpcode(POC_RRCF,pic16_popGet(AOP(result),offr)); } -- 2.47.2