From 309c8fb8425af833c260d93909827d1d6c0bdce4 Mon Sep 17 00:00:00 2001 From: Greg King Date: Sat, 30 Nov 2013 08:20:36 -0500 Subject: [PATCH 1/3] Fixed ca65's "ubiquitous_idents" feature. Before the fix, that feature couldn't recognize a standard op-code mnemonic, that wasn't replaced by a macro, if it was on a line without a label. This patch was written by Jeremy Turner. --- src/ca65/main.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/src/ca65/main.c b/src/ca65/main.c index 4b2f9d178..da826f4db 100644 --- a/src/ca65/main.c +++ b/src/ca65/main.c @@ -646,15 +646,18 @@ static void OneLine (void) * an instruction. */ if (CurTok.Tok == TOK_IDENT) { - if (!UbiquitousIdents) { - /* Macros and symbols cannot use instruction names */ + if (UbiquitousIdents) { + /* Macros CAN be instructions, so check for them first */ + Mac = FindMacro (&CurTok.SVal); + if (Mac == 0) { + Instr = FindInstruction (&CurTok.SVal); + } + } else { + /* Macros and symbols may NOT use the names of instructions */ Instr = FindInstruction (&CurTok.SVal); if (Instr < 0) { Mac = FindMacro (&CurTok.SVal); } - } else { - /* Macros and symbols may use the names of instructions */ - Mac = FindMacro (&CurTok.SVal); } } @@ -741,15 +744,18 @@ static void OneLine (void) * be a macro or instruction. */ if (CurTok.Tok == TOK_IDENT) { - if (!UbiquitousIdents) { - /* Macros and symbols cannot use instruction names */ + if (UbiquitousIdents) { + /* Macros CAN be instructions, so check for them first */ + Mac = FindMacro (&CurTok.SVal); + if (Mac == 0) { + Instr = FindInstruction (&CurTok.SVal); + } + } else { + /* Macros and symbols may NOT use the names of instructions */ Instr = FindInstruction (&CurTok.SVal); if (Instr < 0) { Mac = FindMacro (&CurTok.SVal); } - } else { - /* Macros and symbols may use the names of instructions */ - Mac = FindMacro (&CurTok.SVal); } } } From a6506abcd1d93f6672444ca3836ae316de1178a0 Mon Sep 17 00:00:00 2001 From: Greg King Date: Sat, 30 Nov 2013 08:24:58 -0500 Subject: [PATCH 2/3] Removed a now-redundant line. --- src/ca65/main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ca65/main.c b/src/ca65/main.c index da826f4db..85474f693 100644 --- a/src/ca65/main.c +++ b/src/ca65/main.c @@ -768,8 +768,7 @@ static void OneLine (void) } else if (Mac != 0) { /* A macro expansion */ MacExpandStart (Mac); - } else if (Instr >= 0 || - (UbiquitousIdents && ((Instr = FindInstruction (&CurTok.SVal)) >= 0))) { + } else if (Instr >= 0) { /* A mnemonic - assemble one instruction */ HandleInstruction (Instr); } else if (PCAssignment && (CurTok.Tok == TOK_STAR || CurTok.Tok == TOK_PC)) { From fa1423731512f71ddb3c747b41ef8f6ac4fee611 Mon Sep 17 00:00:00 2001 From: Greg King Date: Sat, 30 Nov 2013 08:30:42 -0500 Subject: [PATCH 3/3] Added a top border to a file's header comment. --- src/ca65/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ca65/main.c b/src/ca65/main.c index 85474f693..4ec98b01d 100644 --- a/src/ca65/main.c +++ b/src/ca65/main.c @@ -1,3 +1,4 @@ +/*****************************************************************************/ /* */ /* main.c */ /* */