Newsgroups: comp.unix.wizards
Path: utzoo!henry
From: henry@utzoo.uucp (Henry Spencer)
Subject: Re: Data in text segment
Message-ID: <1988Oct21.173920.17017@utzoo.uucp>
Organization: U of Toronto Zoology
References: <159@taux02.UUCP> <7124@rpp386.Dallas.TX.US> <10420@tekecs.TEK.COM> <7599@rpp386.Dallas.TX.US> <10440@tekecs.TEK.COM> <31029@oliveb.olivetti.com>
Date: Fri, 21 Oct 88 17:39:20 GMT

In article <31029@oliveb.olivetti.com> jerry@olivey.UUCP (Jerry Aguirre) writes:
>... If an instuction refference a value that is PC
>relative then the value is fetched from text space.  This is fairly easy
>to do in the hardware and doesn't require adding new instructions or
>addressing modes.  I am pretty sure this is the way the PDPs handled
>split I/D.

Nope, sorry, wrong.  Split-space pdp11s fetched from instruction space
only when the thing being fetched was logically part of the instruction
stream.  PC-relative fetches went to data space.  There was absolutely
no way to read data from text space.

>My supprise was that the compiler was smart enough to realize the the
>string could never be written to and placed it in the shared readonly
>area...

Actually, the compiler was probably assuming this rather than discovering
it.  K&R says that strings are modifiable, but many people disliked this
and felt it should have been otherwise.  Some of them wrote compilers.
-- 
The meek can have the Earth;    |    Henry Spencer at U of Toronto Zoology
the rest of us have other plans.|uunet!attcan!utzoo!henry henry@zoo.toronto.edu
