[Coco] 6809 Q [Mark Mc]

CoCoList for Color Computer Enthusiasts coco at maltedmedia.com
Thu May 15 15:00:14 EDT 2014


As someone that converted a lot of games from 6502 to 6809, you don't 
convert instruction by instruction.  You first figure out what the code 
is doing and then rewrite the whole block in 6809.

The 6502 does not have any 16 registers, but it uses direct page as 128 
16-bit pointers.  Your "(8)" on the 6502 is really using memory location 
byte 8 as a 16-bit pointer.  On the 6809, you would used LDA B,X.

Since the 6809 does not have 128 16-bit registers, you will have to 
write new code that uses only a few 16-bits registers to do the work.  
Since you are using registers that are internal to CPU, the code will 
run faster.

It should be noted that while the CoCo 3 graphics system simpler than 
the Apple II, the CoCo 3 has 5 times the memory to update. (If you are 
using the 320 by 200, 16 color mode.)  You will need bit of speed in the 
code to make for extra graphics ram to update.

Steve

On 5/15/2014 8:09 AM, CoCoList for Color Computer Enthusiasts 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,
>




More information about the Coco mailing list