The Cyber-Spy.Com Usenet Archive Feeds Directly
From The Open And Publicly Available Newsgroup
This Group And Thousands Of Others Are Available
On Most IS NNTP News Servers On Port 119.
Cyber-Spy.Com Is NOT Responsible For Any Topic,
Opinions Or Content Posted To This Or Any Other
Newsgroup. This Web Archive Of The Newsgroup And
Posts Are For Informational Purposes Only.
From: "Anthony Q. Bachler"
Subject: Re: To C or not to C
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
Date: Sat, 04 Jan 2003 06:56:12 GMT
NNTP-Posting-Date: Fri, 03 Jan 2003 22:56:12 PST
Organization: EarthLink Inc. -- http://www.EarthLink.net
C or assembler? If you have the resources assembler will almost always
outperform C in code size and speed. C is a mid level language, so its
bloat isnt too bad if you turn on optimizations in the compiler. The C may
actually be compiling for speed. On uP's that use multi-clock instructions,
soemtimes a multiple command sequence can achieve the same function faster
than a single instruction. If space is the major concern, try setting the
compiler to optimize for size, not speed. In any case directly coding in
assembly can always perform at least as well as a compiler and better if you
have a good programmer (and worse if you dont).
"If a million people say a foolish thing, it is still a foolish thing."
Anatole France [Jacques Anatole Thibault] (1844-1924)
"Michael Culley" wrote in message
> Thanks to everyone's help here my small project has progressed well. I now
> had a completed (although very messy) prototype. For those who didn't read
> my previous thread it is using an 8051 and a max232 to connect to a serial
> port. I'm doing this project with a friend and he prefers to use C while I
> prefer to use assembler. We have both written the software and both
> work the same with only minor differences. I can see 2 problems with using
> C. 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.
> 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, so the C
> code is almost 3 times larger than the assembler version. The C version
> had quite a few hours spent on it getting it down to 1500 bytes where the
> assembler version hasn't been optimised. 1500 bytes seams like a huge
> when we only have 2k.
> What does everyone think, which is better C or assembler? We are using
> Michael Culley
Go Back To The Cyber-Spy.Com
Usenet Web Archive Index Of
The sci.electronics.design Newsgroup