[Coco] OS-9 C Compiler
Gene Heskett
gheskett at shentel.net
Fri Oct 20 20:30:47 EDT 2017
On Friday 20 October 2017 19:44:24 Peter Cetinski wrote:
> A few OS-9 C Compiler questions for you.
>
> I’m setting up a CoCo3 for C development and see from the OS-9 C
> Compiler User’s Guide that the OS-9 compiler comes in 2 flavors. cc1
> for Level 1 and cc2 for Level 2. I can only seem to find the Level 1
> compiler package in the archive as I only see cc1 in the cmds
> directory when i examine the dsks. Anyone know where can I find cc2?
>
> I am loading the 2 disks that come in the OS-9 C Compiler package in
> drive 1 and drive 2 in Drivewire. drive 0 has the OS-9 L2 OS disk.
>
> When I try to compile a simple test program using cc1, it fails on the
> line #include <stdio.h> with ERROR #001 *** can’t open*** stdio.h is
> in drive 2’s DEFS directory. How does the compiler know where to look
> for the standard headers/libraries?
>
> Any help or links to help with how to structure and set this up would
> be appreciated. The manual is pretty weak in this regard.
>
> Thanks!
Peter, the general of execution is a multistep process, over seen by your choice of drivers, which are either compiled or even can be a shell
script.
The first step is to run your source thru c.prep, preferably one of the
now several replacements for c.prep, like the one I used (c_prep19) to
build rzsz-3.3.6 all those years ago.
The std issue version runs out of memory when the src code exceeds about
12 or 13 kilobytes, does it silently but the resultant output code at
the far end of the process will usually crash your machine.
The sequence resembles this but you can modify it somewhat:
c.prep <your-src >/workdisk/cprep.out
cc1 </workdisk/cprep.out >/workdisk/cc1.out
cc2 </workdisk/cc1.out >/workdisk/cc2.out
c.opt </workdisk/cc2.out >/workdisk/copt.out
(optional copt2 </workdisk/copt.out >/workdisk/new-scrch)
(optional for coco3 only) cnoy <workdisk/new-scrch >/workdisk/2nd-scrch
rma <whatever_the_above >/workdisk/your_prg_name.asm
c.link /workdisk/your_prg_name.asm >/workdisk/your_prg_name
At that point it should be ready to run.
/workdisk is wherever on your system that you have room for the scratch
files, or if room is tight, you can interpose a delete of a scratch
file once it has been used, in fact thats advisable so you don't have
to manually delete the stuff so you can run it again after fixing a
typu or 2.
Note however that rma has replaced c.asm, and that rlink has replaced
c.link. There may be others that folks will pipe up and remind us they
also exist.
ISTR the original execution sequencer was named cc. We also have a make
utility which if your are good with Makefile's can also be used for that,
I have done it in what today seems like a previous life. 35 years ago I
thought I was going to live forever, but at 83? I've already heard the
warning buzzer with a pulmonary embolism 2 years and some change ago.
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>
More information about the Coco
mailing list