User Tools

Site Tools


KCC C Compiler Notes

KCC is a C language compiler for the PDP-10 written by Kok Chen and rewritten by Ken Harrenstien.

KCC can be used to compile C programs to run on under TOPS-20 on TWENEX.ORG. However, the compiler has several shortcomings you should be aware of before planning to use it on a programming or porting project:

  1. K&R C. KCC supports only the “K&R” version of the C language, not the now almost universally supported ANSI C. However, including the header file KRCOMPAT.H allows you to write C source that can be compiled by either a K&R or an ANSI C compiler.
  2. Missing libraries. KCC does not include all of the standard C libraries. (List missing libraries)
  3. Executable bloat. KCC was written with the goal of porting BSD programs to the PDP-10. Therefore, although KCC generates relocatable object files of size comparable to the TOPS-20 native MACRO assembler and FORTRAN compiler, the loader links in a large BSD compatibility layer object module and produces executable files much larger than those of other programming languages. (Are there compiler or loader options that can prevent linking of the BSD compatibility layer module?) One approach to save file space is to delete the (bloated) .EXE file after compilation and linking. The .REL object file can be run using the EXECUTE command which will link, load and run the program. (for example @EXECUTE MYPROG.REL or @EX MYPROG ). This of course involves linking at every execution (but then TWENEX.ORG is much faster than any real PDP-10).
  4. Absent Unix utilities. These exist on the very last Panda distribution of TOPS-20, but they are very large in size (bloated).

Therefore KCC is probably best used on projects porting software from a BSD environment and/or projects where the target executable file is expected to be relatively large.

tutorials/kcc.txt · Last modified: 2014/06/09 06:48 by vulcan