Compiling to C (where C is used as misspelled assembly)

Ray Dillinger <bear@sonic.net>
14 May 1997 23:58:44 -0400

          From comp.compilers

Related articles
Compiling to C (where C is used as misspelled assembly) bear@sonic.net (Ray Dillinger) (1997-05-14)
Re: Compiling to C (where C is used as misspelled assembly) fabre@gr.osf.org (Christian Fabre) (1997-05-16)
Re: Compiling to C (where C is used as misspelled assembly) fjh@mundook.cs.mu.OZ.AU (1997-05-16)
Re: Compiling to C (where C is used as misspelled assembly) chase@world.std.com (David Chase) (1997-05-16)
Re: Compiling to C (where C is used as misspelled assembly) darius@phidani.be (Darius Blasband) (1997-05-16)
Re: Compiling to C (where C is used as misspelled assembly) hbaker@netcom.com (1997-05-16)
Re: Compiling to C (where C is used as misspelled assembly) ramb@spring.epic.com (Ram Bhamidipaty) (1997-05-16)
[11 later articles]
| List of all articles for this month |

From: Ray Dillinger <bear@sonic.net>
Newsgroups: comp.lang.scheme,comp.compilers
Date: 14 May 1997 23:58:44 -0400
Organization: Cognitive Dissidents
Keywords: C, assembler

I've been looking for a good target language for compilation;
something way close to machine code, with all the subroutine calls
abstracted out to explicit stack handling, forward goto's, and
conditional goto's, all the variables abstracted out to heavily-reused
registers and symbol-table refs, etc.


And, I think a lobotomized subset of C does what I want. I can write
this kind of pseudo-machine code in C, with a honking huge main()
routine, global variables for the registers, etc. So, I could emit
assembler (for a known machine architecture) or equivalent C (for an
unknown architecture) with virtually no changes in the compiler except
reading in a different table of output terminal strings.


However, this will violate every "reasonable" assumption a maker of C
compiers will have about programming style. It will mean a program is
compiled into a *single routine* of C code, with Goto destinations
that might be more than 64K bytes away -- and no templates, no library
functions linked, no header files, etc etc....


Will modern C systems handle this?
[Probably not. Machine generated source code always seems to break
compilers designed for code written by humans. -John]


--


Post a followup to this message

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