[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] MiNTLib for ColdFire



p.slegg@scubadivers.co.uk a écrit :
2. M68k assembler to Cf issues. Could existing assembler apps be de-compiled
into C (on any platform) so that they could be ported to Cf or any other
OS/hardware ? I realise de-compiling isn't great but I gather it's a lot
better than it used to be.

TOS executables can't be decompiled reliably.

Most parts can be disassembled to assembler sources. In clean executables, the CPU instructions are located only in the TEXT segment. Unfortunately, constant data is also mixed with instructions in the TEXT segment. So when a disassembler works on it, it can't know if the bytes are CPU instructions (needing to be disassembled) or data (needing to be converted into data declarations). However, the disassembling process could be assisted by a human to choose how the bytes should be treated.

Then decompilation of assembler sources to C would be very, very difficult, if not impossible. Hand-written assembler sources could probably never be decompiled to C sources, because they usually have different structures. Some assembler code generated by very old and bad C compilers (like some parts of the TOS ROMs) is easily recognizable, it always has the same structure, so it is a good candidate for trying decompilation. But I'm pretty sure it would not produce useful results.

I hope to be wrong.

--
Vincent Rivière