So important to remember is the fact that the OP did this because the
disassembler output a particular syntax that the
assembler didn't interpret identically. I will say that I'm disappointed he/she didn't state what disassembler was used -- it matters.
However, I do not believe this is something that should be backported or imported into either official asm6 or forks (ex. asm6f). I'll explain my stance:
I'm making an assumption that this was accomplished based on length (number of characters/bytes representing the address, ex. 4 for
$0092). I have to assume this because only the full source code was posted, not a diff, and I can't be arsed to download it and diff it myself.
How this was accomplished on other assemblers was through some form of operator prefix or suffix.
If someone wants to solve this long-term, I urge you -- almost to the point of forcing you -- to
read my post in the linked thread. Take the time to look at the manuals of existing commercial assemblers and products. You will find there is generally a "common implementation model" (despite different letters/characters used), and *where* that's implemented also matters (hint: it's not based on operand value/length/size). Tepples in the same thread proposed a different syntax (re:
a: prefix). I don't care what is chosen, but it needs to be implemented properly.
As for disassemblers and their output: hopefully everyone is now starting to see why this matters so much. The state of 6502 disassemblers is pretty messy: I've tried several in the past few months and I roll my eyes at pretty much all of them in one way or another -- to the point where I don't even bother reassembling anything (like I usually do) because it's going to be a PITA due to the ridiculous variance of behaviours of each assembler. It wasn't like this in the early and late 90s, for whatever reason. The one I found to be most helpful but also kinda not helpful was disasm6, since it was designed to output code that worked with asm6, but there's annoyances with disasm6 too.