[Coco] 6809 Q [Mark Mc]
CoCoList for Color Computer Enthusiasts
coco at maltedmedia.com
Thu May 15 11:44:13 EDT 2014
Well the 6809 is a beast but it does not have this particular addressing
mode.
You can do this:
LDA [8,Y]
But it's not the same. It will compose the address 8 + Y and the contents
of this address is loaded into A.
Luis Felipe Antoniosi
retrocanada76 at gmail.com
On Thu, May 15, 2014 at 11:09 AM, CoCoList for Color Computer Enthusiasts <
coco at maltedmedia.com> wrote:
> Hi 6809 Gurus,
>
> On the 6502, you have the following code:
>
> LDA (8),Y
>
> That takes the address stored in the two bytes at $8,$9 in the zero-page,
> applies the (8-bit) offset Y, and loads A with the byte stored at the
> resultant address.
>
> On the 6809, I'm using the DP to emulate the zero-page.
>
> Is there any way I can do the same, with a single instruction, on the 6809?
>
> What I'm doing atm is the following:
>
> LDY *8
> LDA B,Y
>
> ...and in this case, B is the 8-bit offset. Note that I've also reversed
> the bytes stored at $8,$9 w.r.t. the 6502.
>
> This is used a *LOT* in Lode Runner, so I thought I'd ask if there was a
> 'better' (shorter) way. FWIW I've found that execution speed isn't
> critical, especially since the graphics rendering is a little less complex
> on the Coco3 (and hence faster).
>
> Regards,
>
> --
> | Mark McDougall | "Electrical Engineers do it
> | <http://members.iinet.net.au/~msmcdoug> | with less resistance!"
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> http://five.pairlist.net/mailman/listinfo/coco
>
More information about the Coco
mailing list