Re: C code .vs. Assembly code for Microcontrollers/DSPs ?

thinklab@earth.usa.net (Clive Smith/Thinklabs)
8 Mar 1996 00:05:37 -0500

          From comp.compilers

Related articles
[8 earlier articles]
Re: C code .vs. Assembly code for Microcontrollers/DSPs ? torbenm@diku.dk (1996-03-05)
Re: C code .vs. Assembly code for Microcontrollers/DSPs ? hatrjo@hat-fi.kone.com (Risto Jokinen) (1996-03-05)
Re: C code .vs. Assembly code for Microcontrollers/DSPs ? max@gac.edu (1996-03-06)
Re: C code .vs. Assembly code for Microcontrollers/DSPs ? rhn@sgi.com (Ron Nicholson) (1996-03-06)
Re: C code .vs. Assembly code for Microcontrollers/DSPs ? yatesc@csee.usf.edu (1996-03-06)
Re: C code .vs. Assembly code for Microcontrollers/DSPs ? cdg@nullstone.com (1996-03-07)
Re: C code .vs. Assembly code for Microcontrollers/DSPs ? thinklab@earth.usa.net (1996-03-08)
Re: C code .vs. Assembly code for Microcontrollers/DSPs ? tchannon@black.demon.co.uk (Tim Channon) (1996-03-08)
Re: C code .vs. Assembly code for Microcontrollers/DSPs ? koopman@cs.cmu.edu (1996-03-08)
Re: C code .vs. Assembly code for Microcontrollers/DSPs ? hbaker@netcom.com (1996-03-08)
Re: C code .vs. Assembly code for Microcontrollers/DSPs ? mac@coos.dartmouth.edu (1996-03-08)
Re: C code .vs. Assembly code for Microcontrollers/DSPs ? cdg@nullstone.com (1996-03-08)
Re: C code .vs. Assembly code for Microcontrollers/DSPs ? regnirps@aol.com (1996-03-10)
[35 later articles]
| List of all articles for this month |

From: thinklab@earth.usa.net (Clive Smith/Thinklabs)
Newsgroups: comp.compilers,comp.dsp
Followup-To: comp.compilers,comp.dsp
Date: 8 Mar 1996 00:05:37 -0500
Organization: Internet Express (800-592-1240 customer service)
References: 96-03-006 96-03-041
Keywords: optimize, DSP

Here's my 2 cents:


I recently did some work on an 8051 (actuallt the Dallas hi-speed
version). I used the Keil C compiler. It was very important to me that
I could use Assembler embedded in the C. The guy told me it is quite
simple, but I wouldn't need it. He was absolutely correct. The C code
produces excellent Assembler code, which is mostly EXACTLY what I
would have written anyway. The compiler was even aware of the crappy
bit and byte architecture of the 8051 and optimized accordingly.


There were a few places it did some silly things, but it made up for
it by being able to optimize the use of registers better than I
could. For instance, if you call a subroutine, it'll use registers for
temprary variables in a very clever way, and doesn't bother saving
variables if those registers aren;t used. As an assembler programmer,
I wouldn't cut such corners, because I wouldn't be able to manually do
all the accounting needed to kep things straight, and the code would
be unmaintainable with such lack are care.


So all in all, it was excellent.


Now onto DSP's - for the things I've been doing on DSP's, in order to
get the speed, one has to use all sorts of tricks, as described by
others. I think many of them could be done by a compiler, but not any
I've heard of YET.


Clive Smith.
--


Post a followup to this message

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