Compiling object code

johnl@ima.isc.com (John R. Levine)
Wed, 20 Jan 88 20:47:38 EST

          From comp.compilers

Related articles
Compiling object code johnl@ima.isc.com (1988-01-20)
compiling object code hansen@mips.uucp (1988-01-21)
| List of all articles for this month |

Date: Wed, 20 Jan 88 20:47:38 EST
Newsgroups: comp.compilers
Expires:
References:
Original-sender:
From: johnl@ima.isc.com (John R. Levine)
Organization: Not enough to make any difference
Keywords: emulation simulation

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
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.