View unanswered posts | View active topics It is currently May 22nd, 2013, 10:53 am



Reply to topic  [ 13 posts ]  Go to page 1, 2  Next
Tandy CoCo OS-9 "C" Compiler 
Author Message
Certified CoCo Tech
User avatar

Joined: February 6th, 2011, 4:12 pm
Posts: 191
Post Tandy CoCo OS-9 "C" Compiler
Tandy CoCo OS-9 "C" Compiler

After a short discussion with Dean, I am requesting that no posts be made to this thread except by me.

I have created an additional thread "Tandy CoCo OS-9 "C" Compiler Comments" for those persons who wish to ask questions, make suggestions in public that are visible unlike PM's or e-mail's to me about this project. Your posts can be edited, the text replaced with "Message Deleted" and so on unlike the [CoCoList for Color Computer Enthusiasts] messages which are locked once you hit send.

The ultimate home for these web pages and files:

http://www.os9projects.com/C_Compiler/Compiler.html

mailto:a_nani_mouse@mindspring.com or PM me here (Click "Members" on the top line)

---------------------------------------------------------------

As comments are made, I will try and organize the information, the more help, the faster it will become useful.

Please add your own posts with information please to the "Tandy CoCo OS-9 "C" Compiler Comments" thread!

---------------------------------------------------------------

Quote:
The Language Implementation

OS-9 C is implemented almost exactly as described in The C Programming Language by Kernighan and
Ritchie (hereafter referred to as K&R).

Although this version of C follows the specification faithfully, there are some differences. The
differences mostly reflect parts of C that are obsolete or the constraints imposed by memory size
Limitations.

The group has several copies of this book but as of now no copy is on line (Waiting for someone to step up and agree to scan the book, the OCR process can be done by someone else.)

In the file clang.zip on RTSI and included in a disk file attached below is

"C Reference Manual by Dennis M. Ritchie"

which may be helpful until the K&R book becomes available. (There are copyright problems)



Quote:
ANSI "C" Version

A project was started to allow ANSI "C" programs to be compiled and has succeeded to the extent that ~ 80% of ANSI "C" programs can be compiled.

This does not mean that the Tandy CoCo OS-9 "C" Compiler is an ANSI "C" Compiler, it is not.

The compiler itself does not do the necessary checking that was added to the Second Edition of The C Programming Language as defined by the ANSI standard.

See "Appendix C - Summary of Changes" in the Second Edition of The C Programming Language.

It is currently online at the CoCoCoding! Website

https://sites.google.com/a/aaronwolfe.c ... oding/home

K&R's Second Edition is here:

Https://sites.google.com/a/aaronwolfe.c ... ects=0&d=1

The documentation for the Ansifront beta release v0.12 when compared with K&R's Second edition will show the differences.



Quote:
Improvements to "C" Compiler utilities:

These have replaced the original versions


SHF


Last edited by SFischer1 on September 3rd, 2011, 2:38 am, edited 6 times in total.



August 21st, 2011, 5:17 am
Profile
Certified CoCo Tech
User avatar

Joined: February 6th, 2011, 4:12 pm
Posts: 191
Post Tandy CoCo OS-9 "C" Compiler
OS-9 "C" Compiler Parts

Work In progress

Known to be incomplete, perhaps incorrect

--------------------------------------------------------------------------------------

Make (Make_TK.lzh)

Make is a utility to help with large "C" project development.

If your program has been correctly functionally partitioned into perhaps eight source files with three header files, then a lot of time can be saved by using "Make".

For example, if you edit just one of the source files and wish to rebuild the executable, make will determine that only that one source file needs to be recompiled and then linked with the .r files for the other source files to build the executable.

Similarly, if you edit one of the header files, make will determine that only three source files depend on that header file and recompile only those source files before linking with the .r files for the source files that do not need to be recompiled.

This saves a lot of time.

CC (C executive) (cc_2_5_2.lzh)

"cc" is the C compiler executive.

"cc" invokes the appropriate phases of the C compiler in order to compile
C source programs. This version is configured to use the two-pass Level 1
version of the compiler, and to use RMA and RLINK as the last two passes. It
also puts temporary files in the first of /R, /R0, /DD/TMP, whichever it finds
first.

c.prep (C macro preprocessor) cprep19b.lzh

ansifront (ansifront012.lzh)

