From: frief Date: Sat, 29 Jan 2005 19:37:28 +0000 (+0000) Subject: (genAnd): accessing LSB/MSB by rotating acc X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=ef93874cb1f05f1fac41bdec5c062658d7e6d43d;p=fw%2Fsdcc (genAnd): accessing LSB/MSB by rotating acc git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3660 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/src/mcs51/gen.c b/src/mcs51/gen.c index 84c20daf..9dc79416 100644 --- a/src/mcs51/gen.c +++ b/src/mcs51/gen.c @@ -5779,7 +5779,17 @@ genAnd (iCode * ic, iCode * ifx) MOVA (aopGet (AOP (left), posbit >> 3, FALSE, FALSE)); // bit = left & 2^n if (size) - emitcode ("mov", "c,acc.%d", posbit & 0x07); + { + switch (posbit & 0x07) + { + case 0: emitcode ("rrc", "a"); + break; + case 7: emitcode ("rlc", "a"); + break; + default: emitcode ("mov", "c,acc.%d", posbit & 0x07); + break; + } + } // if(left & 2^n) else {