gillies@uiucdcsp.cs.uiuc.edu (01/18/88)
It's true, C is just a hare's breath away from PDP-11 assembly language. It is untrue that C resembles the intel 80x86 architecture. 80x86 compilers have collossal kluges like "small, medium, large, super-large, and huge" memory models! The 80x86 machines don't have the pre/post auto-incr/decr-ment addressing modes either. A decent 80x86 C compiler is a nightmare to write -- and there's seldom room for more than 1 or 2 register variables in CPU. Segmentation and C don't mix well! An amusing fact: I have heard the original PDP-11 C compiler could compile the following C fragment down to one machine instruction. register char *p, *q; while (*p++ = *q++); This is a indexed register move (both post-autoincrement mode) with a test & jump to itself if the value is zero. The Motorolla 68000 chip was designed to resemble a 32-bit PDP-11 (it has most of the same beautiful addressing modes). So was the VAX architecture. C works very well on these machines. C is preferred by many advanced programmers because: 1. C is very efficient. Its macro preprocessor helps and it is STANDARD. C's register variables support efficient code generation. Its pointer arithmetic outshines all other major languages. 2. C's pragmatic syntax contains no bogus religion (like "though shalt not put more than one assignment statement on one line" or "though shalt always BREAK after every case statement-arm"). 3. C always supported separate compilation. 4. C is fairly portable among UNIX boxes. Pascal hasn't a hope of doing file I/O, string functions, math library functions. Many non-UNIX C compilers provide a portability library (thank you, LightspeedC, you saved me dozens of hours last night). Don Gillies {ihnp4!uiucdcs!gillies} U of Illinois {gillies@p.cs.uiuc.edu}