The ansifront program takes a pre-processed ANSI C program from stdin and writes a
MW C program to stdout. This means you will need to run c.prep on
your files first, then run Ansifront on the pre-processed file.

c.pass1 (Pass One of Two-pass Compiler)

c.pass2 (Pass Two of Two-pass Compiler)

c.opt (Assembly code optimizer)

rma (Assembler)


r63 (Assembler) rma_1_3_patch.lzh (rma_6309_Patch.lzh)???

rlink (Linker)




Quote:
Well, you need the MW C Compiler and the LII development system.



You can grab c.comp from Gene's web site but you didn't hear that from
me! ;-)

commands From RTSI:
ansifront012.lzh*
COpt2_1_1.lzh*
ansifront012.readme*
cc_2_5_2.lzh
rma_1_3_patch.lzh*
Make_TK.lzh*
cb_C_Beautifier.lzh*
cprep19.lzh
rma_6309_Patch.lzh*

defs from RTSI:
C_Defs.lzh*
unixinclude.lzh

libraries from RTSI:
CLib_Krieder_91.lzh*
Cgfx_7_src.lzh*
clibt.ar*
CLib_Krieder_91_doc.lzh*
GUIlib_1_0.lzh*
CStart_TK.lzh*
Solve.lzh*
regexp.lzh
Cgfx_7.lzh*
Termcap_Level2.lzh*
unixlib.lzh
Cgfx_7_doc.lzh*
Window_SaveRestore_fncs.lzh*
varargs.lzh*

My modest contribution:
http://www.sdc/org/~goosey/os9/curses09.lzh

That should bring you up to the Ultimate OS-9 C compiler.

Willard


I have to look at more posts and do a better job of formatting.

SHF


Attachments:
File comment: 09/05/2011 version
CoCo OS-9 Climax C Compiler Parts Documentation - Candidates.zip [506.39 KiB]
Downloaded 128 times


Last edited by SFischer1 on September 7th, 2011, 5:56 pm, edited 16 times in total.

August 21st, 2011, 5:20 am
Profile
Certified CoCo Tech
User avatar

Joined: February 6th, 2011, 4:12 pm
Posts: 191
Post Re: "C" Compiler FAQ and notes
OS-9 "C" Compliler .dsk file


Work In progress

Known to be incomplete, perhaps incorrect


As it is Built, please report errors, additions, corrections, changes to file formats

I am just starting to collect the parts, many are placeholders for the final files, this is just what I have handy, unchecked and parts known not to appear in the final .dsk.



Attached is the Climax "C" Compiler Disk 1 (.dsk) which has the untested compiler parts.

It may be some time for more progress posted here as Disk 2 needs much more research.

Code:
HDirect log taked on 11/09/06 19:02:54          (CMD line control 91/03/05)

"CLIMAX CMDS 09062011" created on: 2011/09/06
Capacity: 1,440 sectors (1-sector clusters)
641 free sectors, largest block 641 sectors
                                                    Last Modified      Size


CMDS                                               11/09/06 19:02       160
    ansifront                                      11/09/06 17:51      9FA9
    c.opt                                          83/09/17 23:27      2E2C
    c.pass1                                        83/09/20 08:34      7B76
    c.pass2                                        83/09/20 08:34      6444
    c_prep                                         11/09/06 18:19      55BE
    cc                                             11/09/06 17:29      297A
    make                                           11/09/06 18:36      3B00
    rlink                                          85/10/29 11:22      3944
    rma                                            86/02/06 17:44      4EAF
SYS                                                11/09/06 19:02        60
    make.default                                   90/06/16 22:37       49F


CC_1.dsk

Part of clang.zip, contained within

"C Compiler .dsk file - ZIP Version.zip"

Which is currently attached to this post, it will be moved TBD.

http://www.tandycoco.com/forum/viewtopic.php?p=529#p529

Came from "ftp://www.rtsi.com/RSDOS/incoming/clang.zip"


Code:
HDirect log taked on 11/08/26 15:25:49          (CMD line control 91/03/05)

"COLOR COMPUTER DISK" created on: 1983/09/20
Capacity: 630 sectors (1-sector clusters)
109 free sectors, largest block 109 sectors
                                                    Last Modified      Size


