Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 Motivation  





2 Static binary translation  



2.1  Examples for static binary translations  







3 Dynamic binary translation  



3.1  Examples for dynamic binary translations in software  





3.2  Examples for dynamic binary translations in hardware  







4 See also  





5 References  





6 Further reading  














Binary translation






العربية
فارسی
Français

Nederlands

Русский
Українська

 

Edit links
 









Article
Talk
 

















Read
Edit
View history
 








Tools
   


Actions  



Read
Edit
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Cite this page
Get shortened URL
Download QR code
Wikidata item
 




Print/export  



Download as PDF
Printable version
 
















Appearance
   

 






From Wikipedia, the free encyclopedia
 


Incomputing, binary translation is a form of binary recompilation where sequences of instructions are translated from a source instruction set to the target instruction set. In some cases such as instruction set simulation, the target instruction set may be the same as the source instruction set, providing testing and debugging features such as instruction trace, conditional breakpoints and hot spot detection.

The two main types are static and dynamic binary translation. Translation can be done in hardware (for example, by circuits in a CPU) or in software (e.g. run-time engines, static recompiler, emulators).

Motivation[edit]

Binary translation is motivated by a lack of a binary for a target platform, the lack of source code to compile for the target platform, or otherwise difficulty in compiling the source for the target platform.

Statically-recompiled binaries run potentially faster than their respective emulated binaries, as the emulation overhead is removed. This is similar to the difference in performance between interpreted and compiled programs in general.

Static binary translation[edit]

A translator using static binary translation aims to convert all of the code of an executable file into code that runs on the target architecture without having to run the code first, as is done in dynamic binary translation. This is very difficult to do correctly, since not all the code can be discovered by the translator. For example, some parts of the executable may be reachable only through indirect branches, whose value is known only at run-time.

One such static binary translator uses universal superoptimizer peephole technology (developed by Sorav Bansal and Alex Aiken from Stanford University) to perform efficient translation between possibly many source and target pairs, with considerably low development costs and high performance of the target binary. In experiments of PowerPC-to-x86 translations, some binaries even outperformed native versions, but on average they ran at two-thirds of native speed.[1]

Examples for static binary translations[edit]

Honeywell provided a program called the Liberator for their Honeywell 200 series of computers; it could translate programs for the IBM 1400 series of computers into programs for the Honeywell 200 series.[2]

In 2014, an ARM architecture version of the 1998 video game StarCraft was generated by static recompilation and additional reverse engineering of the original x86 version.[3][4] The Pandora handheld community was capable of developing the required tools[5] on their own and achieving such translations successfully several times.[6][7]

For instance, a successful x86-to-x64 static recompilation was generated for the procedural terrain generator of the video game Cube World in 2014.[8]

Another example is the NES-to-x86 statically recompiled version of the videogame Super Mario Bros. which was generated under usage of LLVM in 2013.[9]

In 2004 Scott Elliott and Phillip R. Hutchinson at Nintendo developed a tool to generate "C" code from Game Boy binary that could then be compiled for a new platform and linked against a hardware library for use in airline entertainment systems.[10]

In 1995 Norman Ramsey at Bell Communications Research and Mary F. Fernandez at Department of Computer Science, Princeton University developed The New Jersey Machine-Code Toolkit that had the basic tools for static assembly translation.[11]

Dynamic binary translation[edit]

Dynamic binary translation (DBT) looks at a short sequence of code—typically on the order of a single basic block—then translates it and caches the resulting sequence. Code is only translated as it is discovered and when possible, and branch instructions are made to point to already translated and saved code (memoization).

