Re: [stella] Re: ZP,Y -> ABS,Y

Subject: Re: [stella] Re: ZP,Y -> ABS,Y
From: Christopher Tumber <christophertumber@xxxxxxxxxx>
Date: Thu, 24 Oct 2002 17:31:55 -0400
>I utterly fail to understand this argument.
>
>$80 is the same thing as far as $0080, as far as I'm concerned.  It's
>also the same thing as $080, $00080, and $00000000000000000000000000080.

Okay, so:

lda $0080

and

lda $80

Are the same instructions?

No, the former is 3 bytes and 4 cycles, the latter is 2 bytes and 3 cycles. Functionally they are equivalent instructions but they do not assemble the same and they do not run the same.

So,

lda $0080,x 

and

lda $80,x

Are the same instruction?

No, the former is 3 bytes and 4 cycles, the latter is 2 bytes and 4 cycles. Functionally they are equivalent instructions but they do not assemble the same and they do not run the same.

While

lda $0080,y

and

lda $80,y

Are not the same either! The former is 3 bytes and 4 cycles, the latter DOES NOT EXIST!

$80 *is* different from $0080. That's why we have different addressing modes! If not then every instance where you use ZeroPage addressing, go ahead and substitute Absolute addressing!

>I absolutely do *not* want my assembler guessing what I meant with "lda $0080,y".

That's NOT what I'm saying!

Currently, DASM is guessing that when you WRITE lda $80,y you MEAN lda $0080,y

Guessworks is the status quo! I'm arguing AGAINST guesses by the assembler.

When you write lda $0080,y DASM should and does read that as indexed absolute. That is correct.

However lda $80,y should be flagged as an illegal addressing mode error! There is no such thing as lda $80,y and in order to turn that into a valid statement (lda $0080,y) the assemler has to GUESS that you really mean't lda $0080,y when you may have mean't any of lda $80,x or lda $80 or even lda $0080,y

Or you may have mean't something completely different! Regardless, the assembler shouldn't be making ANY guesses at all. Given ANY ambivalence the assembler should flag an error and make you clarify it. Otherwise, you're going to be left to debugging the problem the hard way later (Or when going through and optimising, replacing all instances of lda $ZeroPage,y with lda $ZeroPage,x as I did...)

Chris....


----------------------------------------------------------------------------------------------
Archives (includes files) at http://www.biglist.com/lists/stella/archives/
Unsub & more at http://www.biglist.com/lists/stella/


Current Thread