CMDS                                               11/08/26 15:20       1C0
    cc1                                            83/09/07 08:14      1F52
    c.prep                                         83/09/07 08:14      27AC
    c.pass1                                        83/09/20 08:34      7B76
    c.pass2                                        83/09/20 08:34      6444
    c.opt                                          83/09/17 23:27      2E2C
    c.asm                                          83/09/06 14:28      505F
    c.link                                         83/08/31 11:09      3721
    copy                                           83/04/14 14:24       2DC
    del                                            83/01/14 09:11        A5
    dir                                            83/01/14 09:11       2A2
    echo                                           83/01/14 09:11        22
    list                                           83/01/14 09:11        4F





CC_2.dsk

Part of clang.zip, contained within

"C Compiler .dsk file - ZIP Version.zip"

Which is currently attached to this post, it will be moved TBD.

http://www.tandycoco.com/forum/viewtopic.php?p=529#p529

Came from "ftp://www.rtsi.com/RSDOS/incoming/clang.zip"


Code:
HDirect log taked on 11/08/26 15:24:42          (CMD line control 91/03/05)

"COLOR COMPUTER DISK" created on: 1983/09/20
Capacity: 630 sectors (1-sector clusters)
199 free sectors, largest block 199 sectors
                                                    Last Modified      Size


LIB                                                11/08/26 15:24        80
    clib.l                                         00/00/00 02:19      5C5B
    cstart.r                                       00/00/00 02:21       284
DEFS                                               11/08/26 15:24       1C0
    ctype.h                                        83/06/09 16:16       386
    direct.h                                       83/05/17 16:39       2D1
    errno.h                                        83/05/17 16:40       AEE
    modes.h                                        83/05/17 16:40       247
    module.h                                       83/05/17 16:40       B09
    os9.h                                          83/05/13 13:57      1865
    os9defs.a                                      83/06/23 08:51      185F
    setjmp.h                                       83/05/17 16:40        18
    sgstat.h                                       83/05/17 16:40       A4D
    signal.h                                       83/05/17 16:41       13D
    stdio.h                                        83/07/06 16:19       4A3
    time.h                                         83/07/11 07:54       177
SOURCES                                            11/08/26 15:24        E0
    SYS                                            11/08/26 15:24       300
        abort.a                                    83/04/24 16:44       257
        access.a                                   83/09/07 14:10       49A
        cfinish.a                                  83/05/16 17:44       157
        change.a                                   83/06/23 08:52       6F0
        comp.sys                                   83/09/06 13:00        D4
        cstart.a                                   83/07/18 12:19      1832
        dir.a                                      83/04/24 18:17        F4
        id.a                                       83/06/28 14:00       2EB
        intercept.a                                83/04/29 12:37       42E
        io.a                                       83/08/26 09:33       71F
        make.sys                                   83/06/28 12:08        F9
        mem.a                                      83/08/02 14:03       5E3
        misc.a                                     83/04/24 18:12       291
        mod.a                                      83/06/27 15:16       37E
        process.a                                  83/07/14 11:12       715
        profdummy.a                                83/05/16 17:39        4D
        signal.a                                   83/08/22 11:17       EC6
        stat.a                                     83/07/22 12:32       42E
        syscall.a                                  83/06/23 08:46       487
        syscommon.a                                83/04/24 18:35        CA
        tidyup.a                                   83/04/20 14:42        32
        time.a                                     83/04/24 18:28        EC
    line.c                                         83/05/23 15:53       182
    prof.c                                         83/07/13 09:43       697
    rdump.c                                        83/05/18 11:56      19E7


It will take some time to find the correct ones and build a real .DSK file.

SHF


Attachments:
File comment: 9/06/2011
CoCo OS-9 Climax C Compiler - Disk 1 Candidates 09062011.zip [104.88 KiB]
Downloaded 126 times
File comment: 9/2/2011
CoCo OS-9 Climax C Compiler .dsk file - Candidates.zip [888.74 KiB]
Downloaded 140 times


Last edited by SFischer1 on September 6th, 2011, 10:53 pm, edited 5 times in total.

August 21st, 2011, 5:22 am
Profile
Certified CoCo Tech
User avatar

Joined: February 6th, 2011, 4:12 pm
Posts: 191
Post Tandy CoCo OS-9 "C" Compiler
Tandy CoCo OS-9 "C" Compiler


Most recent 'C' Compiler modules., Libraries, DOC, etc.?

Unedited - To be totally reworked!

---------------------------
>From Dev Sys:
lib/sys.l
lib/cgfx.l
defs/wind.h
defs/stdmenu.h
defs/mouse.h
defs/buffs.h
cmds/rma
cmds/rlink
cmds/rdump
cmds/make

