From 59e9343dd641af79696dfb6142facc7421c1f117 Mon Sep 17 00:00:00 2001 From: sandeep Date: Thu, 23 Mar 2000 17:48:14 +0000 Subject: [PATCH] Fixed remat bug git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@197 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- src/mcs51/gen.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mcs51/gen.c b/src/mcs51/gen.c index 5e30e412..fc09590c 100644 --- a/src/mcs51/gen.c +++ b/src/mcs51/gen.c @@ -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 ; -- 2.47.2