Re: It has been done before



Alex McDonald wrote:

> Machine translation of x86 assembler to another platform is
> much more complex than outputting equivalent code sequences, and
> approaches and even exceeds the effort necessary to write a compiler.

I have been approached by a number of people asking for a win32 version of
Sinclair Spectrum games. This involves either of two methods:

1. Add the "game" as a stub to an emulator, effectively pre-filling the
emulated z80 registers and memory model.
2. Convert the z80 assembly to x86.

Option 1 is trivial, but requires quite a large amount of bloat, as the
emulation engine is attached to each executable. It's simpler to load your
game into a regular emulator.

Option 2 is a lot harder than it sounds. The x86 being a (distant) relative
of the z80, the flags register is largely the same with opcodes almost
mapping 1:1 in some cases. However, there's not just the processor to
consider - the screen display utilised a rather odd mapping which would have
to be taken into account, and the sound was produced either as a square wave
or with an AY-3-8912 chip. This would also have to be translated into PCM
sounds, which introduces all sorts of timing and interrupt issues - aside
from the lowly 50hz interrupt needed to get a decent reproduction of the
original code running. It's not *just* the original processor - the rest of
the hardware involved needs to be taken into account. I don't know what's
involved in setting up a 50hz interrupt in Windows, but I suspect it's
non-trivial.

In short, we gave up at the planning stage. We've already written a couple
of emulators, and don't feel that the work involved in translating z80 to
x86 is worth the end result.

Just my 2p :-)

D.


.



Relevant Pages

  • Re: Two Click disassembly/reassembly
    ... >> And that means it will run about 2-10x faster than an emulator. ... > compiler can't handle here. ... > are required to change the IP; like the MIPS. ... Simply translating the x86 code to ...
    (alt.lang.asm)
  • Re: Question on Tutorial: Building a Run-Time Image for the Emulat
    ... Are you aware of a plan to update the X86 emulator similar to the Windows CE ... Bob Hanson ... I did install the updates and worked through the tutorial. ...
    (microsoft.public.windowsce.embedded)
  • Re: KeyBoardHook OpenNetCF with Windows CE 5.0
    ... Chris Tacke, Embedded MVP ... setting on their emulator is X86, which is referring to their PC ... KeyboardHook m_keyHook; ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: KeyBoardHook OpenNetCF with Windows CE 5.0
    ... the processor type is StrongArm/Xscale and the ... setting on their emulator is X86, which is referring to their PC ... I am using OpenNetCF ver 2.3 community ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Questions regarding x86
    ... There will be some performance differences between x86 and ARM, but generally the emulator will perform slower than a real device, so if you have good performance there you should be fine on your x86 device. ... If your application developers need to interact with drivers specific to your device, your app developers can stub out those calls in their apps while the device is still in development. ... I tried setting the debug action to "Start external program" ...
    (microsoft.public.windowsce.platbuilder)