Kenn Heinrich <kwheinri@sunee.uwaterloo.ca> (04/12/91)
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? Kenn kwheinri@sunee.uwaterloo.ca P.S. This account may vanish in two weeks --fourth year isn't _all_ privileges and perks :-) -- Send compilers articles to compilers@iecc.cambridge.ma.us or {ima | spdcc | world}!iecc!compilers. Meta-mail to compilers-request.