??? 07/19/09 03:01 Read: times |
#167539 - Not so fast ... Responding to: ???'s previous message |
Andy Peters said:
As for the size, the problem is that, once one is using 'C', the tendency is to use its libraries and other conveniences without regard for impact on the size of the work product. If you were an actual C programmer, you would know that most of the standard library functions are not only quite useful, they are also optimized by the compiler vendor for the platform. Consider: you need to compare two strings. Would you rather roll your own function, or use the pre-existing strcmp() from string.h? Most of the functions in the C standard library fall into this category. Comparing two strings isn't a big deal in ASM. So you figure strcmp, or whatever it's called, creates less binary? IIRC, string comparison takes fewer than a dozen lines of ASM, including the setup. The Keil manual is pretty good about explaining the cost of using functions like printf() and the dangers of using malloc() and free(). The intelligent engineer knows to simply avoid these functions.
Now the competent embedded developers (not the minority who post "gimme code" requests on this and other forums) are smart enough to realize that embedded systems have limited memory, and as such they write code and use libraries carefully. Basically, you seem to think that all embedded developers who use C are idiots. I respectfully disagree. -a It all comes down to this ... If you know how to do it right in ASM, you know how to do it right. If not, well, all bets are off. RE |