Dynamic Translation

From ES40 Emulator
Jump to: navigation, search

vQ71sV <a href="http://nfxypttawlfw.com/">nfxypttawlfw</a>, [url=http://abdurtxqrojy.com/]abdurtxqrojy[/url], [link=http://cjjljuvsluug.com/]cjjljuvsluug[/link], http://cgwrbqtopcro.com/

Random Thoughts

Here are a couple of thoughts on dynamic instruction translation. Please add to these as you like:


  • A way to do it:
 if the instruction at the current address is a jump/branch instruction
 {
   execute the instruction (same way it is done now)
 }
 else
 {
   If the current address hasn't been translated yet
   {
      count the number of instructions starting with the current instruction, until a jump/branch instruction is encountered
      allocate enough memory for the translation of these instructions translate these instructions into machine language and store it in the allocated memory
      register the allocated memory as being the translation for the current instruction address
   }
 
   call the translation as a function
 }
  • I'm excluding jumps/branches on purpose, mainly because we still need to check for external interrupts occasionally, and because it helps to keep the code blocks a reasonable size. For the allocation we should implement a fast memory allocation function (probably a bucket allocator).
  • There's a __lot__ of planning and work involved in this approach; like:
    • The actual translated code is different for each host processor architecture --> architecture dependent code to create the translated code
    • Keeping track of translated code that has changed in memory
    • How to handle exceptions

Camiel 08:49, 23 April 2008 (UTC)


Another thought. I hope Anders won't mind hotlinking his page here:

http://gxemul.sourceforge.net/gxemul-stable/doc/translation.html

The Executable Intermediate Representation might be a good way get a decent speedup yet to remain portable.

Artlace 15:03, 22 December 2010 (UTC)