[Coco] Space Invaders - Translated from Intel 8080 to Motorola 6809 for the CoCo 3

Glen Hewlett glen.hewlett at sympatico.ca
Tue Jan 3 12:16:56 EST 2017


Hi Mark,

I think by hand is the best way to do the transcoding in the end.  Although if I started out thinking that I probably wouldn’t have even tried.  I wrote transcoding program because at the time I was very unfamiliar with 8080 and Z80 code and it took too long for me to know what the LD instructions were doing for sure.  With my program it at least gives me the general idea of what the Z80 instruction is doing.  In the end, I probably did end up going through it line by line anyways since there are some many registers and things that need tweaking.

Yeah that Space Invaders ISR was a pain in the butt for me too!  I too didn’t think the ISR would be messing up my temporary registers until I did a lot of fighting….MAME debug mode is so useful for doing this type of troubling shooting.  I’d be lost without it.

Cheers,
Glen

> On Dec 29, 2016, at 10:06 PM, Mark McDougall <msmcdoug at iinet.net.au> wrote:
> 
> 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
>> this?
>> 
>> 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! ;)
> 
> Regards,
> 
> -- 
> Mark McDougall
> <http://retroports.blogspot.com.au>
> 
> -- 
> Coco mailing list
> Coco at maltedmedia.com
> https://pairlist5.pair.net/mailman/listinfo/coco



More information about the Coco mailing list