Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!ames!elroy!cit-vax!oberon!skat.usc.edu!blarson From: blarson@skat.usc.edu (Bob Larson) Newsgroups: comp.lang.c Subject: Re: register unions Message-ID: <7195@oberon.USC.EDU> Date: 24 Feb 88 19:24:20 GMT References: <686@cresswell.quintus.UUCP> Sender: news@oberon.USC.EDU Reply-To: blarson@skat.usc.edu (Bob Larson) Organization: USC AIS, Los Angeles Lines: 49 Keywords: attitudes In article <686@cresswell.quintus.UUCP> ok@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@Ecla.Usc.Edu blarson@skat.usc.edu Uucp: {sdcrdcf,cit-vax}!oberon!skat!blarson Prime mailing list: info-prime-request%fns1@ecla.usc.edu oberon!fns1!info-prime-request