home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Elysian Archive
/
AmigaElysianArchive.iso
/
prog
/
c
/
pdc.lzh
/
File20
< prev
next >
Wrap
Text File
|
1991-08-04
|
7KB
|
209 lines
PDC - a Publicly Distributable C Compiler
Version 0.92 - 24 July 1988
by Jeff Lydiatt
and Olaf Seibert
COPYRIGHT NOTICE
Matthew Brandt, the original author holds the commercial rights to the
original version. The modification to PDC by both Olaf Seibert and Jeff
Lydiatt are also copyrighted. Permission is given to freely redistribute
the compiler and associated support programs, but not for profit. All
commercial rights are reserved.
SYNOPSIS
A Publicly Redistributable C Compiler system targetted for the Amiga's
operating system. This is an update from the C compiler found on Fred
Fish disk #110. Major enhancements include:
o compiler now implements "typedef", and "unsigned". |Thanks
o initialization of auto variables | Olaf!
o full 32 bit multiply, divide and modulus operations. |
o better register tracking.
o a full fledged macro preprocessor
o a new version of make
o a front end program for automating the compile-assemble-
Blink process.
o a small PD version of Amgia.lib
o limited stdio library support.
THis version is not a full-fledged compiler yet however. Floating point
variables are not supported, nor are bit fields. You will also need to
order the include files that map the Amiga's operatings system from
Commodore if you want to compile any heavy duty programs that need access
to the Amiga's nicer features or it's hardware. A kit is available from
Commodore for $20 - more on this below.
Although this compiler has a long way to go compared to a commercial
system, suprisingly you will find you can successfully compile and run
most public domain software with this version. As such PDC makes a good
choice for the beginner who wants to see what C is about, or even the
expert who does not want to put out the price of a full fledged C
compiler. A number of examples are included to give you a flavour.
SETUP
For a one or two disk system, I suggest you make a stripped down version
of your workbench by removing the system directory and all the demos.
o copy the PDC0.92/c directory contents to the workbench c directory.
o copy the PDC0.92/lib directory contents to your workbench lib dir-
ectory.
o make a directory called "include" in the root directory. Copy
the pdc0.92/include into the new workbench include directory.
o in your startup-sequence in your s directory, add the commands
assign PDC: df0:
stack 20000
path add PDC:c
Another alternative is to simply name the Workbench disk "PDC"
using the relabel command and skip the assign command.
o if you have commodore's include files, you can also copy these
to the workbench include directory. You may want to remove all
the assembler include files first as they won't be needed by pdc.
These files all end with ".i". Don't forget to use the all option -
"copy commodore:include pdc:include all" to retain the directory
structure!
For a hard drive system (lucky guy), I would suggest making a separate
directory called PDC on your hard drive, and simply copy the entire PDC
disk to that directory using the all option. Add the commands:
assign PDC: DHx:PDC
stack 20000
path add PDC:c
to your startup-sequence. Replace DHx: by the device name for your hard
drive of course!
WHAT'S HERE
Here's what's provided in this package. The Docs directory will give
further detail on most of the commands:
CPP
Cpp is a C pre-processor which reads a C source file, expanding macros and
include files, and writing an input file for the PDC compiler. Cpp was
written by Martin Minow. Cpp is believed to be originally released on a
Decus tape.
PDC
An optimizing C compiler that generates motorola 68000 assembler source
from C source code. Matthew Brandt originally wrote the compiler and
released a version that ran on an IBM PC. A large vote of thanks goes to
Matt for the great job he did on the design, and for releasing the code
for non- commercial use. Both Olaf Siebert and myself, Jeff Lydiatt, have
added major extensions to PDC as well as fixed a large number of bugs in
the original code.
A68K
A publicly redistributable assembler that translates assembler source code
to a binary format that a linker can accept. A68k was originally written
in modula 2 by Brian Anderson. A68k was ported to C by Charlie Gibbs, who
also added a large number of extensions, not to mention the bug fixes.
A68k attempts to remain compatible with the metacomco assembler.
BLINK
Blink is a well known and widely distributed publicly redistributable
linker released by "The Software Distillery" boys. This is version 6.7,
the last publicly redistributable version put out. Later versions of the
linker are used by the Lattice compiler.
CC
CC is a front end for the PDC compiler that makes the calls to the cpp
macro preprocessor, PDC, A68k, and Blink much less tedious. With cc, it
is possible to type:
"cc hello.c"
on the command line, and wind up with a runnable program called "hello."
Cc was originally written by Fred Fish, and I added the extensions to make
it work with PDC, and to compile under the Manx compiler.
MAKE
Make is a public domain program posted to usenet net.source. Steve Walton
ported it to the Amiga, and "Manxified" it. Steve claims it's a better
than the Manx-supplied make.
LIBRARIES
Also included is startup code, stdio, string manipulation routines,
and interface stubs to the Amiga's operating system.
PDCStart.obj is the startup code which must be the first module that
Blink sees.
PDC.lib is the stdio support for gets(), printf(), read(),
write() etc, as well as support for the string library functions like
strlen(), strcpy(). The stdio support is written in PDC by me. The
string lib support is written by Henry Spencer at the University of
Toronto.
Ami.lib is a Public Domain abbreviated version of Amiga.lib that I put
together since commodore's Amiga.lib is copyrighted and requires a
licence to release. Ami.lib has the advantage of being about 1/2 the
size of Amiga.lib. Missing however are all the math support stubs,
the stdio code, and the _LVO definitions which aren't needed by PDC.
EXAMPLES
Several examples are provided to show the range of PDC. All examples
are either taken from Fred Fish disks, or are publicly redistributable
examples taken from other sources.
The examples are in two varieties. Those in the StdIO directory can
be run with the provided programs and libraries since they don't need
to interface to the Amiga's underlying hardware or it's operating system
except through the support provided in PDC.lib and Ami.lib.
The examples in the Amiga directory however will require the include
files that describe the layout of important data structures in the
Amiga's operating system. If you already have Lattice C or Aztec C
on the Amiga, you may be able to use the include files from those
compilers. The include files are available from commodore for a nominal
$20 fee. Write to:
Commodore Business Machines
Software Department
1200 Wilson Drive
West Chester, PA 19380
Ask for the "AmigaDos 1.2 Native Developer Upgrade". The kit contains all
the assembler and C include files, the libraries, autodocs, readme files,
alink, and the library offsets. It comes on 3 or 4 disks - well worth the
$20.
...........
Happy C'ing - Jeff Lydiatt