Added support fun for long shifts
[fw/sdcc] / src / SDCCpeeph.c
index fb207ff21767cc4380c8485e6882b243b3b1cc30..0ae38500ffee4d56c6503cb49da3918c02c34eb7 100644 (file)
@@ -272,10 +272,15 @@ printLine (lineNode * head, FILE * of)
       /* don't indent comments & labels */
       if (head->line &&
          (*head->line == ';' ||
-          head->line[strlen (head->line) - 1] == ':'))
+          head->line[strlen (head->line) - 1] == ':')) {
        fprintf (of, "%s\n", head->line);
-      else
+      } else {
+       if (head->isInline && *head->line=='#') {
+         // comment out preprocessor directives in inline asm
+         fprintf (of, ";");
+       }
        fprintf (of, "\t%s\n", head->line);
+      }
       head = head->next;
     }
 }
@@ -531,12 +536,13 @@ bindVar (int key, char **s, hTab ** vtab)
 
   /* first get the value of the variable */
   vvx = *s;
-  /* the value is ended by a ',' or space or newline or null */
+  /* the value is ended by a ',' or space or newline or null or ) */
   while (*vvx &&
         *vvx != ',' &&
         !isspace (*vvx) &&
         *vvx != '\n' &&
-        *vvx != ':')
+        *vvx != ':' &&
+        *vvx != ')')
     {
       char ubb = 0;
       /* if we find a '(' then we need to balance it */