jfh@rpp386.Dallas.TX.US (The Beach Bum) (10/25/88)
In article <1988Oct21.173920.17017@utzoo.uucp> henry@utzoo.uucp (Henry Spencer) writes: >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. The only two addressing modes which generated I-space references where the PC post-increment ones. So MOV (PC)+,R0 ; Really just a .WORD 1234 ; MOV #1234,R0 would fetch the word 1234 from I-space and stuff it into R0, and then MOV @(PC)+,R0 ; Really just a .WORD 1234 ; MOV @#1234,R0 would fetch from the word at address 1234 in D-space. The regular register-plus-displacement and register-indirect[-with-displacement] didn't generate I-space references. >>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. I believe the idiom was to run sed over the .s file from compiling with cc -S foo.c. I don't know that any C compiler for the '11 would put strings into a readonly data segment on its own. And as we have now beaten to death, you can't put strings in I-space because they are then lost forever ... -- John F. Haugh II +----Make believe quote of the week---- VoiceNet: (214) 250-3311 Data: -6272 | Nancy Reagan on Richard Stallman: InterNet: jfh@rpp386.Dallas.TX.US | "Just say `Gno'" UucpNet : <backbone>!killer!rpp386!jfh +--------------------------------------