portability; bit*

Ron Natalie <ron> ron at brl-tgr.ARPA
Sat Jan 5 15:10:28 AEST 1985


> It isn't much of a portability argument that C runs on both  PDP-
> 11  and  370s.  Both are byte addressed, though I believe the 370
> has more alignment constraints.
> 
> Contrast C implementation on a Honeywell  mainframe  (as,  I  be-
> lieve,  Waterloo  has  done).  The machine is word addressed, not
> byte  addressed.   However  there  are  string  instructions  and
> pointers  which can index by a character count.  For that matter,
> there are bit string instructions which can index by a bit count.
> C  and  C programmers assume that the machine is easily character
> addressed, but the language takes no notice of bit addressing.
> 
> I therefore propose that the bit type be added to C, with  atten-
> dant bit*, bit[] bit(), etc.

Actually, 370's are subject to about the same alignment considerations
as a VAX.  You don't have to align things, but it is a more efficient
memory access if you do.

If you really want horrors, try machines that have different address
formats for various data types.  Take the Denelcor HEP (take mine
please).  It has three address types.  One for bytes and another for
quarter, half, and full (64 bit words).  The non-byte address sort of
looks like the byte address except that if the lower three bits are 0
you are referring to the full word, 2 and 6 refer to the upper and lower
half word, and 1, 3, 5, and 7 refer to the quarter words.

-Ron



More information about the Comp.lang.c mailing list