temporary hack for the inline Y bug
authorjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 4 Feb 2001 12:48:38 +0000 (12:48 +0000)
committerjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 4 Feb 2001 12:48:38 +0000 (12:48 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@574 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/ds390/gen.c

index 85cb88d077f6f88e3ff37863242be73fb557e36e..f202e191f253d8b9c695a24ca3dd070d32701fa2 100644 (file)
@@ -129,7 +129,25 @@ static void emitcode (char *inst,char *fmt, ...)
        if (fmt && *fmt)
            sprintf(lb,"%s\t",inst);
        else
+#if 1
+       {
+         /* for some reason the parser throws in a mysterious "Y" at 
+            the end of inline assembly code.
+            Do a make in device/lib and you know all about it.
+         */
+         int i=0;
+         while(inst[i]==' ')
+           i++;
+         if (strcmp(&inst[i],"Y")==0) {
+           fprintf (stderr, "===> BEWARE of the inline Y bug hack <===\n");
+           return;
+         } else {
+           sprintf(lb,"%s",inst);
+         }
+       }       
+#else
            sprintf(lb,"%s",inst);
+#endif
         vsprintf(lb+(strlen(lb)),fmt,ap);
     }  else
         vsprintf(lb,fmt,ap);