home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 1: Amiga
/
FrozenFish-Apr94.iso
/
bbs
/
alib
/
d1xx
/
d193
/
zc.lha
/
Zc
/
zc.readme
< prev
next >
Wrap
Text File
|
1989-03-13
|
4KB
|
112 lines
zc c - compiler
revised by Joe Montgomery dec 1988.
(monty@brahms.berkeley.edu)
This is a modified version of hcc the Sozobon-C compiler by
Johann Ruegg. The documentation released with the compiler
states the following:
* Permission is granted to anyone to use this software for any purpose
* on any computer system, and to redistribute it freely, with the
* following restrictions:
* 1) No charge may be made other than reasonable charges for reproduction.
* 2) Modified versions must be clearly marked as such.
* 3) The authors are not responsible for any harmful consequences
* of using this software, even if they result from defects in it.
I can only add that I can not be held responsible for any
harmful consequences as well.
I hope that this goes a long way toward the goal of having a
freely distributable c compiler for the amiga. I have modified
hcc so that it generates code compatible with a68k. I have
not been able to test this adequately as I do not have the
amiga.lib. However I will get it hopefully within a few weeks
and then begin to do some more checking. It does seem to
to generate assembly language files that a68k does not complain
about. There are some problems however:
One I don't know Motorola 68000 assem or the directives.
A68k did not have much documentation so I guessed about
the use of some. I used XREF for externally defined labels
XDEF for global defines, and DC,DS for data storage. I hope
my usage is correct. Further a68k requires the SECTIONS DATA
and BSS to be named so I used DATA & BSS for those names.
This may be a problem or not. I do know that
hcc doesn't generate a XREF or public direc for functions
or variables which are external to the file. It expects
the assembler to figure this out. a68k does not like this.
I tried to remedy both these problems to some extent.
The code has 0 comments and as I do not have a printer, I
found it difficult to make any major changes, so I caused
the compiler to generate a XREF label for every function
call. Not good, hopefully I can get that working latter.
For the variables, I was able to get it to generate XREF's
for externally defined global variables, however external
variables within a function are not declared to be XREF.
I tried to label most of the changes I made with the
comment
/* JMM ...
The following files were modified:
Revised main.c to use Amiga File System Naming Conventions
Added ?,C,F,E switches.
? help
C force data,bss into Chip memory
F force data,bss into Fast memory
Exxxx use xxxx as errorfile.
writes the number of errors to the
file
Oxxxx use xxxx as the output file
instead of the default file.
Revised out.c to use MOTOROLA assembly directives in order
to be compatible with C.Gibbs a68k assembler & blink
Added END statement
Changed .comm label,size to label DC.x 0
.even to CNOP 2,0
.globl to XDEF
.text to CODE CODE [CHIP | FAST]
.data to DATA DATA [CHIP | FAST]
.bss to BSS BSS
Revised d2.c so that externs are declared as XREF -----
Revised g2.c & gen.c to declare all called functions XREF
(will need to change this to declare only external functions)
I also wrote a front end called zcc that automatically calls
a68k if no errors and then blink.
It is somewhat a unix style front end but I don't know all
the options available.
for zcc and zc, if you type zcc ? or zc ? it will list the
various options.(one exception is that zc doesn't list
-E as an option.)
Again, I hope to correct the above problems as well as adding
more options. One not of caution, zc expects all options
to be upper case. I did not change this as it uses all the
lower case options for debug purposes. Perhaps in the future
I will change this.
Please let me know of any problems, and I will attempt to fix
them.
Thanks, for all the great PD and FD software out there. Hope
you can get some use out of this.
Thanks again,
Joe