C Compiler for 8051 microcontroler - Page 2

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Re: C Compiler for 8051 microcontroler
Quoted text here. Click to load it
... snip ...
Quoted text here. Click to load it

I believe there exists a GPL C test suite for gcc.  I know no
details.

--
Chuck F ( snipped-for-privacy@yahoo.com) ( snipped-for-privacy@worldnet.att.net)
   Available for consulting/temporary embedded and systems.
We've slightly trimmed the long signature. Click to see the full one.
Re: C Compiler for 8051 microcontroler

Quoted text here. Click to load it

How is that any different than having to test and validate the
verion you have of a commecial product?

Quoted text here. Click to load it

No, but their software has more bugs than open-source
equivalents according to a number of fairly extensive studies.
[Of course if you can't find an open-source equivalent, it's
moot.]

--
Grant Edwards                   grante             Yow!  -- I can do
                                  at               ANYTHING... I can
We've slightly trimmed the long signature. Click to see the full one.
Re: C Compiler for 8051 microcontroler
Quoted text here. Click to load it

Because it has already been tested with the plum hall suite and passed
so I don't have to do it.

Quoted text here. Click to load it

I suppose you have figures to back that up?  BTW this is for embedded
compilers.



/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills  Staffs  England    /\/\/\/\/\
/\/\/ snipped-for-privacy@phaedsys.org       www.phaedsys.org \/\/
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Re: C Compiler for 8051 microcontroler

Quoted text here. Click to load it

I did indeed give up on Zelda. I can assure you that for the 20 or so days
that I struggled with it, that I made very good use of the manual. I cranked
out only 70K of source in that time (very slow going), and on the last 3
days I got nowhere.

Quoted text here. Click to load it

You reach a point with Zelda at which it is just impossible to tell why the
compiler hangs, generates bizarre code, or gives you insensible error
messages. Ultimately no amount of 'working around' problems or re-ordering
code will please the compiler. I'm not sure about bug reports, but I sent a
few queries in.

ie. Why does this hang the compiler?

