Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site west44.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxl!houxm!vax135!ukc!west44!lee From: lee@west44.UUCP (Lee McLoughlin) Newsgroups: net.lang.c Subject: Re: Prime C pointers Message-ID: <313@west44.UUCP> Date: Tue, 4-Sep-84 18:25:32 EDT Article-I.D.: west44.313 Posted: Tue Sep 4 18:25:32 1984 Date-Received: Fri, 31-Aug-84 02:58:46 EDT References: <12441@sri-arpa.UUCP> <365@vu44.UUCP> Organization: CS Dept., Westfield College, London Lines: 34 >> From: Bob Larson >> >> When casting a pointer (48 bits) to an integer or long (32 bits) using >> Prime C, it is changed into a byte address (not useful to prime hardware/ >> microcode) and the extra information (fault and ring) is apparently >> dropped. >Pointers are 32 bits on the prime, not 48. The problem is that the >ring information is stuffed in the upper 4 (or 5, I'm not sure) >bits. I ran into this problem when I converted lots of unix programs >that contained functions defined like >func(args) >and returned pointers. Commonly address on the Prime (in the 50 range) are held in 32 bits. This is because they are mainly word pointers. But you can have a character pointer which is 48 bits long. There is a bit in the word pointer which tells the hardware wether to bother with the extra 16 bits of the address or not. If you use this bit to represent hi/lo byte then you can use the 32 bit pointer to point at characters. This, of course, confuses everyone. > >By the way, we have the C compiler sold by Prime, but it's *very* >slow (spelled SSSSSSSSLLLLLLLLOOOOOOOsnore). Does anyone know of >a better C implementation, running under PRIMOS rev 19? > > Jack Jansen, {philabs|decvax}!mcvax!vu44!jack I did a C compiler for our Prime. The compiler itself it pretty fast. However it generates PMA (Prime Macro Assembler) and *BOY* is that assembler slow! Pointers on Primes are generally a real barrel of laughs. Good test of portability, miss out a cast and your proggy will dump on you. -- -------------- Lee McLoughlin !ukc!lmcl, west44!lee UKUUCP support.