BillG wrote:
floobydust wrote:
BillG wrote:
Then again if you try:
Code:
LDA #256
you get code of A9 00 (LDA #0). So it wraps around.
An argument can be made that should be flagged as an error.
ca65 for example does throw an "out of range" error when the operand size is too large for the selected instruction. (same with branch instructions that try to reach too far)
of course it also takes in account the size of the registers when assembling for the 65816. so with the Accumulator in 8-bit mode, doing
LDA #256 will throw an error, with A in 16-bit mode, it will assemble fine.
overall i'm kinda getting tempted again to try and port DOS/65 to use ca65 instead of WDC's Assembler. mostly just because ca65 is fully open source and any kind of quirky behavior like that would quickly be found by some user and then posted on the cc65 github.
but i think that kind of project is above my skill level as it's not just an easy 1:1 convertion of assembler directives...
so maybe someday in the future i'll attempt it, or maybe someone else will have done it by then