integer types, sys calls, and stdio

Ken Turkowski ken at turtlevax.UUCP
Sun Jan 13 14:02:49 AEST 1985


In article <1997 at mordor.UUCP> jdb at mordor.UUCP (John Bruner) writes:
>Here at the S-1 Project at LLNL we are porting UNIX to our own
>machine, the S-1 Mark IIA.  The hardware is capable of operating
>upon 9-bit, 18-bit, 36-bit, and 72-bit quantities, so we have
>defined the following types:
>
>	char	= 9 bits	(S-1 quarterword)
>	short	= 18 bits	(S-1 halfword)
>	int	= 36 bits	(S-1 singleword)
>	long	= 72 bits	(S-1 doubleword)
 ...
>We can define our system calls to use "int" and "long" integers as
>V7 does, but this means that we'll have to use 72-bit integers when
>a 36-bit integer would nearly always suffice.  This seems ugly to me.
 ...
>One final recourse for us would be to admit defeat, change "long"
>to 36-bits, and hack in a "long long" type for 72-bit integers.  I
>don't want to do this, because it means that while the definition of
>integer types is machine dependent, the machine that they depend upon
>is the PDP-11 or the VAX.

Chars have always been 8 bits, shorts always 16, and longs always 32.
I would suggest that you keep as close to this as possible.  Int has
varied between 16 and 32 bits; hell, why not make it 64? :-)
viz,

	char	= 9 bits	(S-1 quarterword)
	short	= 18 bits	(S-1 halfword)
	long	= 36 bits	(S-1 singleword)
	int	= 72 bits	(S-1 doubleword)

-- 
Ken Turkowski @ CADLINC, Menlo Park, CA
UUCP: {amd,decwrl,nsc,seismo,spar}!turtlevax!ken
ARPA: turtlevax!ken at DECWRL.ARPA



More information about the Comp.lang.c mailing list