]> git.gag.com Git - fw/sdcc/commitdiff
* src/pic16/gen.c (shiftR2Left2Result): fixed bug #1507127
authortecodev <tecodev@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 16 Jun 2006 08:40:32 +0000 (08:40 +0000)
committertecodev <tecodev@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 16 Jun 2006 08:40:32 +0000 (08:40 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4227 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
src/pic16/gen.c

index dcdbdd0cea1b7697c146528ce57e3d69ebc3f50b..867e71444975e9deb6ad5c93b4ec1a3806ae71c6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2006-06-16 Raphael Neider <rneider AT web.de>
+
+       * src/pic16/gen.c (shiftR2Left2Result): fixed bug #1507127
+
 2006-06-13 Maarten Brock <sourceforge.brock AT dse.nl>
 
        * debugger/mcs51/cmd.c (cmdListFunctions): fixed bugs 1181163 and
index 2d4bfe00fe353bfedefa20cb16d0a7756b622c10..2ac93042e169ee343d481d530f37c9174ad4fed0 100644 (file)
@@ -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));
     }