Code Generators

Kenn Heinrich <>
Fri, 12 Apr 91 04:47:13 EDT

          From comp.compilers

Related articles
Code Generators (Kenn Heinrich) (1991-04-12)
Code Generators (Mike Lichak) (1998-08-22)
Re: Code Generators (Chris F Clark) (1998-08-24)
Re: Code Generators (1998-08-24)
Re: Code Generators (Joachim Durchholz) (1998-08-25)
Re: Code Generators (1998-08-25)
Re: Code Generators (1998-08-25)
| List of all articles for this month |

Newsgroups: comp.compilers
From: Kenn Heinrich <>
Keywords: code, optimize
Organization: Compilers Central
Date: Fri, 12 Apr 91 04:47:13 EDT

Hi all,

Most papers I see in the journals nowadays about code generation are
oriented towards machines with very orthogonal instructions and large
register sets. I am looking for information on code generation at the
other end of the spectrum -- non-uniform instructions on small, irregular
register sets.

My particular interest is in the Zilog Z80. I know this is a slightly
older beast, but there must have been a few theses on 8 bit uP compilers
during the 70's. Basically, I'm looking for ideas on how to handle a
machine like this is a _systematic_ way. I've written one pretty basic
code generator, and I've seen how Small-C does it, but switch{} statements
leave a lot of room for improvement.

The big hurdle is the register allocation, given that most of the
operations can only be performed between certain registers. The fact that
the Z80 is essentially an accumulator machine makes it fairly simple to
traverse a parse tree and generate two-register stack machine styled code,
but using the other registers would clean the code up considerably.

Is some sort of tree matching scheme good for this? Or would a graph
representation of the code and the possible dataflow work? I'm after an
analytic approach that could produce tight, efficient code, even if it
takes a while for the compiler to wade through the possibilities.

Does anyone have references or thoughts on this problem, or even source
for some sort of implementation?


P.S. This account may vanish in two weeks --fourth year isn't _all_ privileges
          and perks :-)

Post a followup to this message

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