|Generic Assembler? email@example.com (Chris Williams) (2005-02-28)|
|Re: Generic Assembler? firstname.lastname@example.org (Randy) (2005-02-28)|
|Re: Generic Assembler? email@example.com (glen herrmannsfeldt) (2005-03-01)|
|Re: Generic Assembler? firstname.lastname@example.org (Vidar Hokstad) (2005-03-04)|
|Date:||28 Feb 2005 19:51:27 -0500|
|Organization:||Rice University, Houston, TX|
|Posted-Date:||28 Feb 2005 19:51:27 EST|
Chris Williams wrote:
> I have started work (i.e. research and structure-creating algorithms)
> on a compiler that is intended to work solely as a scripted
> preprocessor--preprocessing the source code in levels based on
> symbological and structural definitions, then translating that into a
> lower level format via scripting. This process would be repeated for
> varying layers of languages, with the output of each being fed into
> the next layer.
> C ruleset -> Generic Assembler Language -> Platform Assembler -> Bytes
> -> Object File
> Also kindly note that I have never created a compiler and am only on
> about page 14 of the Dragon Book, so...be gentle.
> Thank you,
> Chris Williams
Check out the Architecture-Neutral Distribution Format (ANDF)
project's web page. ANDF was a serious and well funded attempt from
about 1990 that sought to create a generic object file format that
would be portable onto many CPU/OS architectures while preserving
optimization. Commercially, it did not succeed.
You'll want to learn its lessons.
BTW, GCC's RTL is somewhat similar to a generic assembly language.
It's an Intermediate Representation (IR) language derived from the
compiler's Abstract Syntax Trees that is further optimized before
being translated into the target assembly. The design of RTL and the
process used by GCC to do this translation may be of interest to you.
LCC is another easily retargetable C compiler which also generates
assembly portably. It's smaller and more comprehensible than GCC, so
it may be more accessible to you:
Here are two interesting threads from 2004 and 1997 on generic assemblers:
Here's a generic assembler project on Sourceforge:
Randy Crawford http://www.ruf.rice.edu/~rand rand AT rice DOT edu
[ANDF is the most recent in a long line of projects generally known as
UNCOLs, attempts to make a universal intermediate language. They all
failed. If you constrain your source and target languages enough you
can get them to work, but the more general you try to get, the faster
you run into heat death. -John]
Return to the
Search the comp.compilers archives again.