Re: Two Click disassembly/reassembly




¬a\/b wrote:
> On Tue, 24 Jan 2006 08:05:47 GMT, "\\\\\\o///annabee"
> <fack@xxxxxxxxxxxxxx> wrote:
>
> >På Tue, 24 Jan 2006 01:58:16 -0500, skrev Frank Kotler
> ><fbkotler@xxxxxxxxxxx>:
> >
> >> Funny no one has done it. Perhaps they lack Betov's "vision"...
> >
> >Anyway. Why do you think it could not be done?
>
> it is very easy,

It is very easy if you define a minimal CPU and only do the conversion
from that CPU to all the others. However, Rene is talking about
converting x86 assembly language code to machine code for other
processors. This is a *very* difficult problem. Consider the following
code sequence, for example:

mov eax, someCodePtr
add eax, 4
jmp eax

Without question, you can translate these instruction, one for one, to
many other processors. But will the result behave the same as the
original x86 code? Doubtful. This code sequence skips four bytes of
opcodes at the address specified by someCodePtr. Alas, when you
translate the x86 code at the address specified by someCodePtr to the
target processor, it's unlikely that the code at that address is a
four-byte instruction that can be easily skipped by the code above.
This is but *one* of the serious problems associated with doing the
compilation. As Alex says, emulation/interpretation is *much* easier.
Compilation is *very* difficult as AFAIK it's still an open research
problem (working from source code, at least; working from binary is an
undecideable problem for the same reason disassembly is undecideable).

> it is possible if in each cpu there is a common "minimal cpu".
>
> example: there are
>
> 1) 7 address for 7 8-bit registers
> 2) 7 address for 7 16-bit registers
> 3) 7 address for 7 32-bit registers
> 4) principal logical operators for 8-16-32 address registers: and,
> not, or etc
> 5) all instructions for jumps use the data in 8-16-32 registers
> 6) a stack and the register 7 that point to it
>
> *in each cpu*: so it is an "hardware port" :) so it could be in the
> future, not now and should be agree all ones that build cpu.
>
> and for portable use we have to use the subset of the language
> of each cpu (that use 1-2-3-4-5-6) "the minimal cpu".
> all the probelms are define "the minimal cpu" that is easy to program
Yes, you can build a trivial processor whose semantics can be expressed
in just about every other assembly language. That's not what this
thread is about.

Cheers,
Randy Hyde

.