A Survey Of CUG C Compilers Victor R.
Volkman received a BS in computer science from Michigan Technological University in 1986. Mr. Volkman is a frequent contributor to The C Users Journal and the C Gazette. He is currently employed as Software Engineer at Cimage Corporation of Ann Arbor, MI. He can oakley restless be reached at the HAL 9000 BBS, (313) 663 4173, 1200/2400/9600 baud. Compiler construction is alternately the most rewarding and most frustrating area of software development. The C Users' Group offers public domain C compilers with source code for both those who study and those who use compilers. These packages have been independently developed by programmers who were often the first to implement the C language on their target machines. Some of these compilers share the ability to compile their own source to build new versions of themselves. A Small History Of The Small C Compiler Since Ron Cain's introduction of the Small C compiler into the public domain nearly a decade ago, its implementations have spread okay sunglasses like wildfire to nearly every popular microprocesor. The C User's Group is fortunate to be able to offer public domain compilers which have been ported to the Z 80, 8080, 6800, 6809, 8086, and 68000 (see Figure 1) In 1982, James E. Hendrix assumed trusteeship of Small C. Hendrix published numerous upgrades through Dr. Dobb's Journal culminating in the release of Small C v2.1 for CP/M in 1984. New features added along the way include code optimization, data initializing, conditional compiling, extern storage, for, while, switch/case, and goto statements, and a plethora of operators. To complete the system, James E. Hendrix and Ernest Payne developed a CP/M compatible version of the UNIX C standard I/O library. The internal design of Small C v2.1 was the subject of Hendrix's The Small C Handbook. The first published 8086 PC DOS implementation of Small C v2.1 appeared in 1985. Along the way, code optimization techniques were refined even more. The present incarnation from Hendrix, Small C v2.2, is available for 8086 PC DOS only. Small C v2.2 was released simultaneously with Hendrix's definitive reference work A Small C Compiler: Language, Usage, Theory, and Design in 1988. CUG C Compilers Based On Small C Many of the C compilers available from CUG are based on some derivative of the Cain or Hendrix implementation of Small C. The exceptions to this rule are the 68000 C Compiler (disk 204) which has no lineage with Small C and the DECUS C Preprocessor (disk 243) which is not a full compiler. Some of the CUG C compilers based on Cain's Small C v1.1, include many of the enhancements published in Dr. Dobb's Journal over the years. This puts them approximately at the level of Hendrix Small C v2.0 discussed earlier. These enhanced Small C compilers are available as disk CUG104 Z 80/8080 (CP/M 80), CUG163 8086 (PC DOS), and CUG221 6809 (FLEX OS). An attribute which most of the CUG C compilers share is a noticeable lack of external documentation. All disks have less than a dozen pages of documentation with the exception of Small C w/Floats (CUG156) which includes 30 pages. Fortunately, their common heritage means their implementations remain similar to the well documented Cain and Hendrix designs. Specifically, the Doctor Dobb's Journal issues from 1980 to 1982 (see bibliography) are the best source for Small C versions before 2.0. Alternately, Hendrix's Small C Handbook (now out of print) details these early versions. You might need to check your local university library for these publications. Unfortunately, Hendrix latest book A Small C Compiler will be less relevant to older versions due to recent internal code redesigns. The CUG C compilers based on Small C, regardless of version, also share certain limitations of language features. In particular, struct, union, long, float, and double data types are not supported. The exception to this rule is of course Small C w/Floats (CUG156) which includes a 48 bit non standard float. Additionally, arrays are limited to one dimension and pointer arrays are specifically prohibited. These compilers also assume that ints and pointers are equivalent. This means the size of code and data pointers must also be the same. Also, the full set of C operators is often not present. In general, the run time libraries contain a good assortment of standard I/O, string, and keyboard polling functions. Higher level functions such as sprintf() are not always present. The libraries have very primitive linear memory allocation with alloc() and free(). Blocks of allocated memory must be freed in reverse order of allocation. The overall ratings were based on my perception of the mens oakley glasses documentation, completeness, and usability of the implementation. CUG104: Small C For Z 80/8080 (CP/M 80) This implementation of Small C for the Z 80/8080 was done by Mike Bernson of Ann Arbor, MI. This Small C is not self compiling and requires a special assembler and linker which are included only in CP/M 80 executable form. The compiler was developed with BDS C v1.41. Mike Bernson has made several improvements to RC Small C v1.1 including most of the features of JH Small C v2.1 except goto/label and the ternary operator. The Standard C I/O library is included in both assembly language and object code format. Only three pages of documentation are provided, consisting of two pages of grammar and a one page listing of file contents. Griggs. This version is close to RC Small C v1.0 since it lacks switch/case, for, and goto/label statements among other things. This Small C is not self compiling and requires BDS C v1.41 or later to compile. This package requires a 6809 assembler and linker which are not included. Small C for 6809 is designed as a cross compiler which produces 6809 code while running under a 8080/Z 80 environment. After compilation, you would use the supplied serial port driver to download the object code in Motorola S HEX format to the target 6809 machine. This C compiler cannot be self compiled because it has hardware dependencies on the byte order of 16 bit words. Specifically, the 6809 has the low and high bytes stored in the reverse order of 8080 machines. The compiler assumes a certain order in some cases and thus cannot compile itself. This disk includes a serial driver, graphics library, and sample graphics game. The graphics library supports real time animation in the player missle arcade style. Graphics objects are managed in a list which stores their screen position and x/y velocity. During animation, the routines automatically flag collision of objects on the screen. The management of graphic objects is similar to the use of sprites on Commodore C64 and C128 machines. Also on this diskette are a total of eight pages of documentation, six on the 6809 port and two on use of the graphics library. CUG146: Small C For 6800 (FLEX OS) This implementation of Small C for 6800 (FLEX OS) was completed by Serge Stepanoff of Livermore, CA. This version is close to RC Small C v1.0 since it lacks switch/case, for, and goto/label statements among other things. An additional restriction is that identifiers are limited to six significant characters. This Small C is not self compiling and requires BDS C v1.41 or later to compile. This package does not include a complete Standard C I/O library. A nonstandard printf() is used which requires that the number of arguments be passed as the last parameter. Small C for 6800 (FLEX OS) does not compile to assembly or machine language, but rather to a pseudo code. A small pseudo code interpreter, less than 2K, actually executes the user's pseudocode. To run this pseudo code in a different environment requires only the rewrite of the interpreter and the runtime library for the target machine.
However, the source code for the interpreter is not included on the distribution diskette. The diskette contains 11 pages of documentation, the first five pages are devoted to how to use the compiler and the remainder oakey sunglasses to the run time library.
Prev: oakley glasses cheap
Next: tenis oakley