Posted By
![](/images/g.gif) Csabo on 2018-05-19 15:30:56
| Re: Learning 6502 assembly
Sure. I think you mean the "Indirect Indexed" mode. Here's an example:
Let's say there's some data you want to read from $1200. We will put this 16 bit address to $D0 (which is just an arbitrary, but commonly used zeropage address). Then, we will read the 1st byte from there.
LDA #$00 STA $D0 LDA #$12 STA $D1 ; now $D0/$D1 "points to" $1200
LDY #$00 LDA ($D0),Y ; this is the indexed indirect mode. So, this will take whatever 2 byte/16 bit address $D0/$D1 points to ($1200 in this case, since we just set it above), then index it with Y. Therefore, this is equivalent of LDA $1200. INY LDA ($D0),Y ; similarly, this will read from $1201 in this case.
As you can see, since the value of $D0/$D1 can be easily changed, you can have the same routine process different memory areas. That's it in a nutshell. Are you trying to code something specific?
|