[Coco] Which version of C?

Gene Heskett gheskett at wdtv.com
Mon Jan 12 04:16:44 EST 2015


On Sunday, January 11, 2015 11:32:37 PM K. Pruitt did opine
And Gene did reply:
> There seems to be a couple of different versions of C floating around
> out there.  On a coco 3 with a 6809 running NitrOS9 level 2, which
> version of C should I be running?
> 
> I remember not really caring for the first C that Tandy had for OS9. 
> And that was my first exposure to C so it kind of soured me on C for
> a long time. I used Turbo C from Borland for a bit. That was pretty
> fun. And I meddled with GCC a bit and it wasn't too disastrous. So I
> am thinking maybe I'll give C on the Coco another shot.
> 
> Thanks.

That Tandy C compiler, written my Microware, has a generally good code 
generator, but some of the support functions were broken. We now have a 
much better c.prep I had a hand in, and Willard Goosey has since improved 
even more, and that c.prep v19b should be considered as a total 
replacement for the tandy supplied version.  Several others have supplied 
additional translators and code optimizers.  If you want to feed it 
normal ansi C, with void's and such, then you will run the output of 
c.prep thru ansifront.13, which translates the voids to something the 
compiler in c.comp or the chained c.pass1 and c.pass2 can understand.  
Then we've an improved c.opt2, and your choice of driving scripts, there 
are several for sequencing the whole maryann.  

But the best optimizer is the human brain. By interrupting the compiler 
and inspecting the assembly code as it would be sent to c.asm (or rma 
today) and spend some time looking for bit shift loops that shift by 8 
one way or the other, nuke that code and sub a tfr, clear statement pair 
in its place. That is one of the tricks that took rzsz from just barely 
keeping up with a 2400 baud modem, aka 240 bytes a second to nearly 720 
bytes a second running on a 6309. That, and changing to a table lookup 
crc which is much faster than calculating it.

Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page <http://geneslinuxbox.net:6309/gene>
US V Castleman, SCOTUS, Mar 2014 is grounds for Impeaching SCOTUS


More information about the Coco mailing list