🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #753

Re: sizeof in 36-bits machines

#753
From: Richard H. Gumpertz
Date: Sat, 14 Oct 1989 17:10
23 lines
1911 bytes
I see no reason that char could not be 8 bits on a PDP-10.  sizeof(long) might
then be 4.  There is nothing in C that talks about the bit-size of any type
being a multiple of the bit-size of char.  There is only stuff that talks about
sizeof.  There is nothing that prohibits extra bits between chars (e.g. the
low-order 4 bits for PDP-10 style 8-bit chars) as long as the addressing
mechanism skips over them.  Hence, as long as adding 4 to a char * really adds
1 to the word-address portion of a PDP-10 byte pointer, all should work fine.
Note that char * might be implemented as a PDP-10 style (LDB) byte-pointer
while int * might be a word pointer.  Conversion would happen upon type-casting.

I forget whether char must hold at least 8 bits and don't have a standard in
front of me.  If 7 bits is legal, the above discussion applies there as well,
with sizeof(int) being 5!  This would match traditional PDP-10 style ASCII!

Alternatively, you could just make sizeof(int)=sizeof(char)=1 and then have a
more traditional addressing scheme (even though char[...] might be inefficient).

I prefer the former implementation.
-- 
==========================================================================
| Richard H. Gumpertz    rhg@cpsolv.UUCP -or- ...uunet!amgraf!cpsolv!rhg |
| Computer Problem Solving, 8905 Mohawk Lane, Leawood, Kansas 66206-1749 |
==========================================================================
Technical Details
Message-ID: <398@cpsolv.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!ucsd!swrinde!cs.utexas.edu!uunet!amgraf!cpsolv!rhg
References: <272@ssp1.idca.tds.philips.nl> <11284@smoke.BRL.MIL>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!ucsd!swrinde!cs.utexas.edu!uunet!amgraf!cpsolv!rhg
From: rhg@cpsolv.UUCP (Richard H. Gumpertz)
Newsgroups: comp.std.c
Subject: Re: sizeof in 36-bits machines
Message-ID: <398@cpsolv.UUCP>
Date: 14 Oct 89 17:10:51 GMT
References: <272@ssp1.idca.tds.philips.nl> <11284@smoke.BRL.MIL>
Reply-To: rhg@cpsolv.uucp (Richard H. Gumpertz)
Organization: Computer Problem Solving, Leawood, Kansas
Lines: 23