[Coco] Expert C programmer wanted

KnudsenMJ at aol.com KnudsenMJ at aol.com
Mon Feb 7 15:28:55 EST 2005


In a message dated 2/7/05 2:44:46 AM Eastern Standard Time,  jhoger at pobox.com 
writes:

I suppose it would be possible to run Microware C in an emulator  and
suck the RMA code output of there. Not ideal, but that's the hack  job
approach. Just make MESS+NitrOS-9 command line scriptable, and  you've
got a command line C compiler. You avoid writing a compiler, and  you
make MESS scriptable which would be a nice reusable feature for  other
projects.

There's nothing wrong with the Microware C compiler, except that (1) it  has 
a couple of known bugs, (2) it doesn't do ANSI prototypes or bitfields, and  
(3) it doesn't exploit 6309 extensions in its assembly output.
 
(1) is no big deal -- we have listed the bugs, work around them (but  COULD 
be a big deal when importing big sources -- someone has to check by  eye.)
 
(2) is a non-issue to those of us who cut our teeth on Original K&R  C, and 
there's the AnsiFront preprocessor to import sources with the ANSI  extensions. 
 However, I doubt that AnsiFront does any of the type checking  that a full 
ANSI C compiler and linker give you (yes, it's saved my bacon a  couple of 
times).
 
(3) Nitros9 6309 users would like to have more efficient code generated  for 
their CPU.  Maybe some very fancy C.Opt2 patterns can do this at the  back 
end, working on the assembler output?
 
(4) I liked, there is a 4th problem -- the lack of "unsigned char", which  
bites me even when I'm writing for the Coco!  Let alone importing source,  ouch! 
 Requires a LOT of hand-eye checking.   That's one  shortcoming of old K&R 
that has you writing (ch & 255) for almost every  appearance of the "unsigned 
char" variable "ch".

Alternatively you could just go to Forth, a high language for which  the
6809 is particularly suited. You can't do better than a  one-instruction
NEXT



I was once interested in FORTH, and the 6809 actually seems to be designed  
to run FORTH!  But this language is very weird, oriented towards small  
projects, and expecting someone to learn it at this stage as a means to write  Coco 
programs is just too much.
 
Better idea is just to write assembler, with a good macro processor and  
stylistic guidelines and function-calling standards to keep the code from  turning 
into spaghetti tangles.  Seriously, I wrote a bunch of PDP-11  assembly (the 
6809 is in many ways a simplified PDP-11) with such great ease and  fluidity 
that a year later, when I was listing all the machines that I'd coded  assembly 
for, I forgot about the PDP-11.  It was THAT easy to write  for.
 
My two cents -- Mike K.
 



More information about the Coco mailing list