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.
Subject: Re: To C or not to C
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
NNTP-Posting-Date: Sat, 04 Jan 2003 11:18:28 EST
Organization: Prodigy Internet http://www.prodigy.com
Date: Sat, 04 Jan 2003 16:18:28 GMT
"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
That's very interesting. I've always heard that assembly language would
produce a shorter more succinct and faster running code than code compiled
from C. Your experience confirms that view at least in your small program.
But, I never figured that the difference would be as geat as you've found, 3
to1 that's amazing and almost scary. I'm writing a MIDI controller that is
several thousand lines long and the program will have to bomb through it at
a very fast rate to keep up with the MIDI commands. It's for a pipe organ.
I'm working in assemby and am glad I didn't even think of doing it in C.
Based on your experience it dosen't look like code compiled from C could run
fast enough to do my job. Thanks for the insight.
Go Back To The Cyber-Spy.Com
Usenet Web Archive Index Of
The sci.electronics.design Newsgroup