]> git.sur5r.net Git - cc65/commitdiff
Merged branch "master" into ubiquitous. 62/head
authorGreg King <gregdk@users.sf.net>
Sat, 30 Nov 2013 17:38:47 +0000 (12:38 -0500)
committerGreg King <gregdk@users.sf.net>
Sat, 30 Nov 2013 17:40:57 +0000 (12:40 -0500)
src/ca65/main.c

index 3b68d30fae7885bee5d78cb35b6f2153ffc9d191..b3bedd9bb7a2dd9d57dc86f0991efb945837c972 100644 (file)
@@ -1,3 +1,4 @@
+/*****************************************************************************/
 /*                                                                           */
 /*                                  main.c                                   */
 /*                                                                           */
@@ -650,15 +651,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);
         }
     }
 
@@ -745,15 +749,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);
                 }
             }
         }
@@ -766,8 +773,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)) {