[comp.lang.asm370] Assembly language to C translation ?

mjd@central.cis.upenn.edu (Mark-Jason Dominus) (09/06/90)

In article <4535@buff7.UUCP> andrsonj@motcid.UUCP (John Anderson) writes:
   I have a large Assembly language program that I want to convert to
   C code.  Does anyone have any information about Assembly language to C
   translation ?  I have heard that translators exist and that several
   companies perform this service.

	A long time ago I worked for XYZ corporation ,which
manufactures BIGDB, a very large database-4GL-kitchensink
product.  It was originally written in Fortran and 370
Assembler to run under CMS or MVS or some other one of those
three-letter jobs.

	The UNIX port was rather difficult from what I hear,
and when I left they were considering just what you suggest.
Thy wanted to compile the Fortran on their IBM 3090, take
the resulting 370 assembly code, mail it to their Unix
machines, run it through their 370 Assembly-to-C translator,
and voila.  If they could fabricate a good enough
Assembly-to-C translator, the 370 assembly code would be
portable.  Like, gag me with a statistics package, OK?

	I asked how they planned to do the assembly-to-C
translation.  I was surprised to learn that they had a
prototype written already.  This was a company that spend no
money, and I mean none at all, on development or research or
anything except new creeping features.  They wouldn't even
buy new manuals: The entire Mainframe division, some thirty
or thirty-five programmers, had *one* copy of Principles of
Operation to share.

	``How does the translator work?'' I asked.

	``Well,'' said my friend in the Unix division, ``It
starts off by mallocing a lot of core, and by declaring
sixteen register int *'s, called R0, R1, R2...''

	I choked.  I guess my eyes probably bugged out.
They were going to simulate a 370 machine in C.  When the
`translator' saw the instruction to load register 7 with the
contents of memory location 0x3574, lo, it would generate
	*R7=memory[0x3574];

	My friend, mistaking the cause of the choke, looked
at me and shrugged.  ``I guess you think it'll be hard to
read,'' he said.  ``But really it won't be any harder to
read than the original assembly language was.''

	I wish I'd learned something from the experience,
but the best thing I can come up with is never to work for a
database company.
--

 In some sense a stochastic process can do better; at least it has a chance.
Mark-Jason Dominus 	  			    mjd@central.cis.upenn.edu