>From original C compiler
cmds/cc1
c.prep
c.pass1
c.pass2
c.opt
c.asm
c.link
defs/
ctype.h
direct.h
errno.h
modes.h
module.h
os9.h
os9defs.h
setjmp.h
sgstat.h
signal.h
stdio.h
time.h
lib/
clib.l
cstart.r
sources/
line.c
prof.c
rdump.c
sources/sys
syslib.l obsoleted by Krieder clib?

cc252.lzh replaces cc1

c.comp LII compiler same as c.pass1 and c.pass2, with no
intermediate file. Faster

cprep19a.lzh c_prep. replaces c.prep

solve.lzh solve.r arithmatic parser/solver for C code
expects to be linked agains Krieder Clib

cstart.lzh replacement lib/cstart.r

clib_krieder_91.lzh Krieders newest clib
lib/clib.l Y2K issue in ctime()
clibt.l

c_defs.lzh header files for Krieders lib
These files don't end with newlines! MUST edit and add terminating
newlines.
replaces:
ctype.h
direct.h
errno.h
modes.h
module.h
os9.h
setjmp.h
sgstat.h
signal.h
stdio.h should have a prototype for FILE *fopen()
time.h

ansifront012.lzh
adds cmds/ansifront

cgfx7.ar has a horrible bug in getenv()
replaces lib/cgfx.l
defs/wind.h
defs/stdmenu.h
defs/mouse.h
defs/buffs.h
cocoskel.lzh prototype MultiVue app
src/cocoskel/mymenu.h
/skel.c
/skel.make

unixinclude.lzh
replaces defs/stdlib.h change the proto of atof to return double
adds defs/limits.h
defs/sys/cdef.h
defs/sys/types.h


cdefs.ar older Krieder headers, has files newer version doesn't have

termcap_level2.lzh
lib/termcap.l
defs/ttydefs.h
why, no it doesn't have a termcap.h, why do you ask?

varargs.lzh
lib/varargs.l
defs/varargs.h

guilib.lzh
lib/gui.l
defs/gui.h

copt2_12.lzh
cmds/copt2
cmds/rmxlab
sys/patterns.dat

regexp.lzh
lib/regexp.l
defs/regexp.h
defs/regmagic.h

defs/bdraw.h not sure where I got this
defs/graphi.h not sure where I got this
These are both cgfx replacements

defs/mathlib.h original MW math lib?
lib/mathlib.l
defs/graphics.h header for graflib
lib/graflib.l LI VDG graphics lib
These were merged with clib.l on a weird disk

lb_C_Lib_splitter.lzh
cmds/lb

cntx_5.lzh sort of a mini-LINT. Very useful Gene's site
cmds/cntx

triglib high-precision math lib. Gene's site

curses010.lzh experimental, has bugs, my site
lib/curses.l
defs/termcap.h can get this elsewhere, but this one matches
defs/curses.h

unixlib.lzh or unixlib.ar requires a setnuid() function
lib/unix.l

SHF80.zip SHF's site
lib/debug.l
lib/getargs.l
lib/cos9.l
lib/fcgfx.l
defs/debug.h
defs/cos9.h
defs/getargs.h

alib.lzh or alib.ar
lib/alib.l AWESOME lib for assembly programming with rma
No /dd/lib is complete without it!

make_tk.lzh This is the make to use. It's that simple.

rma_1_3.lzh patches rma into r63

abandoned/unusable no docs, headers, or source
dbg.l, mylib.l

-------------------------------


Last edited by SFischer1 on September 6th, 2011, 11:06 pm, edited 3 times in total.



August 21st, 2011, 5:24 am
Profile
Certified CoCo Tech
User avatar

Joined: February 6th, 2011, 4:12 pm
Posts: 191
Post Tandy CoCo OS-9 "C" Compiler
Tandy CoCo OS-9 "C" Compiler - History & Old Notes

1) ANSIFront also works around a number of nasty bugs in the compiler,
such as the struct-element-name issue.


2) The original "c.prep" substitution in strings.

The spec says NO replace but I found this in the
source of one of my programs.
------------------------------------------
#define EDITION 2 > 88/02/17

#define ARCHID fputs(" ARCHIVE ED= EDITION \n", stdout);
/* note bug in compiler allows EDITION to be substituted, spec says no
substitutions within quoted strings */

