[cc65] ca65: fixed: .feature ubiquitous_idents http://pastebin.com/Qg1Rrgbt

From: Jeremy Turner <jeremiah.turner1gmail.com>
Date: 2013-11-25 05:27:30
I was under the impression that this feature was supposed to allow you to
use instructions as macro names, but for the instructions to still work if
you did not define such macros.

I could never get it to work.

Looking at the source, it seems that my understanding was the intention,
especially at line 765 in main.c


 } else if (Instr >= 0 ||
               (UbiquitousIdents && ((Instr = FindInstruction
(&CurTok.SVal)) >= 0))) {
        /* A mnemonic - assemble one instruction */
        HandleInstruction (Instr);


The problem seems to be at line 648 and 743
Old code:

        if (!UbiquitousIdents) {
            /* Macros and symbols cannot use instruction names */
            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);
        }


New code:

        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);
            }
        }

Please see the full updated source for main.c at:
http://pastebin.com/Qg1Rrgbt
I'd appreciate this making it into the master, I don't want to setup git
etc.. at least not just yet.


Thanks!

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Mon Nov 25 05:27:43 2013

This archive was generated by hypermail 2.1.8 : 2013-11-25 05:27:45 CET