Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #13991

Re: Character Array vs String

From Patrick Scheible <kkt@zipcon.net>
Newsgroups comp.lang.c
Subject Re: Character Array vs String
References (5 earlier) <c5ddf1f2-6a08-461f-9c5c-9b85774bcdd2@e3g2000vbs.googlegroups.com> <9i270bFfdvU1@mid.individual.net> <3gjjc7hnnuum9md44djtindje5s4anh1om@4ax.com> <1c2dnbdXBN9MvFDTnZ2dnUVZ_i2dnZ2d@bestweb.net> <jaj9qg$19a$1@dont-email.me>
Date 2011-11-27 20:21 -0800
Message-ID <86aa7gyize.fsf@zipcon.net> (permalink)
Organization The Zip Connection (zipcon.net)

Show all headers | View raw


"BartC" <bc@freeuk.com> writes:

> "Kenneth Brody" <kenbrody@spamcop.net> wrote in message
> news:1c2dnbdXBN9MvFDTnZ2dnUVZ_i2dnZ2d@bestweb.net...
>> On 11/21/2011 2:39 AM, David Thompson wrote:
>> [...]
>>> But to answer the exact question, DEC PDP-10 computers had a 36-bit
>>> word with (few) special 'byte' instructions that could access *any*
>
>> While there were a few PDP-n's on campus as I recall, the main
>> computer lab at the college I went to used a KL-10.  While I hadn't
>> heard of C way back when, I did some assembly programming on it.
>>
>> As you say, it had 36-bit words, and 18-bit addresses.  The O/S used
>> six 6-bit characters per word for filename,
>
> 'SIXBIT' format. Very handy, and probably also used for identifiers
> for compilers (so you were limited to rather short names, but string
> matching was very quick).
>
>> which IIRC were in 6.3 format.  (I guess they used the other 18 bits
>> for file attributes?)  Text was typically stored as five 7-bit
>> characters, with 1 bit padding.
>>
>> Yet, although addresses were 18 bits wide, and each address pointed
>> to a 36-bit word, a "pointer" [could], in fact, be wider than 18
>> bits.  For
>
> The address was 18-bits (for 256KWords of memory per task; just over
> 1MB!). But there was also an 'indirect' bit which could be used for
> repeated pointer operations, all automatic on any instruction. I
> believe another 4-bits was an extra index register for each level of
> pointers.
>
>> example, there were machine instructions for accessing sub-words,
>> including things like "take the 7 bits at this address/bit-location,
>> move it to the low-order 7 bits at this address, zero-padding it,
>> and then increment the pointer by 7 bits".
>
> There were a dozen or so bits left over, which were used by
> byte-pointers, but these needed special instructions to make use of.
>
>> (Of course, C requires at least 8 bits per char, so I guess it would
>> use the same thing, but storing four 8-bit chars per word with 4
>> padding bits. You could store four 9-bit chars w/o any padding, but
>> files on disk were 8-bit characters, so it probably wouldn't make
>> sense to do so.)
>>
>> As I said, I never saw a C compiler for it, but I would suspect that
>> sizeof() would be "interesting" on such a system.  The simplest
>> system would be to simply store one 8-bit char per 36-bit word, but
>> that seems rather inefficient.
>
> I'd imagine C with it's various kinds of pointers would be a nightmare
> to implement, if packed char arrays were to be used. I remember using
> Pascal which offered a choice of unpacked (fast) or packed (slow)
> arrays, records and (presumably) strings.

There has been at least one C compiler for the PDP-10.  It uses four
9-bit chars per word.

The biggest model of PDP-10 supported extended addressing, with 23 bit
wide addresses.  That is word addresses, multiply by 4.5 to get the
capacity in 8-bit bytes.

