what is the proper way to infer accumulator addressing. asl is used as an example:
asl
or
asl A
A robust assembler should accept both 'asl' and 'asl a' and assemble them to the same opcode. A particular assembler might accept one or the other; read its documentation. Which assembler are you working with?
im wrting an assembler and i was just wondering if both were valid or just one.
The assembler I use most often (ca65) accepts at least 'asl a', and this appears to be the official syntax, but the Apple mini-assembler used 'asl'. I'd recommend following
Postel's law by accepting both syntaxes; it won't hurt anything.
I personally prefer "ASL A" as it distinguishes between Accumulator mode and Implied mode (ASL obviously isn't an implied instruction, therefore in my mind it would need the following 'A' to indicate Accumulator mode)
However from an assembler point of view -- I'll have to agree with what's been said. Just accept both.