|
Subject: Re: [stella] 6502 question From: Nick S Bensema <nickb@xxxxxxxxxxxx> Date: Fri, 4 Apr 1997 07:18:17 -0700 (MST) |
>
>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 gets worse. $81 must read 0 so you don't inadvertently read the RIOT
or ROM.
Here's an idea:
LDX $80
LDA $00,X
You can also LDY $00,X this way too. Or LDX $00,Y if I'm not mistaken.
Hope this helps.
--
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 |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| [stella] 6502 question, Erik Mooney | Thread | Re: [stella] 6502 question, Eckhard Stolberg |
| Re: [stella] 6502 question, Eckhard Stolberg | Date | Re: [stella] Authorship questions, Russ Perry Jr |
| Month |