Fixed remat bug
authorsandeep <sandeep@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 23 Mar 2000 17:48:14 +0000 (17:48 +0000)
committersandeep <sandeep@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 23 Mar 2000 17:48:14 +0000 (17:48 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@197 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/mcs51/gen.c

index 5e30e4120f690c7f7147390b097b1f04da9c6ba2..fc09590c1a7b4d6155458b1cca2cf4aaaf493b5b 100644 (file)
@@ -383,8 +383,10 @@ static asmop *aopForRemat (symbol *sym)
 
         /* if plus or minus print the right hand side */
         if (ic->op == '+' || ic->op == '-') {
-            sprintf(s,"0x%04x %c ",(int) operandLitValue(IC_RIGHT(ic)),
-                    ic->op );
+           if (ic->op == '-')
+               sprintf(s,"-0x%04x + ",(int) operandLitValue(IC_RIGHT(ic))) ;
+           else
+               sprintf(s,"0x%04x + ",(int) operandLitValue(IC_RIGHT(ic)));
             s += strlen(s);
             ic = OP_SYMBOL(IC_LEFT(ic))->rematiCode;
             continue ;