|Compiler for accumulator-based processor Jean-Christophe.Le_Lann@irisa.fr (Jean-Christophe Le Lann) (1997-11-20)|
|Re: Compiler for accumulator-based processor email@example.com (Sergey Solyanik) (1997-11-23)|
|Re: Compiler for accumulator-based processor firstname.lastname@example.org (Preston Gurd) (1997-11-23)|
|Re: Compiler for accumulator-based processor email@example.com (Stephen S. Mitchell) (1997-11-29)|
|Re: Compiler for accumulator-based processor firstname.lastname@example.org (1997-11-29)|
|Re: Compiler for accumulator-based processor email@example.com (1997-12-05)|
|From:||"Stephen S. Mitchell" <firstname.lastname@example.org>|
|Date:||29 Nov 1997 00:18:05 -0500|
|Organization:||Erol's Internet Services|
Jean-Christophe Le Lann wrote:
> > I don't know much about compilers but I'd like to build (or get) one
> > to produce code for a very simple 8-bit microprocessor named Hercules
> > (originally designed by Pr. N.Wirth for educationnal purpose).
> > It is based on a single register ("accumulator").
Sergey Solyanik wrote:
> Try the Small C Compiler. <snip>
The Small-C compiler, a C-subset compiler orginally written by Ron Cain
and improved by a host of revisors, most notably James Henrix, does not
generate code for a single-register machine, and I would think it would
be pretty tough to get it do so without some serious work. The Small-C
machine model assumes two registers, one called the "primary" register
which is used like an accumulator (and holds the return value for
functions) and a secondary register. For the Intel 8080, the chip for
which the compiler was originally written, the primary register is the
HL register pair, and the secondary register is the DE register pair.
Of course, except for addition, you can't do anything any arithmetic
with just those two registers on the 8080, and the actual generated code
makes heavy use of the 8080's real accumlator, the A register.
Stephen S. Mitchell
Return to the
Search the comp.compilers archives again.