Data in text segment

Henry Spencer henry at utzoo.uucp
Sat Oct 22 03:39:20 AEST 1988


In article <31029 at oliveb.olivetti.com> jerry at 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 at zoo.toronto.edu



More information about the Comp.unix.wizards mailing list