Re: Generic Assembler?

Randy <joe@burgershack.com>
28 Feb 2005 19:51:27 -0500

          From comp.compilers

Related articles
Generic Assembler? thesagerat@yahoo.co.jp (Chris Williams) (2005-02-28)
Re: Generic Assembler? joe@burgershack.com (Randy) (2005-02-28)
Re: Generic Assembler? gah@ugcs.caltech.edu (glen herrmannsfeldt) (2005-03-01)
Re: Generic Assembler? vidar@hokstad.name (Vidar Hokstad) (2005-03-04)
| List of all articles for this month |

From: Randy <joe@burgershack.com>
Newsgroups: comp.compilers
Date: 28 Feb 2005 19:51:27 -0500
Organization: Rice University, Houston, TX
References: 05-02-097
Keywords: assembler
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.


    http://www.info.uni-karlsruhe.de/~andf/


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.


    http://www.cse.ohio-state.edu/cgi-bin/info/info/gcc,RTL
    http://www.cse.ohio-state.edu/cgi-bin/info/info/gcc
    http://www.psc.edu/general/software/packages/gcc/manual/gcc_toc.html


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:


    http://www.cs.princeton.edu/software/lcc/


Here are two interesting threads from 2004 and 1997 on generic assemblers:


    http://www.codecomments.com/archive285-2004-8-234437.html
    http://compilers.iecc.com/comparch/article/97-05-156


Here's a generic assembler project on Sourceforge:


    http://sourceforge.net/projects/sgasm/


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



Post a followup to this message

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