]> git.gag.com Git - fw/sdcc/commitdiff
fixed bug #451453
authorjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Tue, 21 Aug 2001 11:58:34 +0000 (11:58 +0000)
committerjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Tue, 21 Aug 2001 11:58:34 +0000 (11:58 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1159 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/SDCC.lex
src/ds390/gen.c
src/mcs51/gen.c

index 425508adf254f00083980e12c0973535eb8ab641..cc81d1ec66dbc392e99f7ae16cdafbfb83fb581e 100644 (file)
@@ -547,7 +547,7 @@ int process_pragma(char *s)
     }
 
     if (strncmp(cp,PRAGMA_NOLOOPREV,strlen(PRAGMA_NOLOOPREV)) == 0) {
-       doPragma(P_EXCLUDE,NULL);
+       doPragma(P_LOOPREV,NULL);
        return 0;
     }
 
index a9cf9567b8855c86f6ef8a314ba723dbf3c0e289..21315fde238ff9c08ee0b880e299298d9c8b0e28 100644 (file)
@@ -3841,12 +3841,17 @@ genMinus (iCode * ic)
       else
        {
          /* first add without previous c */
-         if (!offset)
-           emitcode ("add", "a,#0x%02x",
-                     (unsigned int) (lit & 0x0FFL));
-         else
+         if (!offset) {
+           if (!size && lit==-1) {
+             emitcode ("dec", "a");
+           } else {
+             emitcode ("add", "a,#0x%02x",
+                       (unsigned int) (lit & 0x0FFL));
+           }
+         } else {
            emitcode ("addc", "a,#0x%02x",
                      (unsigned int) ((lit >> (offset * 8)) & 0x0FFL));
+         }
        }
 
       if (pushResult)
index ccaacd0812d2af1e27efbad4decffc4799656cab..408e9116539f02c000119a7ad33737b2b91057b4 100644 (file)
@@ -3251,12 +3251,17 @@ genMinus (iCode * ic)
       else
        {
          /* first add without previous c */
-         if (!offset)
-           emitcode ("add", "a,#0x%02x",
-                     (unsigned int) (lit & 0x0FFL));
-         else
+         if (!offset) {
+           if (!size && lit==-1) {
+             emitcode ("dec", "a");
+           } else {
+             emitcode ("add", "a,#0x%02x", 
+                       (unsigned int) (lit & 0x0FFL));
+           }
+         } else {
            emitcode ("addc", "a,#0x%02x",
                      (unsigned int) ((lit >> (offset * 8)) & 0x0FFL));
+         }
        }
       aopPut (AOP (IC_RESULT (ic)), "a", offset++);
     }