From: "Walter Harley"
Subject: Re: To C or not to C
Date: Fri, 3 Jan 2003 17:39:02 -0800
Organization: Posted via Supernews, http://www.supernews.com
Reply-To: "Walter Harley"
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
"Michael Culley" wrote in message
> First, there is alot of extra assembly code added in that we don't know
> what it does, if this produces a bug it could be hard to track down.
The odds of the C compiler or runtimes producing a bug are rather lower than
the odds of you producing a bug. And compiler-generated assembly code is
generally pretty easy to decipher, especially if you have the C source code
to line it up against.
> it appears to use alot more of the rom. The assembler version is 757 bytes
> and the C version is 1508 bytes. About 350 bytes is text in both
If your software is only 400 bytes of assembly then it probably doesn't much
matter what you write it in. As it grows, you may find your productivity
substantially enhanced by writing in C. Or not. If you want to port to a
different controller, you will *definitely* find your productivity was
enhanced by writing in C.
Note that if you are using an optimizing compiler that knows about your
particular processor, it may be able to do a better job than you can of
optimizing performance. And you may have some control over size versus
The extra memory is "wasted" whether or not there are instructions living in
it. Of course, if your program grows larger, you might hit a boundary where
larger code forces a different chip, which costs money. Conversely, you
might discover that as the program grows, C lets you manage the additional
complexity more efficiently.