[Coco] Need some advice

Dave Philipsen dave at davebiz.com
Sun May 22 01:16:31 EDT 2016


Haha!  It's been so long ago I couldn't even remember who it was.  I 
can't even remember the name of the other comm program I compared 
against.  And, obviously, at lower baud rates and for just displaying 
ANSI-encoded text there was probably no perceivable difference between a 
C program and one written purely in assembler.

I would think another undesirable thing about many C compilers would be 
that they use libraries which might be included in the final compilation 
even though some of the code is never used.  That might not be a problem 
in some cases but when you're writing code for an embedded application 
with limited memory you don't want to waste anything.  In the past, I've 
written code for boards that had as little as 2-4K of EPROM space which 
pretty much would limit you to using assembly.

Dave


On 5/21/2016 11:22 PM, Greg wrote:
> If I was one of those persons on Delphi that said something like this, 
> maybe one day I'll get the taste of my foot out of my mouth. :-)
>
> I'm not surprised in the least that hand-craft assembly can be 
> significantly faster than similar C code. The compiler makes it easier 
> to develop code, but the optimizations applied were very limited and 
> somewhat crude in the '80s. C compilers of the day commonly supported 
> embedded assembly code specifically so that portions of the code could 
> be optimized by a human. It should have been common knowledge by 
> everyone that the C compilers of the day would never match human 
> optimized assembly code.
>
> I think the C/C++ compilers today have significantly better 
> optimizers, but I'm not quite willing to bet a nickle that 
> machine-generated C code can always match human-generated assembly. On 
> the other hand, I'm not quite so sure I could create assembly code on 
> a modern processor any more.
>
> On 5/21/2016 11:10:12 PM, "Dave Philipsen" <dave at davebiz.com> wrote:
>
>> When I wrote Supercomm over 25 years ago the primary impetus was to 
>> have an OS9 terminal program that could download via xmodem and 
>> ymodem significantly faster than a popular program that was then 
>> available which was written in C. Certain persons on Delphi and 
>> Compuserve chided me and said that a communications program written 
>> in C would be every bit as fast as one written in assembler.  Back 
>> then time was money.  Many BBSs were long distance calls and we paid 
>> by the minute.  So, I did some tests.  I wrote what eventually became 
>> Supercomm and compared it against the program which was written in 
>> C.  At the time, I realized speed improvements somewhere in the 
>> neighborhood of 10%, as I recall, when downloading files from the 
>> same BBS with the same modem.  I concluded that part of the reason  
>> was more optimized code from writing in assembler as well as 
>> calculating checksum on the fly instead at the end of each received 
>> block.  With the advent of faster processors and better C compilers 
>> I'm sure that the gap between assemblers and C compilers has narrowed.
>>
>> Dave Philipsen
>
>



More information about the Coco mailing list