[Coco] C compiler crashes VCC with Nitros9

Gene Heskett gheskett at wdtv.com
Thu Oct 3 12:44:31 EDT 2013


On Thursday 03 October 2013 12:00:07 Walter ZAMBOTTI did opine:

> Microware CC1 (Level 1) (from http://www.nitros9.org/latest/cc.dsk)
> VCC 1.4.2
> Nitros9 3.2.8 (Nitros9.vhd from
> http://www.nitros9.org/nitros9project.zip) (Not sure why the hard disk
> is not 3.2.9)
> 
> I inserted Nitros9.vhd to HD0 & CC.dsk to /d0
> 
> Boots (DOS255) ok and then I copied the CC disk to the hard drive:
> /d0/cmds/* to /dd/cmds
> /d0/defs/* to /dd/defs
> /d0/lib/* to /dd/lib
> /d0/sources/* to /dd/sources
> /d0/sources/sys/* to /dd/sources/sys
> 
> Then I tried compiling one of the provided samples:
> 
> chd /dd/sources
> cc1 line.c
> (VCC instantly crashes)
> 
> Any ideas?
> 
> Wal
> 
>
Cc1 is part of the compiler, stage 1, but the source code needs to be 
massaged and edited by c.prep19b, which pulls in all the #include files so 
that every name used has a referenced link. Without that, it likely will 
blow from a stack overflow.

There are several compiler drivers out there, I preferred cc252 because it 
was basically an editable script so it was easy to plug in the later 
optimization modules developed since the compiler itself was originally 
written.

the compilers 'stages' originally were:
1 c.prep <file.c in to >scratchfile (ditch it its broken for source code 
above about 10 kilobytes.  It runs out of buffer, doesn't complain but 
silently throws away data that will make your program crash when it 
happens.

2. cc1 <scratchfile in to >scracthfile2.out

3. cc2 <scratchfile2.out >scratchfile3.out

4. c.opt <scratchfile3.out >scratchfile4.out

5. c.asm <scratchfile4.out >modulename.r

6. c.link <modulename.r -l c-library to resolve and insert code snippets 
from, can be duplicated more than twice >output-program-name

Because of shortcomings, there are several other helpers that can be 
plugged into the sequence above.
1. ansifront-013, goes in front of c.prep, fixing 99% of the non-ansi-isms 
in code obtained from other sources.
2. cprep19b, get from Willard Goosey's site now, he made some improvements 
to what I did back in the day to another students thesis work.  Shoot the 
original on sight, put it out of your misery because it will be YOUR misery 
if you use it much.

3. For coco3's only, but never officially released, there is a c.comp which 
is cc1 and cc2 more or less merged that can replace cc1 and cc2.

4. Some further improvements in the code can be had by inserting c.opt2 in 
the sequence after c.opt.

5. For coco3's only, there is a CnoY that can be inserted into the sequence 
after the c.opt's that takes Y register references out, subbing a different 
sequence of commands that is 1 or 2 clock cycles faster.

6. c.asm, which had no knowledge of any of the 6309 codes, has been 
replaced with an updated rma that does know about 6309 codes.

7. c.link, likewise has been superceded by r.link, which knows about the 
linking process better.  Because it depends on RMA style outputs, it and 
rma are to be treated as a pair, they don't mix-n-match.

And I've likely forgotten something as its been a while since I built 
anything  with C. The last being "pf", some old code I wrote to prettify 
the output obtainable on the poor printers back in the day.  Bold, 
underlining on a daisy wheel by multiple strikes for instance.

So if I have left anything out folks, please speak right up. 

Cheers, Gene
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)

Superstition, idolatry, and hypocrisy have ample wages, but truth goes
a-begging.
		-- Martin Luther
A pen in the hand of this president is far more
dangerous than 200 million guns in the hands of
         law-abiding citizens.



More information about the Coco mailing list