[Coco] 6502 to 6809 translation
Roger Taylor
taylor at newfoal.com
Mon Aug 1 12:48:55 EDT 2011
At 06:02 AM 8/1/2011, you 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.
There's no easy way, but then no coding is easy. Maybe someone
should write a translator that runs on a PC so it can be used from
the Phoenix IDE to preprocess these 6502 files before assembling with
a 6809 assembler.
By the way, if you're trying to convert the JPEG (JuddPeg) decoder
source code, I've already done 90% of that a few years back but I ran
into some of the same problems you're describing. You have to really
know the 6502 as well as you do the 6809, and I'm no expert with the
6502. What I did for most of the code was copy/replace into
lowercase so I could quickly see that the untranslated 6502
instructions were in all caps and the 6809 stuff in lowercase.
--
~ Roger Taylor
More information about the Coco
mailing list