[Coco] 6809 Q [Mark Mc]

CoCoList for Color Computer Enthusiasts coco at maltedmedia.com
Thu May 15 11:09:51 EDT 2014


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!"



More information about the Coco mailing list