Re: Problem involved porting LCC to a 8 bit microcontroller

"Eric" <englere_geo@yahoo.com>
8 Sep 2006 00:26:45 -0400

          From comp.compilers

Related articles
Problem involved porting LCC to a 8 bit microcontroller amker.cheng@gmail.com (2006-09-06)
Re: Problem involved porting LCC to a 8 bit microcontroller englere_geo@yahoo.com (Eric) (2006-09-08)
Re: Problem involved porting LCC to a 8 bit microcontroller tmk@netvision.net.il (Michael Tiomkin) (2006-09-08)
Re: Problem involved porting LCC to a 8 bit microcontroller toby@telegraphics.com.au (toby) (2006-09-08)
Re: Problem involved porting LCC to a 8 bit microcontroller gah@ugcs.caltech.edu (glen herrmannsfeldt) (2006-09-08)
Re: Problem involved porting LCC to a 8 bit microcontroller raffaele.salmaso@gmail.com (Raffaele Salmaso) (2006-09-08)
| List of all articles for this month |
From: "Eric" <englere_geo@yahoo.com>
Newsgroups: comp.compilers
Date: 8 Sep 2006 00:26:45 -0400
Organization: http://groups.google.com
References: 06-09-007
Keywords: code, lcc
Posted-Date: 08 Sep 2006 00:26:45 EDT

amker.cheng@gmail.com wrote:


> But I found in LCC character and short-integer actual arguments are
> always promoted to the coresponding type even in the presence of a
> prototype!(And does there any place in it did similar thing?)
> So I have to use 2 8bit regsters for a char type argument!


chars are probably promoted to int when they're passed to a function.
LCC is mostly a K&R C compiler and, if my memory is correct, I don't
think they support ANSI prototypes? Maybe it only lets you declare the
return types of functions in the declaration that precedes the function
implementation?


You might also want to look at the TCC compiler if you can select a
compiler of your choice. Also, the SDCC compiler was specifically
designed to target small devices.


TCC produces an internal code which is then translated to native code.
I like this model because its easier to work with. And the TCC source
looks easier to read.


I think SDCC uses a yacc type of tool to assist in parser generation,
and this can be harder to work with if you don't have a good feel for
BNF. But if your task is to write a code generator for another
processor, then you shouldn't have to mess with the front-end.


Eric



Post a followup to this message

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