unsigned char xmodem_tx(unsigned char (*buffer_loader)(unsigned char *))
{
    unsigned char no_more = FALSE;
    xdata unsigned char packet_data_buffer[PACKET_DATA_BUFFER_LENGTH];

    do
    {
        no_more = (*buffer_loader)(packet_data_buffer);

etc.

I sent in a few queries regarding the printf() function too. There's
basically nothing in the manual regarding this, and the mailing list replies
weren't altogether what I had hoped for.

Incidentally, the Keil compiler has no problem with the above snippet. Nor
the 'curious truth', nor printing floating point numbers, nor passing
structures, nor....

Quoted text here. Click to load it

Yes, I subscribed to the mailing list for a month. On average there were 2
postings a day (most 6, least 0). Highly active? There seems to be a few
postings between the dedicated developers who are working feverishly to
improve Zelda, and then the predictable stream of "Gee, this is great...oh,
it's buggy...good luck guys. Seeya" type messages.

Quoted text here. Click to load it
one

I have no problem with that. I guess if I had logged each and every of the
numerous hiccups that I encountered, then I might be able to make a more
salient argument.

As it should be, it is then up to readers to make up their own minds. By all
means try SDCC. If you only use it as a lazy compiler (quite admirable in a
busy world, and with well resourced microcontrollers) then Zelda might be
for you. If you reach a level of familiarity at which you can appreciate the
'nick' Zelda, then you might think to cut your losses.

Regards,
Murray.
 _____________________________________
Murray R.Van Luyn
Revolutionary Urban Guerilla.
Ph:   +618 9354 1375
E-mail: snipped-for-privacy@iinet.net.au
           snipped-for-privacy@cs.curtin.edu.au




Re: C Compiler for 8051 microcontroler

Quoted text here. Click to load it

Now I *know* you are a troll.

Ian


Re: C Compiler for 8051 microcontroler
Quoted text here. Click to load it
... snip ...
Quoted text here. Click to load it

For one thing, you are giving buffer_loader a parameter of type:

  xdata unsigned char   /* whatever that may be */

when it requires:

  unsigned char *

so at most you are complaining about compiler error handling.  If
another compiler handles that without complaint it must be faulty.

--
Chuck F ( snipped-for-privacy@yahoo.com) ( snipped-for-privacy@worldnet.att.net)
   Available for consulting/temporary embedded and systems.
We've slightly trimmed the long signature. Click to see the full one.
Re: C Compiler for 8051 microcontroler
Quoted text here. Click to load it

Thanks Chuck. I always enjoy your posts.

I was pretty sure that I was passing the address in memory of the first
element of the packet_data_buffer array, to the function pointed to by
buffer_loader (which has as it's formal parameter a pointer to an element of
type unsigned char). Neither Borland C++ (minus the xdata part), nor the
Keil toolset seemed to mind.

I will look it up, though. I recognise that the first stage in effective
learning is to admit that I may not know everything, and am sometimes wrong.

Regards,
Murray.
_____________________________________
Murray R.Van Luyn
Revolutionary Urban Guerilla.
Ph:   +618 9354 1375
E-mail: snipped-for-privacy@iinet.net.au
           snipped-for-privacy@cs.curtin.edu.au



Re: C Compiler for 8051 microcontroler
On Wed, 14 Jan 2004 15:47:39 +0800, "M.R.Van Luyn."

[...]
Quoted text here. Click to load it

I've never tried SDCC, I don't know its ins and outs, but as far as
Keil is concerned...

Quoted text here. Click to load it

It is a strange piece of code...

You are requesting a local auto variable be located in xdata.  I
wasn't aware Keil would accept that silently.  From the limited
context you've provided, I can't tell for sure, , but I would expect
you meant "static xdata unsigned char..."  Perhaps thats what Keil
actually does.

Note that (in Keil) "unsigned char *" is a three-byte type, but "xdata
unsigned char *" is only a two-byte type.  Presumably Keil isn't
complaining because it coerces the type conversion.  Make sure that
any function you pass to xmodem_tx expects an "unsigned char *" and
not "xdata unsigned char *".

Regards,

                               -=Dave
--
Change is inevitable, progress is not.

Re: C Compiler for 8051 microcontroler
Quoted text here. Click to load it

Yes it is. Perhaps I should place it in a wider context. I wanted a module
that would xmodem transfer a file through the serial port, and which was
sufficiently modular to be readily incorporated into any application,
whether it be the current project or some later development. The only
external requirement for this module was to be an application specific
function that would refill a data buffer until all data had been
sent. I pass the address of this external function into the finished and
tested xmodem module when I want to send the file, so that I don't have to
screw about with the xmodem library module each time I use it. Nothing
ground-breaking, just trying to think about code management.

Quoted text here. Click to load it

Hmm. Keil seems to compile it like this without any fuss. If it stayed as an
auto I couldn't see a problem accessing the buffer from within the called
loader routine. Keil is quite probably doing something with it that I don't
understand just yet. Maybe the manual will shed some more light. There's
really no way for me to tell what Zelda does in this situation.

Quoted text here. Click to load it

Yes your quite right about the "unsigned char *" being a 3 byte, generic
pointer in Keil. I believe that such a pointer can be used to point to
variables in any data space, including xdata. At run time, when you pass it
a memory location, the type of memory space is recorded in the third byte.
It's apparently a slower method than Keil's 2 byte pointer access, but has
the advantage that my external buffer filling function need not be modified
if I subsequently choose to store the packet data buffer elsewhere in
memory. The same code will just as easily work with a buffer located in the
data memory space as in the xdata space. As you have suggested, I will be
careful to only pass a function that expects an "unsigned char *" to the
xmodem_tx function as above.

Gee, a good compiler manual makes you sound like a real expert. Well, at
least it doesn't leave you looking such a prawn.

The discrepancy  between an "xdata unsigned char" address being passed as an
actual parameter to the *buffer_loader function (which expects the address
of an "unsigned char") looks more and more like a stuff-up when viewed as
SDCC code. I remember being quite certain at the time of submitting it to
the SDCC mailing list, that this was how I had to address the situation with
Zelda, given my experience at that time. It looked odd when I re-posted it
here, but I left it that way. I really don't know now. To tell you the
truth, I don't think Zelda minds too much what a pointer references. The
snipet crashes the compiler no matter how you address the matter, so I guess
it's of no consequence.

Thanks for that one Dave.

Regards,
Murray.
_____________________________________
Murray R.Van Luyn
Revolutionary Urban Guerilla.
Ph:   +618 9354 1375
E-mail: snipped-for-privacy@iinet.net.au
           snipped-for-privacy@cs.curtin.edu.au











































Re: C Compiler for 8051 microcontroler

Quoted text here. Click to load it

Hi Murray,
I was wondering if that was recent.
According to the CVS log quite a lot has been done recently.

Regards
Robert

Re: C Compiler for 8051 microcontroler
Quoted text here. Click to load it

Thanks Robert.

Yes this was just a few weeks ago. I started out with the DOS version
1.2.2.1 2001/09/19 (oh, now I'm really asking for it, aren't I?), and then
moved to the latest Linux distribution. No improvement I'm afraid. I also
had a brief look at the CVS source. Highly impressive, but I couldn't figure
out how to compile it for my system.

I also tried Wickenhauser's C compiler. I found it a bit quirky, but an
overall improvement. I was a bit worried about the manual's claims that it
produced smaller, faster code, though. My programs always ran slow. It
looked like pretty good value.

Regards,
Murray.
_____________________________________
Murray R.Van Luyn
Revolutionary Urban Guerilla.
Ph:   +618 9354 1375
E-mail: snipped-for-privacy@iinet.net.au
           snipped-for-privacy@cs.curtin.edu.au



Re: C Compiler for 8051 microcontroler
M.R.Van Luyn. threw some tea leaves on the floor

Quoted text here. Click to load it

The released version is really quite old compared to the CVS version.



--
              Kind Regards from Terry
    My Desktop is powered by GNU/LinuX, Gentoo-1.4_rc2  
We've slightly trimmed the long signature. Click to see the full one.

Site Timeline