[comp.sys.intel] Looking for Z80 to 8086 translator

hartvig@freja.dk (Hartvig Ekner) (08/16/88)

Hello,

I'm looking for a translator (public domain with source if possible)
that can translate Z80 assembler to 8086 (source -> source). I have 
about 20000 lines of Z80 that must be rewritten to run on a PC, and even
if the translator only does part of the job, it would be a great help.

Thanks in advance,

Hartvig Ekner                  ...mcvax!diku!hartvig

leif@ambone.UUCP (Leif Andrew Rump) (08/17/88)

hartvig@freja.dk (Hartvig Ekner) writes:
>I'm looking for a translator (public domain with source if possible)
>that can translate Z80 assembler to 8086 (source -> source). I have 
>about 20000 lines of Z80 that must be rewritten to run on a PC, and even
>if the translator only does part of the job, it would be a great help.

It should be quite easy because the original 8088 was made to look
like 8080 meaning the source-assembler-format is the same so you
actually only need to substitude text to convert it! (Intel has some
papers that explain how to do it). The Z80 is a superset of the 8080
as 8088 is a superset of 8080, so if you can get your code from Z80 to
8080 using the same method and from 8080 to 8088 your problems is
solved! Except for on thing! Z80 has more commands than 8080 and 8080
has some special features that isn't included in 8088 but the most of
the job should be faily easy... :-)

>Thanks in advance,

Your welcome

   Leif Andrew Rump, Ambrasoft A/S, Roejelskaer 15, DK-2840 Holte (Denmark)
 UUCP: leif@ambone.dk, phone: +45 2424 111; ABC BBS: +45 68 00 544 (2:505/38)

Please note the node-change:                    Ambone, Italian for a pulpit
(The following interpretations emerged          Am_bone, Ambrasoft A/S bone
 when Ambone was put down on paper and          Amb_one, Ambrasoft A/S #one
 accepted - they are solely mine!!!!!)          ...

kirchner@uklirb.UUCP (Reinhard Kirchner) (08/26/88)

From article <135@ambone.UUCP>, by leif@ambone.UUCP (Leif Andrew Rump):
> hartvig@freja.dk (Hartvig Ekner) writes:
> 
> It should be quite easy because the original 8088 was made to look
> like 8080 meaning the source-assembler-format is the same so you
> actually only need to substitude text to convert it! (Intel has some
> papers that explain how to do it). The Z80 is a superset of the 8080
> as 8088 is a superset of 8080, so if you can get your code from Z80 to
> 8080 using the same method and from 8080 to 8088 your problems is
> solved! Except for on thing! Z80 has more commands than 8080 and 8080
> has some special features that isn't included in 8088 but the most of
> the job should be faily easy... :-)
> 
The thing is not as easy as it looks. Years ago ( >=5 ) we got such a
translator from intel to run on CP/M. With it came a handbook which
showed how the special z80-opcodes are translated. We found out
that most of them resulted in rather terrible 8086-code. This
comes partly from the different use of the flags, so the 8086-code
contained lots of
     save flags
     emulate 780-instr
     load flags
     save flags
     emulate z80-instr
     load flags
        .
        .
The code was mostly correct, but very long and slow, so we had to rework
it to make it usable.

BTW: The code we translated was interpreter, runtime-system and arithmetic
routines of PASCAL-SC, which is now available for the IBM-PC from
Whiley in US and Teubner in Europe. ( Very modest price -:) )

R. Kirchner  ( speaking for himself, what else )