EmbeddedRelated.com
Forums

8051 C Compiler Recommendation

Started by Arthur Richards June 15, 2005
cbarn24050@aol.com wrote in
news:1118843009.132766.10710@f14g2000cwb.googlegroups.com: 

> > > Arthur Richards wrote: >> I'm finally moving up from assembler. Which compiler do you vote for? >> I can probably get away with the Raisonance Lite version but should I >> shell out the $'s & go for Keil or something else? > > > As you must know the 8051 is a great processor for assembly programs > but it's not so good for C. You can expect a tripleing, or even more, > size of rom space, at least doubleng of ram space and a reduction in > speed of 3to 10 times. You havent indicated what kind of things you > are writing so that may not be a problem for you. It's time to upgrade > your processor as well as moving to C, AVR and PIC18 series spring to > mind, I recently saw the new Zilog Z8 development system (hardware > plus compiler) on offer for $15 so I would look there first. If your > applications need high speed number crunching you should consider a 16 > bit processor there are good deals on those as well. >
I think you'd be quite surprised at the code that a good compiler will produce for the 8051. I will agree that a very good assembly programmer will produce better (smaller, faster) code in general. -- Richard
ssc@remove_me.copelandelectronics.com wrote:

I hope your software is better than your English grammar.

> Take a look here....I use they're compilers
'their' compilers - possessive
> for 8051 and pic almost > daily....I also sell them, so I'm only a little biased :->. They do have > demo's
'demos - plural of demo not possesive as implied by the apostrophe
> on their site.
> You can try them out and see how it works for you. >
'try them' plural - and 'see how it works' - singular Ian

cbarn24050@aol.com wrote:

> Arthur Richards wrote: > > I'm finally moving up from assembler. Which compiler do you vote for? I can > > probably get away with the Raisonance Lite version but should I shell out > > the $'s & go for Keil or something else? > > As you must know the 8051 is a great processor for assembly programs > but it's not so good for C. You can expect a tripleing, or even more, > size of rom space, at least doubleng of ram space and a reduction in > speed of 3to 10 times. You havent indicated what kind of things you are > writing so that may not be a problem for you. It's time to upgrade your > processor as well as moving to C, AVR and PIC18 series spring to mind, > I recently saw the new Zilog Z8 development system (hardware plus > compiler) on offer for $15 so I would look there first. If your > applications need high speed number crunching you should consider a 16 > bit processor there are good deals on those as well.
I had not Noticed! Where did you get those numbers. The worse I Ever heard for Keil is 10% to 20% ROM For a 10X hit on speed I would blame the programmer. Look at the List output to see if you inadvertently ask the compiler to do something you never would do in asm.
Hi Niel, it is very dependent on what you are doing. You will notice
the biggest difference on the small jobs ie. single chip apps. Have you
ever done a comparason? I have, not with the Kiel it's true but then I
stopped using 8051's at least 8 years ago maybe longer. If you would
like to write one of my small projects from back then just to see I'll
be happy to give you details.