Dynamic binary translation differs from simple emulation (eliminating the emulator's main read-decode-execute loop—a major performance bottleneck), paying for this by large overhead during translation time. This overhead is hopefully amortized as translated code sequences are executed multiple times.

More advanced dynamic translators employ dynamic recompilation where the translated code is instrumented to find out what portions are executed a large number of times, and these portions are optimized aggressively. This technique is reminiscent of a JIT compiler, and in fact such compilers (e.g. Sun's HotSpot technology) can be viewed as dynamic translators from a virtual instruction set (the bytecode) to a real one.

Examples for dynamic binary translations in software[edit]

Examples for dynamic binary translations in hardware[edit]

See also[edit]

References[edit]

  1. ^ Bansal, Sorav; Aiken, Alex (December 2008). "Binary Translation Using Peephole Superoptimizers" (PDF). Proceedings of the 8th USENIX conference on Operating systems design and implementation. pp. 177–192.
  • ^ Honeywell Series 200 Summary Description (PDF). Honeywell. February 1966. p. 11. For example, the instruction repertoire of Series 200 processors is similar enough to those of several other processing systcms, viz., the IBM 1400 series, to allow automated, one-time translation of programs written for these competitive systems to a form suitable for execution on higher-performance Series 200 systems.
  • ^ Steinlechner, Peter (2014-03-10). "Starcraft für ARM-Handheld kompiliert" (in German). golem.de. Retrieved 2014-03-25.
  • ^ notaz (2014-03-04). "StarCraft". repo.openpandora.org. Retrieved 2014-03-26.
  • ^ notaz (2014-03-01). "ia32rtools/". GitHub. Retrieved 2015-01-09.
  • ^ notaz (2014-03-04). "Starcraft". openpandora.org. Retrieved 2014-03-29. The "no source, no port" rule is not completely true, you can get something similar (but not the same) as a port through static recompilation. Similar stuff was done several times by M-HT for some DOS games. The game was also converted for Android with somewhat similar approach.
  • ^ M-HT. "Warcraft: Orcs & Humans". repo.openpandora.org.
  • ^ Kærlev, Mathias (2014-04-14). "Practical and Portable X86 Recompilation". Retrieved 2014-08-08. but then the idea of somehow using the original x86 machine code presented itself. However, for our open server, we need to support x86-64 as well, and in that case, we absolutely need emulation or recompilation. […] Static recompilation to assembler seemed like a much better option, but to keep it portable, we would need to write backends for x86, x86-64, and possibly ARM/PowerPC.
  • ^ Kelley, Andrew (2013-07-07). "Statically Recompiling NES Games into Native Executables with LLVM and Go". Retrieved 2013-08-08. This article presents original research regarding the possibility of statically disassembling and recompiling Nintendo Entertainment System games into native executables.
  • ^ US 7765539, Elliott, Scott & Hutchinson, Phillip, "System and method for trans-compiling video games", issued 2010 
  • ^ Ramsey, Norman; Fernandez, Mary F. (1995). "The New Jersey Machine-Code Toolkit". Proceeding TCON'95 Proceedings of the USENIX 1995 Technical Conference Proceedings. USENIX Association Berkeley, CA, USA. p. 24.
  • ^ a b Wharton, John Harrison (1994-08-01). "Gary Kildall, industry pioneer, dead at 52: created first microcomputer languages, disk operating systems". Microprocessor Report. 8 (10). MicroDesign Resources Inc. (MDR). Archived from the original on 2016-11-18. Retrieved 2016-11-18. […] Ironically, many of the techniques Gary pioneered are being rediscovered now, ten years later. Apple and DEC are touting binary recompilation as a "new" technology for porting existing software to the PowerPCorAlpha architecture. Actually, DRI introduced an 8080-to-8086 binary recompiler in the early 1980s. […]
  • ^ Carlson, Jim; Huck, Jerry (2003). Itanium Rising: Breaking Through Moore's Second Law of Computing Power. Prentice Hall PTR. ISBN 978-0-13046415-6. Retrieved 2015-01-09.
  • ^ "HP ARIES Dynamic Binary Translator". HP. Archived from the original on 2015-01-10. Retrieved 2015-01-09.
  • ^ Stokes, Jon. "Transmeta Crusoe Explored". Ars Technica. Retrieved 2015-01-09.
  • ^ Hughes, Rob (2000-01-20). "Transmeta's Crusoe Microprocessor". geek.com. Archived from the original on 2007-09-27.
  • ^ "Transmeta Crusoe Processor Frequently Asked Questions FAQ". Transmeta. 2007. Archived from the original on 2007-01-10.
  • Further reading[edit]

  • Bansal, Sorav; Aiken, Alex (December 2008). "Binary Translation Using Peephole Superoptimizers". Department of Computer Science and Engineering. Indian Institute of Technology Delhi. Retrieved 2014-03-30.
  • Baraz, Leonid; Devor, Tevi; Etzion, Orna; Goldenberg, Shalom; Skaletsky, Alex; Wang, Yun; Zemach, Yigal (2003). "IA-32 Execution Layer: a two-phase dynamic translator designed to support IA-32 applications on Itanium-based systems". Proceedings of the 36th Annual IEEE/ACM International Symposium on Microarchitecture. MICRO 36. Washington, DC, USA: IEEE Computer Society. pp. 191–. ISBN 978-0-7695-2043-8.
  • Toal, Graham. "An Emulator Writer's HOWTO for Static Binary Translation".
  • Chernoff, Anton; Herdeg, Mark; Hookway, Ray; Reeve, Chris; Rubin, Norman; Tye, Tony; Yadavalli, S. Bharadwaj; Yates, John (1998). "FX!32: A Profile-Directed Binary Translator". IEEE Micro. 18 (2): 56–64. doi:10.1109/40.671403. ISSN 0272-1732.
  • Souza, Maxwell; Nicácio, Daniel; Araújo, Guido (2010-06-23) [2010-06-19]. ISAMAP: Instruction Mapping Driven by Dynamic Translation. Computer Architecture - ISCA 2010 International Workshops. Saint-Malo, France. pp. 117–. ISBN 9783642243226.
  • Chen, Yu-hsin (2009-06-20) [2009-06-18]. "Dynamic Binary Translation from x86-32 code to x86-64 code for Virtualization" (PDF). Massachusetts Institute of Technology.

  • Retrieved from "https://en.wikipedia.org/w/index.php?title=Binary_translation&oldid=1219139794"

    Categories: 
    Emulation software
    Interpreters (computing)
    Virtualization
    Hidden categories: 
    CS1 German-language sources (de)
    Articles with short description
    Short description matches Wikidata
    Use mdy dates from March 2014
    All articles with unsourced statements
    Articles with unsourced statements from July 2011
    Articles with unsourced statements from February 2015
     



    This page was last edited on 16 April 2024, at 00:22 (UTC).

    Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



    Privacy policy

    About Wikipedia

    Disclaimers

    Contact Wikipedia

    Code of Conduct

    Developers

    Statistics

    Cookie statement

    Mobile view



    Wikimedia Foundation
    Powered by MediaWiki