BigDumbDinosaur wrote:
In the Kowalski assembler, as greatly improved by Daryl Rictor, an instruction such as LDA !#$10 will do the same. I prefer the !# syntax over Calypsi’s ## due to the latter being too easy to accidentally enter during source editing. !# requires distinctly different keystrokes, making it less likely a typo will introduce a bug into the program.
true i guess, but when you make mistakes like that it shouldn't be that difficult to spot if you use comments and such to note what registers should be what width every now and then.
BigDumbDinosaur wrote:
The ca65 assembler has a .smart pseudo-op that causes the assembler to try to track REP and SEP instructions that affect m and x.
oops, forgot that exists. but also note that it doesn't make the assembler follow program flow, so even when you're not using any PHP/PLP instructions it could still easily be wrong if you purely rely on .smart due to the order in which the assembler does it's work.
BigDumbDinosaur wrote:
65C816 register sizes are not “modes.” The 816 has two operating modes: emulation and native
now i'm interested, why not? i'd say a mode is defined as something that changes the way some subset of instructions are fetched and/or executed. all of those line up with the register widths as they effect almost every memory accessing instruction.
the 6502/65C02 already has 2 modes, the D flag for either Binary or Decimal Addition/Subtraction. it's even called "Decimal Mode".
so even when you exclude the register widths, the 65816 would have atleast 4 operating modes: Emulation Binary, Emulation Decimal, Native Binary, and Native Decimal.
Bruce Clark's page on the 65816 includes the register widths as modes, so he's saying the CPU has a total of 10 different modes:
http://www.6502.org/tutorials/65c816opcodes.html#6.10.3