scotws wrote:
Short version is I find the official 65816 notation baroque, confusing, annoying to type, error-prone, and full of visual clutter...
Over the years, I've peered into blurry terminals and stared at Tele-Type® hardcopy studying any number of programs written in a number of assembly languages. My opinion is the 65C816 assembly language is pretty clean compared to a few others, especially x86 assembly language and even worse, the code used with the U.S. Postal Service's ZIP Mail Translator (ZMT). This is not to say that the various methods by which one specifies operands to '816 instructions are ideal. However, the '816 versions for dealing with 16 and 24 bit operands are derivatives of the official 6502 notation that has been with us for some 40 years. The use of
<,
>,
^, etc, to pick which parts of a multibyte operand get assembled makes complete sense to me. Some of the notation is not intuitive, but given that there are only so many characters on a standard QWERTY keyboard that are not alphanumeric, coming up with alternatives is difficult.
As I'm sure you know, the 6502 assembly language is essentially the Motorola 6800 assembly language, with suitable changes to reflect the characteristics of the 6502. The model adopted by Motorola and MOS Technology is that the three-character mnemonic tells the programmer the basic operation (load, store, add, etc.) and the register on which the basic operation occurs. The rest of the instruction tells the assembler how the instruction is to address memory. Three character mnemonics are easily processed, as a uniformity of field size reduces search and match algorithms to a simple form. That basic model was endorsed by the IEEE in the 1970s, although never formally ratified as a standard.
The MC68000 assembly language continues to use many of the 6800 assembly language elements, but obviously had to be expanded quite a bit to work with the much greater scope of the 68K's capabilities. Having been fluent in 6800 assembly language at one time, I had little trouble making the transition to the 68K. In other words, a commonality of dialect was a significant factor in being able to work with the assembly languages of three different processors.
As an aside, when I developed the macros I use to assemble '816 instructions and native addressing modes in the Kowalski simulator I faced a similar challenge. How can I name the macros so they are close enough to real mnemonics that they make sense to me? Some macros are just the names of the instructions they synthesize, such as
BRL and
TCD. Others, especially those that involve an addressing mode not known to the 65C02, were more difficult. However, where there's a will there's a way.
Immediate mode instructions that are to be assembled with a 16 bit operand are the same as the parent instruction, with a
W tacked on the end. So
LDA #$1234, which cannot be assembled as written, becomes
LDAW $1234. The macro "knows" that it is an immediate mode instruction and hence assembles
A9 34 12. Another interesting one is
JSR (<addr>,X), which is unique to the 65C816. Originally that was synthesized in a macro named
JSX. I have since changed it to
JSRX. So the instruction
JSR ($1234,X) is written as
JSRX $1234 and assembles
FC 34 12.
Ultimately, the purpose of an assembly language is to make it reasonably easy for the programmer to remember the instructions and what they do. Microprocessor manufacturers have historically dictated the syntax to be used with their creations' assembly language in the interests of maintaining a form of standardization. This became especially important with the 6502 because it was used in so many different computer systems, not to mention machine controllers, modems, dumb terminals, etc. Deviating from the manufacturer's standard is not something to be lightly considered, as doing so may make the resulting code opaque to others. Obviously, my use of macros to assemble '816 code in a 65C02 assembler makes me guilty of that very transgression.