home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 4378 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.7 KB

  1. Path: surfnet.nl!sun4nl!xs4all!noblehouse!Ronald
  2. Newsgroups: comp.sys.amiga.programmer
  3. From: Ronald@noblehouse.xs4all.nl (Ronald van Eijck)
  4. Subject: Re: 680X0 -> PPC translator?
  5. References: <4fstt2$old@newsstand.cit.cornell.edu> <PETERM.96Feb19135541@tui.maths.irl.cri.nz> <4glch6$rle@ra.nrl.navy.mil> <1190.6631T892T581@und.ida.liu.se>
  6. X-NewsSoftware: GRn 2.1 Feb 19, 1994
  7. MIME-Version: 1.0
  8. Content-Type: text/plain; charset=iso-8859-1
  9. Content-Transfer-Encoding: 8bit
  10. Message-ID: <Ronald.07ii@noblehouse.xs4all.nl>
  11. Date: Wed, 28 Feb 96 11:09:17 CET
  12. Organization: R&R Software
  13.  
  14. In article <1190.6631T892T581@und.ida.liu.se> c92manen@und.ida.liu.se (Mans Engman) writes:
  15. >
  16. > fkrj@crux4.cit.cornell.edu (Benjamin Kenobi) writes:
  17. > >I'm just wondering, is there any good reason AT can't write a program
  18. > >which will tranlsate binary executables from 680X0 -> PPC, doing
  19. > >optimizations along the way?  That way we could translate most of our old
  20. > >software and it would run efficiently.  Why didn't Apple do this with the
  21. > >PowerMacs?
  22. >
  23. > It is not possible, in the general case, to do completely static code-
  24. > translation. This means that on some stage there always has to be some kind of
  25. > interpretation involved, no matter how complex you make the translator.
  26. > For instance, think about how to handle this simple question:
  27. > For a given program, what is code and what is data?
  28. > Ok, so you make a little code reachability test to find out...but then, how do
  29. > you make it handle indirect jumps (library calls!)? Hmm...just emulate the
  30. > code perhaps? :) How would you handle on-the-fly code creating/modifying? Ok,
  31. > so noone uses self-modifying code anymore, but what if some code is
  32. > compressed, for instance? You can't solve these problems without having rigid
  33. > rules which completely separate code from data. And that would break quite a
  34. > few programs.
  35.  
  36. How about an interpreter with a special 'memory mode' This means that you
  37. can start an application under the interpreter which then remembers the
  38. translated version of the code it interpreted. If you run the program once
  39. this way and make sure you have the largest part of the program executed at
  40. least once, especially those parts that need the speed, the interpreter can
  41. write out a new binary with the translated parts replaced. A system that
  42. would do this automatically and incrementally everytime you run the application
  43. would translate more and more of the program to native code everytime you
  44. run it. Still an awful complex piece of code I think but very nice once
  45. you have it. Goodbye to self modifying code but that should have been outlawed
  46. a long time ago anyway.
  47.  
  48. C'ya,
  49.  
  50. --
  51. * Ronald van Eijck
  52. *
  53. * If you know the enemy and know yourself, you need not fear
  54. * the result of a hundred battles. (Sun Tzu)
  55.