johnl@ima.isc.com (John R. Levine) (01/21/88)
Yeah, I know all compilers emit object code. What I'm interested in is compiling object code for one computer to run on another. Say you have an old PDP-11 executable (the source for which was written in PDP-11 "as" but was lost in 1979) that you want to run on a PC or a Sun. The obvious approach is to interpret the object code, to pick up one instruction at a time, simulate it, update copies of all of the registers of the simulated machine, and then do the next instruction. This works fine, but is very slow, typically ten host instructions or more per simulated instruction. A different approach is to compile chunks of the simulated machine's code into chunks of the host's code. You might translate the whole program, or do pieces of it on demand. I hear that clever compilation schemes get to less than two host instructions per simulated instruction, which means you have close to native performance. I know I've read papers on this, and am sure there's anecdotal evidence that hasn't made it into print. Any leads, experience, war stories, or interesting rumors would be appreciated. John Levine -- John R. Levine, IECC, PO Box 349, Cambridge MA 02238-0349, +1 617 492 3869 { ihnp4 | decvax | cbosgd | harvard | yale }!ima!johnl, Levine@YALE.something -- Send compilers articles to ima!compilers or, in a pinch, to Levine@YALE.EDU Plausible paths are { ihnp4 | decvax | cbosgd | harvard | yale | bbn}!ima Please send responses to the originator of the message -- I cannot forward mail accidentally sent back to compilers. Meta-mail to ima!compilers-request