Re: [stella] 6502 question

Subject: Re: [stella] 6502 question
From: Eckhard_Stolberg@xxxxxxxxxxxxxxxxxxxxx (Eckhard Stolberg)
Date: Fri, 4 Apr 1997 14:52:47 +0200
>Question for you 6502 gurus (both of you =) ).
>Suppose I have a number between $90 and $9F stored in $80.  What's the
>fastest way to get the number at the address in $80 into the accumulator?
>(that is, if the value in location $80 equals $94, I want the accumulator
>to have the value in $94.)
>
>It looks like I need to zero Y and then do LDA ($80),Y which is indirect
>indexed for 5 cycles plus clearing Y, or zero X and then LDA ($80,X) which
>is indexed indirect for 6 cycles plus clearing X.  These would work on the
>zero page, right?  Would the "zero page-ness" decrease the number of cycles
>as it does for direct addressing?

It works ONLY when the pointer is stored in the zeropage, so no speedup there.

I think there is no faster way than LDY #$00 / LDA ($80),Y wich takes 7 cycles.
But this would use address $80 and $81 for the pointer. Since you only want
to point to zeropage addresses, an equally fast way would be LDX $80 / 
LDA $F000,X. This would only use one byte in RAM for the pointer.


Ciao, Eckhard Stolberg

P.S. Sorry for not having sent you the GUS Playbin file yet. But since you
seem to have problems with high volumes, I thought, I'd better change my code
first.


--
Archives available at http://www.biglist.com/lists/stella/archives/
E-mail UNSUBSCRIBE in the body to stella-request@xxxxxxxxxxx to be removed.

Current Thread