First of all, in order to do that, you need to accurately disassemble x86 machine code. But that's not easy, because x86 machine code allows you to insert strings inside the program and "jmp" over them. When writing x86 assembly code, I often do stuff like:
Code: Select all
jmp hello_world$
hello_world:
db "Hello world!",10,0
hello_world$:
And once you disassemble the program, well, there comes another huge problem. The x86 instructions do not map into ARM instructions. This is especially true for FPU instructions (that deal with decimal numbers). FPU instructions in x86 are stack-based, whereas the FPU instructions in ARM are register-based. It seems obvious to me that there is no algorithm which could translate x86 FPU instructions to ARM on-the-fly. If there were, I could easily make my ArithmeticExpressionCompiler output ARM assembly, and not just x86 assembly.
I have a Bachelor Degree in Computer Engineering, so I can be considered an expert in things like this. This is not exactly like when I was denying the 1969 Moon Landing without having a clue about rocket science.