[net.lang.c] pointer format nit

throopw@dg_rtp.UUCP (Wayne Throop) (11/04/86)

> chris@umcp-cs.UUCP (Chris Torek)
>> desj@brahms (David desJardins)
>>... the point is that casts of pointers *don't* convert.
> Yes they do, and Wayne Throop has to know it:  His machine does
> indeed convert.  int *' is 32 bits.  DG
> machines use word pointers, except when dealing with bytes.

Chris is right in the grand sweep (as usual) but has made a little
mistake with the details (not very usual at all).

DG MV machines indeed have differing formats for (char *) and (int *)
pointers, but both are 32 bits.  It's somebody else that has the 48-bit
character pointers (can't call to mind who that is just now).  In fact,
there are three architecturally supported pointer types in the DG MV
world, word (16-bit-granular) pointers, byte (8-bit-granular) pointers,
and bit (1-bit-granular) pointers.  These pointers indicate locations in
a 4-gigabyte address space of eight rings.  The rings are the MV memory
protection method, as well as the method of regulating OS privileges.
The first two pointer formats fit into 32 bits, and are the only formats
that are used as pointer types in C.  The third type of pointer requires
64 bits (more than strictly necessary).

For those not already bored, the three formats are like so:

               1         2         3              1         2         3
      12345678901234567890123456789012   12345678901234567890123456789012

word  IRRRWWWWWWWWWWWWWWWWWWWWWWWWWWWW
byte  RRRBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
bit   IRRRWWWWWWWWWWWWWWWWWWWWWWWWWWWW   XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

'I' is the indirect bit, 'RRR' is the ring number, 'WWW...' is offset in
words, 'BBB...' is offset in bytes, 'XXX...' is offset in bits.
(Obviously, a lot of redundant offset in that bit pointer.  Basically,
it forms a word address first, and then a bit offset from there.)

Clearly, pointer casting on an MV machine *NEEDS* to be a conversion,
not a taken-as.  And other word-addressed machines have similar
requirements.

--
"Don't try this at home, kids..."
-- 
Wayne Throop      <the-known-world>!mcnc!rti-sel!dg_rtp!throopw

throopw@dg_rtp.UUCP (Wayne Throop) (11/04/86)

> chris@umcp-cs.UUCP (Chris Torek)
>> desj@brahms (David desJardins)
>>... the point is that casts of pointers *don't* convert.
> Yes they do, and Wayne Throop has to know it:  His machine does
> indeed convert.  `char *' is 48 bits; `int *' is 32 bits.  DG
> machines use word pointers, except when dealing with bytes.

Chris is right in the grand sweep (as usual) but has made a little
mistake with the details (not very usual at all).

DG MV machines indeed have differing formats for (char *) and (int *)
pointers, but both are 32 bits.  It's somebody else that has the 48-bit
character pointers (can't call to mind who that is just now).  In fact,
there are three architecturally supported pointer types in the DG MV
world, word (16-bit-granular) pointers, byte (8-bit-granular) pointers,
and bit (1-bit-granular) pointers.  These pointers indicate locations in
a 4-gigabyte address space of eight rings.  The rings are the MV memory
protection method, as well as the method of regulating OS privileges.
The first two pointer formats fit into 32 bits, and are the only formats
that are used as pointer types in C.  The third type of pointer requires
64 bits (more than strictly necessary).

For those not already bored, the three formats are like so:

               1         2         3              1         2         3
      12345678901234567890123456789012   12345678901234567890123456789012

word  IRRRWWWWWWWWWWWWWWWWWWWWWWWWWWWW
byte  RRRBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
bit   IRRRWWWWWWWWWWWWWWWWWWWWWWWWWWWW   XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

'I' is the indirect bit, 'RRR' is the ring number, 'WWW...' is offset in
words, 'BBB...' is offset in bytes, 'XXX...' is offset in bits.
(Obviously, a lot of redundant offset in that bit pointer.  Basically,
it forms a word address first, and then a bit offset from there.)

Clearly, pointer casting on an MV machine *NEEDS* to be a conversion,
not a taken-as.  And other word-addressed machines have similar
requirements.

--
"Don't try this at home, kids..."
-- 
Wayne Throop      <the-known-world>!mcnc!rti-sel!dg_rtp!throopw