Newsgroups: alt.comp.hardware.homebuilt,sci.electronics,aus.electronics
Path: news.nic.utwente.nl!news.nic.surfnet.nl!howland.reston.ans.net!swrinde!tank.news.pipex.net!pipex!news.mathworks.com!news.kei.com!simtel!harbinger.cc.monash.edu.au!news.rmit.EDU.AU!news.unimelb.EDU.AU!wehi.edu.au!woozle.mel.dbe.CSIRO.AU!mel.dit.csiro.au!actcsiro!news.nsw.CSIRO.AU!seurat.syd.dit.csiro.au!not-for-mail
From: ken@syd.dit.CSIRO.AU (Ken Yap)
Subject: ANNOUNCE: Small C development system for Z80 available
X-Nntp-Posting-Host: seurat.syd.dit.csiro.au
Message-ID: <47jg06INNerm@seurat.syd.dit.csiro.au>
X-Face:  bak'McMAD{%JrA$mQ(j_Ex_o?a/F8/Nt<W\sbPkh?,)PF7TK1{Lh"HJLuQfhE}(Dj!g:c(U  =wh/r[<MJUF}hXzR*URO0e/Lh'mn_YUpU+;ycf6:0>ng*t2KX(NcfGalVs^Ke^C61:F
Sender: ken@syd.dit.csiro.au (Ken Yap)
Reply-To: ken@syd.dit.csiro.au (Ken Yap)
Organization: CSIRO Division of Information Technology
Date: Sun, 5 Nov 1995 23:05:42 GMT
Lines: 97
Xref: news.nic.utwente.nl alt.comp.hardware.homebuilt:10895 sci.electronics:82191 aus.electronics:162

I've put together a few free software packages and come up with a Small
C development system for Z80 CPUs. It comprises

        Small C compiler derived from Ron Cain's original from DDJ
        Martin Minow's Decus C preprocessor from Usenet archives
        Assembler and relocating linker from CUG29 from SimTel

Before you get too excited, Small C is a subset of C. Its limitations
are documented. So don't expect your structs and double indirection
pointer C programs to work. :-) Also there are hardly any runtime
libraries. But you get more than what you pay for it (free). I'm
putting it out so that people can give me some feedback and maybe if
they find it useful, contribute improvements (hint, hint).

The ftp URL is

        ftp://ftp.syd.dit.csiro.au/pub/ken/zcc094.zip

It will compile under gcc on Unix (Linux) or Turbo C on DOS. There are
DOS binaries bundled in the zip file.

Here's the README. That's about as much documentation there is on the
system (documentation, what documentation?), although there are some
pages on the components.

zcc 0.94

Here is a free Z80 development package for Unix or DOS consisting of a
C compiler, an assembler and a relocating linker.

scc     Ron Cain's Small C compiler originaly from Dr. Dobbs Journal.
        Has been through many hands and Chris Lewis had it last, many
        years ago.  I fixed it a bit. In particular I made it ignore
        #line directives, needed for the pp bit. I also added the asm
        pseudofunction which passes a quoted string directly to the
        assembler. Note that asm doesn't append any newlines; you must
        do this yourself. This is so that assembly code can be pieced
        together in macros. See test/hello.c for an example.  C string
        escapes work here. Small C is a rather limited subset of K&R C.
        In particular, only char and int types; single dimension arrays
        and pointers but not together.  No initialised data. The source
        of the compiler is a good example of its limitations since it
        was meant to self-compile. There are a handful of library
        functions in ./lib.

pp      Public domain C preprocessor by Martin Minow, posted to Usenet
        many years ago. (Usenet is the news system that was used before
        this Internet Web stuff.) It's much more capable than the one
        built into scc. Does some ANSI C preprocessing stuff too.

as      A PD assembler from the C Users Group collection, which I found
        on a SimTel mirror as crossasm/cug292wk.zip. I cleaned it up
        (only the Z80 and the 8080/5 versions). I merged in some changes
        from the gcc 6811 cross-compiler developers to increase the
        number of significant characters in identifiers and filenames
        (also in the linker below). I also added one switch: -c for case
        insensitivity (used to be a compile time option).  The 8085
        version is here because I need it to compile 0crt.asm which is
        still in 8080 code (too lazy to convert to Z80 syntax). Note
        that the syntax resembles PDP-11 assembler most and not the
        traditional 8080 or Z80 syntax. In particular, the pseudo-ops
        are different, immediate ops require #, offset syntax is
        offset(register), not (register+offset), and others.

link    A relocating linker from the same package above. I also cleaned
        this up, added the -c case insensitivity switch and added changes
        from the gcc 6811 cross-compiler developers to get all arguments
        from the command line. It doesn't handle libraries though.

zcc     I wrote this driver to coordinate the various phases. You can
        call it with .c, .asm, or .rel files. -v shows what it's doing.
        -c stops after assembly. -I, -D and -U arguments go to cpp, -b
        and -g to the linker. It assumes the executables for the phases
        are on your path and that 0crt.rel (C startup and runtime
        routines) is in the current directory.

test    The runtime library and a couple of test programs for a
        development board I use.

doc     Documentation, a bit for scc, but mostly for the assembler and
        linker. There is documentation for the preprocessor in its own
        directory.

The Makefile in the top directory will make everything except the
test.  It should work on both Unix and Borland C by editing the
definitions. Also edit submake.bat for Borland C.

Disclaimer 1: All this is provided as is with no warranty and no
support.  I hope it works for you, but you may have to hack something
for your local setup. You could email me, but I promise nothing.

Disclaimer 2: This has nothing to do with my employment, despite the
email address. It's just for my hobby.

        Ken Yap
        ken@syd.dit.csiro.au
        November 1995