In article <42AFC564.E551FF43@mail.asb.com>, Neil Kurzman
<nsk@mail.asb.com> writes
> > >Arthur Richards wrote: > >> I'm finally moving up from assembler. Which compiler do you vote for? I can >> probably get away with the Raisonance Lite version but should I shell out >> the $'s & go for Keil or something else? > >Keil is very good but a little $$$$ for a hobbyist. >they have a 2K limited eval version for free if you want to poke at it.
Some of the silicon manufactures kits have a 4K limited version -- \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ \/\/\/\/\ Chris Hills Staffs England /\/\/\/\/ /\/\/ chris@phaedsys.org www.phaedsys.org \/\/\ \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
In article <1118843009.132766.10710@f14g2000cwb.googlegroups.com>,
cbarn24050@aol.com writes
> > >Arthur Richards wrote: >> I'm finally moving up from assembler. Which compiler do you vote for? I can >> probably get away with the Raisonance Lite version but should I shell out >> the $'s & go for Keil or something else? > > >As you must know the 8051 is a great processor for assembly programs >but it's not so good for C. You can expect a tripleing, or even more, >size of rom space, at least doubleng of ram space and a reduction in >speed of 3to 10 times.
This is completely incorrect. Due to the aggressive data overlaying etc RAM space is often a lit less using the C compiler than using assembler. The C is a little less compact but mush easier to test and prove. There is no Lint for assembler.
>You havent indicated what kind of things you are >writing so that may not be a problem for you. It's time to upgrade your >processor as well as moving to C, AVR and PIC18 series spring to mind,
AVR possibly but not PIC18. However why change processor and all the tools when all the OP wants to do is move from asm to C onthe same processor.
>I recently saw the new Zilog Z8 development system (hardware plus >compiler) on offer for $15 so I would look there first. If your >applications need high speed number crunching you should consider a 16 >bit processor there are good deals on those as well.
I would not bother with anything 16 bit now. Go for ARM if the 8051 is not powerful enough. Apart from specialit parts the 16 bit market will disappear soon. -- \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ \/\/\/\/\ Chris Hills Staffs England /\/\/\/\/ /\/\/ chris@phaedsys.org www.phaedsys.org \/\/\ \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
In article <42B10A15.47F532F8@mail.asb.com>, Neil Kurzman
<nsk@mail.asb.com> writes
> > >cbarn24050@aol.com wrote: > >> Arthur Richards wrote: >> > I'm finally moving up from assembler. Which compiler do you vote for? I can >> > probably get away with the Raisonance Lite version but should I shell out >> > the $'s & go for Keil or something else? >> >> As you must know the 8051 is a great processor for assembly programs >> but it's not so good for C. You can expect a tripleing, or even more, >> size of rom space, at least doubleng of ram space and a reduction in >> speed of 3to 10 times. You havent indicated what kind of things you are >> writing so that may not be a problem for you. It's time to upgrade your >> processor as well as moving to C, AVR and PIC18 series spring to mind, >> I recently saw the new Zilog Z8 development system (hardware plus >> compiler) on offer for $15 so I would look there first. If your >> applications need high speed number crunching you should consider a 16 >> bit processor there are good deals on those as well. > >I had not Noticed! >Where did you get those numbers. >The worse I Ever heard for Keil is 10% to 20% ROM >For a 10X hit on speed I would blame the programmer. >Look at the List output to see if you inadvertently ask the compiler to do >something you never would do in asm.
I would agree with this. Also RAM usage will drop. I knew of 1 program that went from 125 bytes of RAM in assembler to 19 in C because of the data overlaying. IT was all pulled into Data space and therefore there was a speed increase. -- \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ \/\/\/\/\ Chris Hills Staffs England /\/\/\/\/ /\/\/ chris@phaedsys.org www.phaedsys.org \/\/\ \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
Chris Hills wrote:
> In article <1118843009.132766.10710@f14g2000cwb.googlegroups.com>, > cbarn24050@aol.com writes >
<snip>
> > > I would not bother with anything 16 bit now. Go for ARM if the 8051 is > not powerful enough. Apart from specialit parts the 16 bit market will > disappear soon. > >
That's not quite true - the market for "traditional" 16-bit processors is getting squeezed out by faster 8-bitters and smaller, cheaper 32-bitters, but there are 16-bit micros that have very clear markets with plenty of growth. The msp430 family in particular is like a solid 8-bit microcontroller, except that it has a 16-bit core, which is far more "C-friendly" than 8-bit cores.
On Thu, 16 Jun 2005 05:16:05 GMT, Neil Kurzman <nsk@mail.asb.com>
wrote:

> > >cbarn24050@aol.com wrote: > >> Arthur Richards wrote: >> > I'm finally moving up from assembler. Which compiler do you vote for? I can >> > probably get away with the Raisonance Lite version but should I shell out >> > the $'s & go for Keil or something else? >> >> As you must know the 8051 is a great processor for assembly programs >> but it's not so good for C. You can expect a tripleing, or even more, >> size of rom space, at least doubleng of ram space and a reduction in >> speed of 3to 10 times. You havent indicated what kind of things you are >> writing so that may not be a problem for you. It's time to upgrade your >> processor as well as moving to C, AVR and PIC18 series spring to mind, >> I recently saw the new Zilog Z8 development system (hardware plus >> compiler) on offer for $15 so I would look there first. If your >> applications need high speed number crunching you should consider a 16 >> bit processor there are good deals on those as well. > >I had not Noticed! >Where did you get those numbers. >The worse I Ever heard for Keil is 10% to 20% ROM >For a 10X hit on speed I would blame the programmer. >Look at the List output to see if you inadvertently ask the compiler to do >something you never would do in asm. >
It has been a while since I have used an 8051 with C. (Old IAR Compiler V4.x). This compiler generated more than a page (50 lines per page) of assembler to implement a call through a function pointer. How much code does a modern Keil compiler generate for a simple void, void function pointer call ? i.e. void foo(void) { } void bar(void) { void (*f)(void) =foo; f(); } Regards Anton Erasmus
"Anton Erasmus" <nobody@spam.prevent.net> wrote in message
news:1118919213.548a4ac2e2daba518c9bc56bdde53423@teranews...
> It has been a while since I have used an 8051 with C. (Old IAR > Compiler V4.x). This compiler generated more than a page (50 lines per > page) of assembler to implement a call through a function pointer. > How much code does a modern Keil compiler generate for a simple > void, void function pointer call ? i.e. > > void foo(void) > { > } > > void bar(void) > { > void (*f)(void) =foo; > f(); > } >
I cannot vouch for Keil, but Raisonance produces this: ASSEMBLY LISTING OF GENERATED OBJECT CODE ; FUNCTION foo (BEGIN) ; SOURCE LINE # 3 0000 22 RET ; FUNCTION foo (END) ; FUNCTION main (BEGIN) ; R2R3 is assigned to f ; SOURCE LINE # 8 0000 758300 R MOV DPH,#HIGH (foo) 0003 758200 R MOV DPL,#LOW (foo) 0006 120000 R LCALL ?C_INDCALL ; SOURCE LINE # 9 0009 22 RET ; FUNCTION main (END) And the resulting hex file contains 34 bytes of code while the same "program" without the call to foo compiles into 23 bytes. So this function pointer call produces 11 bytes. Compact enough ? :-)) (and all that for a 400 euro compiler). Meindert