]> git.sur5r.net Git - cc65/blobdiff - src/cc65/codeseg.c
Fix missing spaces
[cc65] / src / cc65 / codeseg.c
index a808a26f7ed72dcfe02fc19f7e37250adb4a21cf..e2fd84a7c953bc09a5063d9d56581e4df38d3209 100644 (file)
@@ -317,12 +317,12 @@ static CodeEntry* ParseInsn (CodeSeg* S, LineInfo* LI, const char* L)
                 /* Expect zp x indirect */
                 L = SkipSpace (L+1);
                 if (toupper (*L) != 'X') {
-                    Error ("ASM code error: `X' expected");
+                    Error ("ASM code error: 'X' expected");
                     return 0;
                 }
                 L = SkipSpace (L+1);
                 if (*L != ')') {
-                    Error ("ASM code error: `)' expected");
+                    Error ("ASM code error: ')' expected");
                     return 0;
                 }
                 L = SkipSpace (L+1);
@@ -337,7 +337,7 @@ static CodeEntry* ParseInsn (CodeSeg* S, LineInfo* LI, const char* L)
                 if (*L == ',') {
                     L = SkipSpace (L+1);
                     if (toupper (*L) != 'Y') {
-                        Error ("ASM code error: `Y' expected");
+                        Error ("ASM code error: 'Y' expected");
                         return 0;
                     }
                     L = SkipSpace (L+1);
@@ -378,7 +378,7 @@ static CodeEntry* ParseInsn (CodeSeg* S, LineInfo* LI, const char* L)
                     /* Check for subroutine call to local label */
                     if ((OPC->Info & OF_CALL) && IsLocalLabelName (Arg)) {
                         Error ("ASM code error: "
-                               "Cannot use local label `%s' in subroutine call",
+                               "Cannot use local label '%s' in subroutine call",
                                Arg);
                     }
                     AM = AM65_ABS;
@@ -426,8 +426,10 @@ static CodeEntry* ParseInsn (CodeSeg* S, LineInfo* LI, const char* L)
         unsigned Hash = HashStr (Arg) % CS_LABEL_HASH_SIZE;
         Label = CS_FindLabel (S, Arg, Hash);
 
-        /* If we don't have the label, it's a forward ref - create it */
-        if (Label == 0) {
+        /* If we don't have the label, it's a forward ref - create it unless
+        ** it's an external function.
+        */
+        if (Label == 0 && (OPC->OPC != OP65_JMP || IsLocalLabelName (Arg)) ) {
             /* Generate a new label */
             Label = CS_NewCodeLabel (S, Arg, Hash);
         }
@@ -532,7 +534,7 @@ void CS_AddVLine (CodeSeg* S, LineInfo* LI, const char* Format, va_list ap)
         case '.':
             /* Control instruction */
             ReadToken (L, " \t", Token, sizeof (Token));
-            Error ("ASM code error: Pseudo instruction `%s' not supported", Token);
+            Error ("ASM code error: Pseudo instruction '%s' not supported", Token);
             break;
 
         default:
@@ -780,7 +782,7 @@ CodeLabel* CS_AddLabel (CodeSeg* S, const char* Name)
     if (L) {
         /* We found it - be sure it does not already have an owner */
         if (L->Owner) {
-            Error ("ASM label `%s' is already defined", Name);
+            Error ("ASM label '%s' is already defined", Name);
             return L;
         }
     } else {
@@ -790,7 +792,7 @@ CodeLabel* CS_AddLabel (CodeSeg* S, const char* Name)
 
     /* Safety. This call is quite costly, but safety is better */
     if (CollIndex (&S->Labels, L) >= 0) {
-        Error ("ASM label `%s' is already defined", Name);
+        Error ("ASM label '%s' is already defined", Name);
         return L;
     }
 
@@ -906,7 +908,7 @@ void CS_MergeLabels (CodeSeg* S)
 
                 /* Print some debugging output */
                 if (Debug) {
-                    printf ("Removing unused global label `%s'", X->Name);
+                    printf ("Removing unused global label '%s'", X->Name);
                 }
 
                 /* And free the label */