In said:
I ran this on a Data General Eclipse[%] ...
[% Actually I do not have access to one, but this is what it might
print, if I remember right.
Did anyone implement standard C on it? How about K&R C?
I am not at all sure about Standard C. The machine I used ran
a (somewhat bizarre and twisted variation on) 4.2BSD Unix. The
C compiler implemented everything required to compile typical
Unix programs. I think that covers "K&R C" and then some -- the
compiler had enumerations and "unsigned char", for instance.
Quite a lot of our C code had to be fixed up not to make assumptions
about pointer formats.
Besides the pointer trickiness, the main thing I remember about
the Eclipse is that the output from perror() was broken. It printed
a two digit error number, followed by no whitespace, followed by
the string, so that one would get things like:
prog: cannot open foo.dat: 02No such file or directory
(I also remember something about bogus newlines, perhaps before the
"02".)
(This machine and the Pyramid were responsible for our group at
the University of Maryland making numerous fixes to varous programs.
The Pyramid found non-pointer bugs. For instance, MH used the
interesting calling sequence "parameter passing by register
assumption"[%], which was impossible on the Pyramid due to its
register windows. The Pyramid also exposed all the programs that
failed to "return 0" or "exit(0)" from main. Return values from
functions had to be stored in register "pr0" in the register-window
assigned to that function, and calling some other function did not
affect one's own pr0, only one's tr0. Hence, programs that on the
VAX returned whatever was left in r0 -- which was the return value
from the most-recently-called function -- instead returned their
first argument. For main(), this was the parameter argc.)
[% An illustration, not necessarily the actual MH code and using
ANSI C syntax rather than Classic C:
void f1(struct S *param) {
register int a, b;
register FILE *some_file;
...
some_file = fopen("some_path", "w");
f2(param, a);
...
}
void f2(register struct S *param, register int a) {
register FILE *fp; /* NOTE: NOT INITIALIZED! */
...
fprintf(fp, "%s: %d\n", param->zig, a);
...
}
This worked on the VAX, and even the PDP-11, because the machine's
registers were handed out in a fixed, known order. On the VAX,
"some_file" wound up in r9; on the PDP-11 it was in r3. In each
case, declaring "fp" third in f2() caused the C compiler to reserve
the same register -- which still held the opened FILE *! The VAX
C compiler gave you six registers, while the PDP-11 gave you only
three, so the actual "parameter passing by register assumption" in
MH was definitely in the first six "register" variables, and almost
certainly in the first three.]