Re: Compiler for accumulator-based processor

"Stephen S. Mitchell" <ssmitch@erols.com>
29 Nov 1997 00:18:05 -0500

          From comp.compilers

Related articles
Compiler for accumulator-based processor Jean-Christophe.Le_Lann@irisa.fr (Jean-Christophe Le Lann) (1997-11-20)
Re: Compiler for accumulator-based processor ssolyanik@icdc.com (Sergey Solyanik) (1997-11-23)
Re: Compiler for accumulator-based processor rpgurd@archelon.com (Preston Gurd) (1997-11-23)
Re: Compiler for accumulator-based processor ssmitch@erols.com (Stephen S. Mitchell) (1997-11-29)
Re: Compiler for accumulator-based processor amoroso@mclink.it (1997-11-29)
Re: Compiler for accumulator-based processor jmccarty@sun1307.spd.dsccc.com (1997-12-05)
| List of all articles for this month |
From: "Stephen S. Mitchell" <ssmitch@erols.com>
Newsgroups: comp.compilers
Date: 29 Nov 1997 00:18:05 -0500
Organization: Erol's Internet Services
References: 97-11-110 97-11-129
Keywords: code

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
Alexandria, Virginia
--


Post a followup to this message

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