Why should emulation be done in real time?

I understand what the emulator does by changing one machine language to another, often “right on time”. Can such a program be built in that it is read in binary format, which is written for one architecture and saves a new binary file for another architecture. Upon completion of the process, he will leave the user with a binary ready for his own execution in this architecture. This would be especially useful for those who have expensive proprietary applications for legacy architecture.

Is it possible to make such an application? Binary recompilation is not a new concept, but I have yet to find useful options.

With the help of some others, I would be delighted to start coding an open source implementation of such a program, if possible.

+5
source share
3 answers

Static recompilation is a promising way to transfer binary files from a foreign architecture to another target architecture. This will be faster than Just-In-Time (JIT) because it does not need to compile the code before running, and because the extra compilation time it may take is useful for optimizing the generation code.

However, JIT compilation uses dynamic program analysis, and static recompilation is based on static program analysis (hence the name).

In static analysis, you do not have runtime information at runtime.

. , switch, (, ). :

JMP reg_A 

, , . , , . , , . reg_A . . , , , reg_A. , reg_A , , . , , reg_A , . ( switch, - ), .

, , , !

, , . , .

, , - , , .

, A:

41 xx (size 2): Add xx to `A`.
42 (size 1): Increment `A` by one.

:

41 42

, - 41. :

 41 42 (size 2): Add 42 to `A`.

, 41 - ? :

 42 (size 1): Increment `A` by one.

, , , , , !

, ! JIT-. - , , . , , !

- ( , , ), NES, . .

JIT , , , .

+4

, . - , " " . , .

- , , . , , , , . Corn, N64, , , N64, , .

(.. x86 PowerPC), , , . " " .

+3

, .

, .

, ; , . , , , , .

0

All Articles