Re: CFO: Why C?

From: Richard Heathfield (dontmail_at_address.co.uk.invalid)
Date: 09/06/03


Date: Sat, 6 Sep 2003 05:28:39 +0000 (UTC)

VBDis wrote:

<snip>

> You forgot to mention the machine, for which C was invented. Intel
> processors typically have an architecture and instruction set which is
> absolutely /not/ appropriate for C code. On the proper C machines the ++
> and -- operators are part of the addressing modes, whereas on x86 machines
> the compiler must add explicit instructions for these operators.

As with most of what you say about C, this is wrong. But this is such a
common myth that I think it deserves a specific debunking.

Dennis Ritchie describes reality thusly: "Thompson went a step further by
inventing the ++ and -- operators, which increment or decrement; their
prefix or postfix position determines whether the alteration occurs before
or after noting the value of the operand. They were not in the earliest
versions of B, but appeared along the way. People often guess that they
were created to use the auto-increment and auto-decrement address modes
provided by the DEC PDP-11 on which C and Unix first became popular. This
is historically impossible, since there was no PDP-11 when B was
developed."

-- 
Richard Heathfield : binary@eton.powernet.co.uk
"Usenet is a strange place." - Dennis M Ritchie, 29 July 1999.
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
K&R answers, C books, etc: http://users.powernet.co.uk/eton


Relevant Pages

  • Re: what uC do you prefer?
    ... the 68332, it has a register-rich, symmetric, very PDP-11 looking ... Then take a look at my web page on the instruction set, ... elegant than an Intel or PIC architecture. ...
    (sci.electronics.basics)
  • Re: what uC do you prefer?
    ... the 68332, it has a register-rich, symmetric, very PDP-11 looking ... <whipes a tear from her eye> ... Then take a look at my web page on the instruction set, ...
    (sci.electronics.basics)
  • Re: What the?
    ... the relative efficiency of these operations; ... based on the PDP-11 ... (BTW: I don't know about PDP-11, ...
    (microsoft.public.vc.mfc)
  • Re: Proposed Assembler Commands
    ... we all wound up with the ... >>worst instruction set and the worst OS the industry could invent. ... > PHI R2 ... The PDP-11 had an elegant, symmetric, beautiful instruction set. ...
    (sci.electronics.design)
  • RE: A whopping 50 percent... ???
    ... < Michael Kraemer ... who cares about the instruction set when everybody uses ... But it does make a difference, speaking as a compiler writer. ... < when Power/PPC came around there wasn't such a large code base for it. ...
    (comp.os.vms)