register unions

Bob Larson blarson at skat.usc.edu
Thu Feb 25 05:24:20 AEST 1988


In article <686 at cresswell.quintus.UUCP> ok at quintus.UUCP (Richard A. O'Keefe) writes:
>I posted a message pointing out that this simply doesn't make sense on
>some machines (specifically including PR1MEs), and employed a familiar 
>humourous device to stress this.  I have received some flaming messages
>from people who took exception to this commonplace observation.  Oddly
>enough, no-one using a PR1ME has complained to me yet...

It was quite obvious that you were trying to use Prime as an example
without actually having used the C compiler on one.  The C compiler
designers made some strange desisions (for people used to the machines)
to make porting incorrect code eaiser in some cases.

64v mode:
	sizeof (int) == sizeof (long) == 4
	sizeof (char *) == sizeof (int *) == sizeof (whatever *) == 6
		(last 16 bits of pointers other than char * are unused)

If the first 32 bits of a pointer are 0, it is considered a NULL
pointer, not a pointer to the valid address 0 in kernal space.  (Other
Prime langues use a pointer to segment 7777 with the fault bit set for
NULL pointers.)

Casts from pointers to integers are non-trivial conversions, producing
the number of bytes from address 0, and loosing auxilary information
such as ring and fault bits.

Since 64 v mode C doesn't support 32 bit pointers, calling some other
language routines is difficult.

stdin, stdout, and stderr may only be used other than as arguments to
functions in main.  ("FILE *f = stdin;" will not work other than in
main.)

No variables are ever kept in registers.  Register function paramaters
are copied to local memory for faster access.

32ix mode:

	sizeof (char *) == sizeof (int *) == sizeof (whatever *) == 4

Register variables are supported.  The -ignoreregister option allows
the compiler to choose which variables should go in registers.

Only works on newer primes.  (4-digit except 2250.)

--
Bob Larson	Arpa: Blarson at Ecla.Usc.Edu	blarson at skat.usc.edu
Uucp: {sdcrdcf,cit-vax}!oberon!skat!blarson
Prime mailing list:	info-prime-request%fns1 at ecla.usc.edu
			oberon!fns1!info-prime-request



More information about the Comp.lang.c mailing list