From: johanknol Date: Thu, 15 Mar 2001 20:10:31 +0000 (+0000) Subject: let's not be too efficient X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=66451761c637971671b28de85f79986339774dda;p=fw%2Fsdcc let's not be too efficient git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@685 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/src/ds390/gen.c b/src/ds390/gen.c index 57515424..6907101c 100644 --- a/src/ds390/gen.c +++ b/src/ds390/gen.c @@ -3770,8 +3770,10 @@ genMultOneByte (operand * left, emitcode ("jnb", "F0,%05d$", lbl->key+100); // only ONE op was negative, we have to do a 8/16-bit two's complement emitcode ("cpl", "a"); // lsb - emitcode ("inc", "a"); - if (size==2) { + if (size==1) { + emitcode ("inc", "a"); + } else { + emitcode ("add" "a,#1"); emitcode ("xch", "a,b"); emitcode ("cpl", "a"); // msb emitcode ("addc", "a,#0"); diff --git a/src/mcs51/gen.c b/src/mcs51/gen.c index d4ef962c..fe0fd2b0 100644 --- a/src/mcs51/gen.c +++ b/src/mcs51/gen.c @@ -3330,8 +3330,10 @@ genMultOneByte (operand * left, emitcode ("jnb", "F0,%05d$", lbl->key+100); // only ONE op was negative, we have to do a 8/16-bit two's complement emitcode ("cpl", "a"); // lsb - emitcode ("inc", "a"); - if (size==2) { + if (size==1) { + emitcode ("inc", "a"); + } else { + emitcode ("add", "a,#1"); emitcode ("xch", "a,b"); emitcode ("cpl", "a"); // msb emitcode ("addc", "a,#0");