Google
 

Trailing-Edge - PDP-10 Archives - SRI_NIC_PERM_FS_1_19910112 - c/old/nmit/cc-desc.doc
There are no other files named cc-desc.doc in the archive.


	   






	                          NMT V7 C Project

	                         A Short Description







	  Copyright (C) New Mexico Tech 1984, 1985.  All rights reserved.


	  The information in this manual is intended for internal use  only
	  by  New  Mexico  Tech (NMT).  In no way should the information in
	  this manual be construed as a commitment by NMT.  NMT assumes  no
	  responsibility for any errors that may appear in this document.


	  DEC, DECSYSTEM-20, TOPS-20, MACRO-20, RUNOFF, VAX,  and  VMS  are
	  trademarks of Digital Equipment Corporation.  UNIX is a trademark
	  of Bell Labs.


	  This document briefly describes the version 7 C project  underway
	  at  New  Mexico  Tech.  Following paragraphs cover the compiler's
	  basic  operation,  the  language  which  is  supported,  and  the
	  standard library.

	  The compiler takes a command line similar to that taken by  other
	  TOPS-20 native mode compilers, and produces output in the form of
	  TOPS-20 relocatable  modules  (.REL  files).   It  is  relatively
	  intelligent  about  emitting  code  which  makes  good use of the
	  available DEC-20 machine instructions.  Compilation speeds  range
	  from about 10000 to about 50000 lines per minute;  as an example,
	  one of the compiler's own modules, with an average line length of
	  25  characters  and a relatively normal mix of comments and code,
	  compiles at 35000 lines per minute.

	  Both the compiler and the library routines are  written  entirely
	  in  C,  with  the  exception  of five library routines (totalling
	  about 700 lines, a touch more than 1% of the source  code)  which
	  are written in MACRO-20.

	  The C preprocessor  is  available,  with  full  support  for  the
	  #include  (with  ""  and  <>), #line, #define and #undef, #ifdef,
	  #ifndef, #else, and #endif commands.  #If is partially supported;
	  the  expression  may be either a constant, or a constant compared
	  to another constant.

	  The data types currently  supported  include  int  (long,  short,
	  unsigned,  and  normal), float (long and normal), char, pointers,
	  arrays (of arbitrary  number  of  dimensions),  structs,  unions,
	  enumerated  types,  and  typedefs.   We  also  support  structure
	  assignment,  passing  structures  to  functions,  and   returning
	  structures from functions.  In internal storage format, ints (all
	  four kinds), floats (both kinds), chars, and pointers require one
	  machine  word;   character  strings  and  arrays  are packed five
	  seven-bit bytes per word.  Bit fields may be of arbitrary  length
	  (1 to 36 bits), and are implemented as bytes packed into words.

	  The standard library is  relatively  complete.   File  level  i/o
	  (open,  close,  read,  write,  etc.),  stream  level  i/o (fopen,
	  fclose, fscanf,  fprintf,  getc,  putc,  etc.),  dynamic  storage
	  allocation  (malloc, calloc, free, etc.), and a math library (via
	  DEC's FORTRAN library) are all available.

	  We expect that some development will continue to  occur  on  both
	  the compiler and library, but at a much lower level than has been
	  the case thus far.