[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] Greetings, and compilers/recompilers
From: |
Neil Bradley |
Subject: |
Re: [Tinycc-devel] Greetings, and compilers/recompilers |
Date: |
Sat, 6 Nov 2004 13:57:25 -0800 (PST) |
> > So I set out on the trek of writing a recompiler - something that
> > take Z80, 6502, etc... binary code and translate it back in to C.
> > the point, it would optimize and generate C code.
> That's an AI problem...
>
> What you're trying to do is recover symbolic information from a raw
> data stream.
Well, in an oversimplified way, yes, but I'm also trying to take that
information and recompile it in to another native machine code.
> I'm not sure what's up with the huge switch statement, but what most
> disassemblers do is try to find common programming constructs (such as
> procedures) in the code and then recover them with an arbitrary name...
That's one of the next steps - automatically identifying "procedures" and
making function calls out of them. There are a lot of addresses that are
pushed to the stack that aren't a requirement to run, but a lot of these
old games monkey with the stack pointer and the data on the stack to get
it to jump to other locations, and that's a hard thing to detect and
replicate.
-->Neil
-------------------------------------------------------------------------------
Neil Bradley "The true axis of evil in America is the brilliance of
Synthcom Systems, Inc. our marketing combined with the stupidity of our
people.." - Bill Maher