Subject: Re: Infocom on PDP-11
From: Paul Koning <pkoning at equallogic.com>
Date: Sun, 08 May 2005 19:10:08 -0400
To: cctalk at
classiccmp.org
Cc:
woodelf> The lack of local variables makes C very
dificult.
Huh?
That is really just convention. I can't see why it's relevent.
You're confusing the lack of a hardware stack with
the lack of local
variables. They are not at all related.
Correct. But a stack makes some forms of programming easier.
The IBM 360/370 series doesn't have a stack, and
some of its
restrictions are vaguely PDP-8 like. Nevertheless, GCC supports C
(and C++) quite nicely on those machines.
IBM360 like a PDP-8???? Explain please.
For that matter, Algol had local variables long before
C was invented,
and as you pointed out, there's an Algol for the PDP-8. (Then again,
that's not a true compiler -- it compiles to an intermediate form that
looks very much like a subset of the Burroughs 5500 instruction set.)
Using an IL was a way of making the complier easier I'd guess.
Compiler deign has become more sophisticated since.
And Unix originally appeared on the PDP-7, which you
can describe
quite reasonably as an 18-bit superset of the PDP-8. (That's
historically nonsense, but as a description it fits.)
In many ways it's pretty close. PDP-8 and PDP-7 had more
similar than different. Same for The PDP-1 and 5 that preceded both.
The PDP6 and 11 were departures as was VAX. The departures were
PDP-6,11 and VAX are very CISC in the vax case, to the extreme.
Did C exist
back then, or did that wait until Unix was ported to the PDP-11? I
don't know.
NO, PDP-11 was the first occurance for C. After that it was
ported to Honeywell6000 and the Interdata 8/32 and even the
IBM System/370. The native language for unix on PDP-7 was
B and it's influence was from BCPL. The introduction of PDP-11
was early in the life of the machine to Bell Labs and K&R were
quick to take the bare iron and endevor to put all their previous
work on the -11 to make it useful.
A lot of the register,
local variable and addressing conventions directly reflect the
PDP-11 hardware, instruction set and native addressing modes
under C.
Finally, CDC 6000s don't have a stack either, but
the first Pascal
compiler ran on that machine. Implementing a stack on a non-stack
machine (or non-stack language like Fortran-II) is a nice elementary
Exercise for the Student.
Be very careful what you call a stack or not. The PDP-8 (Straight 8)
has no hardware stack but, it has autoindex registers that are very handy
for stack implmentation. It's also not hard to store a return address
elsewhere to implement subroutine recursion. Later PDP-8a and the 6120
chip versions had a real hardware stack added. The stacks were
implemented using IOTs so it was possible to add them to any -8. The
lack of a return stack doesn't mean there isn't a set of addressing
modes to implement a software stack from all the minis and micros
I've seen.
Allison