[Coco] 6502 to 6809 translation

John Kent jekent at optusnet.com.au
Mon Aug 1 08:23:46 EDT 2011


Rather than using Y you might want to use B,

that way

lda (data_addr),y

would become

ldy data_addr
lda b,y

John.

On 1/08/2011 9:02 PM, Phill Harvey-Smith wrote:
> Hi All,
>
> I'm currently trying to translate some 6502 code to run on the 
> Dragon/CoCo, all is prety easy except for one thing, the 6809 doesn't 
> appear to have one of the 6502 indexed modes namely :
>
> asume that data_addr contains $8000
> and y=$20
>
>     lda    (data_addr),y
>
>
> which will IIRC take look in data_addr, find $8000 and load a from 
> $800+$20 = $8020.
>
> the 6809 has
>     lda    (data_addr,y)
>
> but this will load a from where data_addr+$20 points to, which is not 
> the same thing !
>
> So is there an easy way of translating the 6502 code in a couple of 
> 6809 instructions ?
>
> Cheers.
>
> Phill.
>
> -- 
> Coco mailing list
> Coco at maltedmedia.com
> http://five.pairlist.net/mailman/listinfo/coco
>
>

-- 
http://www.johnkent.com.au
http://members.optusnet.com.au/jekent





More information about the Coco mailing list