-- Patrick

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Character Array vs String Sheky <shekhar07.nitdgp@gmail.com> - 2011-11-09 03:09 -0800
  Re: Character Array vs String Malcolm McLean <malcolm.mclean5@btinternet.com> - 2011-11-09 03:28 -0800
  Re: Character Array vs String James Kuyper <jameskuyper@verizon.net> - 2011-11-09 06:52 -0500
  Re: Character Array vs String Quentin Carbonneaux <qcarbonn@invalid.com> - 2011-11-09 12:01 +0000
    Re: Character Array vs String 88888 Dihedral <dihedral88888@googlemail.com> - 2011-11-09 04:48 -0800
      Re: Character Array vs String Nick Keighley <nick_keighley_nospam@hotmail.com> - 2011-11-09 05:53 -0800
        Re: Character Array vs String "osmium" <r124c4u102@comcast.net> - 2011-11-09 09:44 -0600
          Re: Character Array vs String Nick Keighley <nick_keighley_nospam@hotmail.com> - 2011-11-10 00:57 -0800
            Re: Character Array vs String "osmium" <r124c4u102@comcast.net> - 2011-11-10 08:56 -0600
              Re: Character Array vs String Nick Keighley <nick_keighley_nospam@hotmail.com> - 2011-11-10 08:16 -0800
                Re: Character Array vs String "Joachim Schmitz" <nospam.jojo@schmitz-digital.de> - 2011-11-10 18:34 +0100
                Re: Character Array vs String Kenneth Brody <kenbrody@spamcop.net> - 2011-11-10 14:08 -0500
                Re: Character Array vs String Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-11-10 20:52 +0000
                Re: Character Array vs String Nick Keighley <nick_keighley_nospam@hotmail.com> - 2011-11-11 01:29 -0800
              Re: Character Array vs String Lowell Gilbert <lgusenet@be-well.ilk.org> - 2011-11-10 12:29 -0500
              Re: Character Array vs String lawrence.jones@siemens.com - 2011-11-10 12:32 -0500
                Re: Character Array vs String Keith Thompson <kst-u@mib.org> - 2011-11-10 12:41 -0800
                Re: Character Array vs String jt@toerring.de (Jens Thoms Toerring) - 2011-11-11 13:12 +0000
              Re: Character Array vs String David Thompson <dave.thompson2@verizon.net> - 2011-11-21 02:39 -0500
                Re: Character Array vs String Kenneth Brody <kenbrody@spamcop.net> - 2011-11-23 11:39 -0500
                Re: Character Array vs String "BartC" <bc@freeuk.com> - 2011-11-23 17:15 +0000
                Re: Character Array vs String Kaz Kylheku <kaz@kylheku.com> - 2011-11-23 18:48 +0000
                Re: Character Array vs String Ben Pfaff <blp@cs.stanford.edu> - 2011-11-23 10:58 -0800
                Re: Character Array vs String Patrick Scheible <kkt@zipcon.net> - 2011-11-27 20:21 -0800
                Re: Character Array vs String David Thompson <dave.thompson2@verizon.net> - 2012-01-19 02:43 -0500
        Re: Character Array vs String Malcolm McLean <malcolm.mclean5@btinternet.com> - 2011-11-09 07:48 -0800
          Re: Character Array vs String James Kuyper <jameskuyper@verizon.net> - 2011-11-09 11:06 -0500
            Re: Character Array vs String Willem <willem@toad.stack.nl> - 2011-11-09 16:24 +0000
              Re: Character Array vs String James Kuyper <jameskuyper@verizon.net> - 2011-11-09 11:30 -0500
                Re: Character Array vs String "BartC" <bc@freeuk.com> - 2011-11-09 16:53 +0000
                Re: Character Array vs String Willem <willem@toad.stack.nl> - 2011-11-09 17:05 +0000
                Re: Character Array vs String Malcolm McLean <malcolm.mclean5@btinternet.com> - 2011-11-09 08:54 -0800
                Re: Character Array vs String Tobias Blass <tobiasblass@gmx.net> - 2011-11-09 21:01 +0000
                Re: Character Array vs String "BartC" <bc@freeuk.com> - 2011-11-09 21:26 +0000
                Re: Character Array vs String Nick Keighley <nick_keighley_nospam@hotmail.com> - 2011-11-10 01:11 -0800
                Re: Character Array vs String David Thompson <dave.thompson2@verizon.net> - 2011-11-21 02:39 -0500
                Re: Character Array vs String Keith Thompson <kst-u@mib.org> - 2011-11-21 00:15 -0800
                Re: Character Array vs String Keith Thompson <kst-u@mib.org> - 2011-11-09 14:06 -0800
                Re: Character Array vs String Stephen Sprunk <stephen@sprunk.org> - 2011-11-09 19:32 -0600
                Re: Character Array vs String Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-11-10 03:21 +0000
                Re: Character Array vs String "BartC" <bc@freeuk.com> - 2011-11-10 11:00 +0000
                Re: Character Array vs String Keith Thompson <kst-u@mib.org> - 2011-11-10 03:26 -0800
                Re: Character Array vs String Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-11-10 12:04 +0000
                Re: Character Array vs String Lew Pitcher <lpitcher@teksavvy.com> - 2011-11-21 12:02 -0800
                Re: Character Array vs String Kenneth Brody <kenbrody@spamcop.net> - 2011-11-23 11:42 -0500
                Re: Character Array vs String Uno <merrilljensen@q.com> - 2011-11-27 22:46 -0700
                Re: Character Array vs String Lew Pitcher <lpitcher@teksavvy.com> - 2011-11-27 23:30 -0800
                Re: Character Array vs String Nick Keighley <nick_keighley_nospam@hotmail.com> - 2011-11-28 00:22 -0800
        Re: Character Array vs String Keith Thompson <kst-u@mib.org> - 2011-11-09 13:59 -0800
    Re: Character Array vs String James Kuyper <jameskuyper@verizon.net> - 2011-11-09 08:36 -0500
      Re: Character Array vs String Quentin Carbonneaux <qcarbonn@invalid.com> - 2011-11-09 14:06 +0000
    Re: Character Array vs String Malcolm McLean <malcolm.mclean5@btinternet.com> - 2011-11-09 05:38 -0800
    Re: Character Array vs String Keith Thompson <kst-u@mib.org> - 2011-11-09 13:52 -0800
  Re: Character Array vs String Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-11-09 07:39 -0500
  Re: Character Array vs String "BartC" <bc@freeuk.com> - 2011-11-09 13:51 +0000
  Re: Character Array vs String John Bode <jfbode1029@gmail.com> - 2011-11-23 19:32 -0800
    Re: Character Array vs String James Kuyper <jameskuyper@verizon.net> - 2011-11-24 11:49 -0500

csiph-web