3) The patch to RMA used to produce R63 was the second one found on RTSI.

rma_6309_Patch 1/25/1993 was NOT used

rma_1_3_patch 10/25/1993


Last edited by SFischer1 on September 6th, 2011, 11:07 pm, edited 5 times in total.



August 21st, 2011, 5:27 am
Profile
Certified CoCo Tech
User avatar

Joined: February 6th, 2011, 4:12 pm
Posts: 191
Post Re: "C" Compiler FAQ and notes
Tandy CoCo OS-9 "C" Compiler FAQ

1) How can I tell which version I have?

There's only one version from Tandy.

It was released for OS-9 Level-I and no changes were made for OS-9 Level-II.

2) do the latest patched versions etc that are out there still have it hardcoded to require certain libraries or include files to be on /DD in order to work?

The original Compiler was not hard coded for "/DD" as released from Tandy. Patches were made to change this.

What You Should Know Ahout Your C Compiler
Originally in RAINBOW October 1989 Page 82

ftp://www.rtsi.com/RSDOS/incoming/What% ... mpiler.txt

EZGEN is located at:
ftp://www.rtsi.com/OS9/OS9_6X09/ezgen.lzh[/color]

As part of this work in progress, standard locations for how the compiler is to be used including where library and include files are to be placed will be defined.

While configurations different from using an emulator with a VHD (Virtual Hard Disk) and two (2) Megs of memory will be under discussion, that will be the initial target.

3) I've noted that cc252 calls c.pass1 and c.pass2. Is there any real difference between this and c.comp? How do I switch them?

As far as the code produced, there is no difference. Using c.comp will cause a slight speedup but not worth the effort. Using c.pass1 and c.pass2 loaded into memory and the work files on a ram disk on a 2 Meg system (Real CoCo or Emulator) or piped on a 512K system will show little slowdown.


Last edited by SFischer1 on October 28th, 2012, 7:47 pm, edited 3 times in total.



August 21st, 2011, 5:28 am
Profile
Certified CoCo Tech
User avatar

Joined: February 6th, 2011, 4:12 pm
Posts: 191
Post Re: Tandy CoCo OS-9 "C" Compiler
Tandy CoCo OS-9 "C" Compiler Documentation

1) C Compiler User's Guide

http://sourceforge.net/apps/mediawiki/n ... %27s_Guide

Question, do we want to convert this to PDF so it can be included in the C Compiler documentation disk?

2) C Reference Manual (The C Programming Language.pdf)

Dennis M. Ritchie
Bell Telephone Laboratories
Murray Hill, New Jersey 07974

This may NOT be the K&R Book!

Part of clang.zip, contained within

"C Compiler .dsk file - ZIP Version.zip"

Which is currently attached to this post, it will be moved TBD.

http://www.tandycoco.com/forum/viewtopic.php?p=529#p529

Came from "ftp://www.rtsi.com/RSDOS/incoming/clang.zip"


Last edited by SFischer1 on August 26th, 2011, 5:05 pm, edited 2 times in total.



August 21st, 2011, 7:43 pm
Profile
Certified CoCo Tech
User avatar

Joined: February 6th, 2011, 4:12 pm
Posts: 191
Post Re: Tandy CoCo OS-9 "C" Compiler
Compiler Source Code Available (We have ALL Parts!)


Last edited by SFischer1 on August 21st, 2011, 8:26 pm, edited 1 time in total.



August 21st, 2011, 8:01 pm
Profile
Certified CoCo Tech
User avatar

Joined: February 6th, 2011, 4:12 pm
Posts: 191
Post Re: Tandy CoCo OS-9 "C" Compiler
Links to other Sites, Bug lists and help.

There is a list of "C" Compiler bugs here:

ftp://www.rtsi.com/OS9/OS9_6X09/PROG/MWC_Bugs.lzh

------------------------------


Last edited by SFischer1 on October 28th, 2012, 7:48 pm, edited 3 times in total.



August 21st, 2011, 8:04 pm
Profile
Certified CoCo Tech
User avatar

Joined: February 6th, 2011, 4:12 pm
Posts: 191
Post Re: Tandy CoCo OS-9 "C" Compiler
Suggested Configeration and Usage (Including Make and Shell Scripts)


Last edited by SFischer1 on August 21st, 2011, 8:45 pm, edited 1 time in total.



August 21st, 2011, 8:10 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 13 posts ]  Go to page 1, 2  Next

Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.