Path: utzoo!attcan!uunet!crdgw1!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!wuarchive!udel!mmdf From: HBO043%DJUKFA11.BITNET@cunyvm.cuny.edu (Christoph van Wuellen) Newsgroups: comp.os.minix Subject: 68000 and 386 C compiler: doc page Message-ID: <46246@nigel.ee.udel.edu> Date: 1 Mar 91 18:37:59 GMT Sender: mmdf@ee.udel.edu Lines: 181 68000 and i386 C Compiler --- Version III patchlevel 1 (III.1) ========================= .................................. This compiler consists of various modules that build up a front end -- these modules are common to all versions of this compiler -- consisting of parser, analyzer and optimizer, of modules that are specific for the target processor, namely *68k.c (for the 68000) and *386.c (for the i386), and of assembly language output modules that are further dependent on the (syntax of the) target assembler. The specific modules are: gen386.c, reg386.c, peep386.c ============================= Code generator modules for the i386 processor, namely code generator (gen386.c), register allocator (reg386.c), and peephole optimizer (peep386.c) out386_gas.c <<--this file was called out386_sun.c in Version III.0) ============ At this moment, this is the only output module for the i386 compiler. It generates assembler files compatible with the GNU GAS assembler. If compiled with -DSUN_ASM_SYNTAX, the output is compatible with the Sun386i-Assembler. There are very little differences between the Sun and the GAS assembler gen68k.c, reg68k.c, peep68k.c ============================= Code generator (gen68k.c), register allocator (reg68k.c), and peephole optimizer (peep68k.c) for the 68000 compiler. out68k_ack.c ============ Output module for the ACK assembler as supplied with the MINIX operating system. out68k_gas.c ============ Output module for the GAS assembler. out68k_cpm.c ============ Output module for the CP/M-68K assembler. This is the same assembler as supplied with the developement package for the ATARI and thus, this module is also compatible with the ALCYON and SOZOBON assembler. The module contains some other dirty tricks such as a very special translation of external symbols (which helped me to install some software in spite of the fact that external names are truncated to eight characters) etc. It has not been maintained since very long, since I stopped working with CP/M-68K. Compile-time options ==================== There are several symbols you can define at compile time to control the behaviour of the compiler. -DICODE enables the -Qicode option (see below) -DVERBOSE the compiler will generate diagnostics while compiling when compiled with this option. This should be a run-time option. -DMC68000 The compiler will be a 68000 compiler -DINTEL_386 The compiler will be a i386 compiler Although you can compile, say, gen68k.c with -DINTEL_386 (this produces an 'empty' object file), you must only compile one of the alternate output modules. This may be fixed in the future at the expense of additional -Dxxxxx options, e.g. -DACK might only activate code in out68k_ack.c, not in the other 68k output modules. INVOCATION OF THE COMPILER ========================== Normally, you will call this compiler from a driver such as cc. This chapter gives you the necessary information to patch the internal tables of cc as to support this compiler. The compiler is basically called with two arguments, the input-file and the output-file. The input file contains PREPROCESSED C-sources and is normally the output of cpp, the C preprocessor. The output file contains the assembly language file. To compile a source, source.c, to an object file you could type the commands (this example works under MINIX-68K) /usr/lib/cpp source.c > TMPFILE.i /usr/lib/c68 TMPFILE.i TMPFILE.s rm TMPFILE.i /usr/bin/as - -o source.o TMPFILE.s rm TMPFILE.s In fact, c68 together with cpp replaces cem, opt, and cg. c68/c386 may also be given some options. The syntax is: c68