X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fcc65%2Fcodeseg.c;h=e2fd84a7c953bc09a5063d9d56581e4df38d3209;hb=a9cbb5305c3863b3385c54d7112bd587e8d075c4;hp=a808a26f7ed72dcfe02fc19f7e37250adb4a21cf;hpb=0390c34e88e9512b81ce35a9ba36d137d1c80c44;p=cc65 diff --git a/src/cc65/codeseg.c b/src/cc65/codeseg.c index a808a26f7..e2fd84a7c 100644 --- a/src/cc65/codeseg.c +++ b/src/cc65/codeseg.c @@ -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 */