Quote:
TT: would the HXA be able to support two syntaxes for the same opcode, so that
Sure. The native version already has to deal with things like:
Code:
LDA #$AB
LDA addr
LDA addr,X
LDA addr,Y
LDA (addr),Y
LDA (addr,X)
So the idea of having to deal with multiple possible arguments for one mnemonic isn't new to any 6502 assembler.
The macro version has to deal with the same things, of course. The way I handle it is to define a macro with the name of a mnemonic with as many arguments as there could legally be at most:
Code:
LDA .macro ?addr=@, ?ndx=@
..body..
.endm
The "=@" parts are default values; if the programmer does not supply values then that's what they become. So:
Code:
LDA #$45
gives '?addr' the text value '#$45' and '?ndx' the text value '@'. The macro code looks at these and decides what to do based on what it sees.
In short there's no problem defining as many arguments as you want, with as many of them having default values as you want, to make the job of generating code as easy as you want. For example, the only reason '?addr' has a default value at all is so that if someone perchance ever wrote LDA without any arguments at all, the macro code can issue a more-or-less meaningful error message (if '?addr' had no default value HXA would complain about the missing argument itself, though).