[Coco] Space Invaders - Translated from Intel 8080 to Motorola 6809 for the CoCo 3
msmcdoug at iinet.net.au
Thu Dec 29 22:06:09 EST 2016
On 30/12/2016 2:15 AM, camillus gmail wrote:
> I'm kind of interested in 6502 to 6809 coe translation. Do you have
> experience with this or know of any computer aid software to do
> Any info about this I would appreciate.
I've only done it by hand myself, I've never used an automated process
as others have.
I'm pretty sure this has been discussed relatively recently on this list
and a search of the archives will find a thread on the subject. There
was reference to some software that did automated 6502-6809 translation.
The main issue I had with Lode Runner was that it used, quite
extensively, an addressing mode that isn't directly supported on the
6809, to do with indirect pointers in zero page memory. That required 2
instructions for every instance in the 6502 code. And because of this, I
had a little juggling of X & Y registers in a handful of routines, but
not a lot. Everything else was a more-or-less 1-to-1 translation.
In fact, when I did Knight Lore (Z80) I found it went quite smoothly for
the most part as well. It used IX & IY extensively which I mapped to X,
Y on the 6809. Where routines used B,C,D,E,H & L to store intermediate
values, I set aside an area on the Direct Page for them. Warning, DP
accesses aren't quite as efficient as I'd hoped. Fortunately they didn't
use the Z80's alternate registers very much (at all? I can't recall).
Space Invaders was a similar proposition, although a little easier with
the 8080's lack of registers and instructions. The only gotcha I had was
in the interrupt routine, which pushed all the registers and re-used
them in the ISR. It finally dawned on me that I needed to have a 2nd
page of shadow Z80 registers for the ISR! ;)
More information about the Coco