Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!uunet!mcsun!unido!uklirb!gerten From: gerten@uklirb.UUCP (Rainer Gerten) Newsgroups: comp.arch Subject: Re: IBM PC prehistory Summary: Using base registers is the same as segment registers Message-ID: <8019@uklirb.UUCP> Date: 17 Jan 90 13:48:15 GMT References: <1990Jan16.055625.8255@esegue.segue.boston.ma.us> Reply-To: gerten@uklirb.UUCP (Rainer Gerten) Followup-To: comp.arch Organization: University of Kaiserslautern, W-Germany Lines: 38 In article <1990Jan16.055625.8255> (John R. Levine) writes: >Coding a program so that it can be moved while it's running is a lot harder >than a relocating loader. Either you have to tag every single pointer that >the program uses, which is impractical in C, or else you need a coding style >that reserves some registers as base pointers and make all memory references >relative to the base pointers. ^^^^^^^^^^^^^^^^^^^^ This sounds quite like segment register at the 8086 and co. For the use in a non-secured enviroment the approach of "base registers" for getting relocatable code is'nt that bad, if the segments are big enough. Strutured programming in mind, it is too a good way, to cut the code in small pieces (based upon separate modules like modula). Therefore, the need for big code pieces is'nt that urgent. The problem in the intel architecture is not only the architecture at all, it's mainly the design of the compilers (look at C, there you have 6 (?) memory-models). Why are the compiler not clever engough, to decide the right kind of addressing (like for example Turbo-Pascal with their units). I know, it's a problem for a C-compiler to decide, wether a function is used only inside a module or outside too. But this problem is based on the language design ! It true, the architecture of the 8086 and its decendents is not that good for C, but in languages like modula or ada this is no problem. A the side of data structures, it is a big problem for handling big arrays in the style, most C compiler do it: assigning a huge amount of linear memory and walking through it with "pointer++". But how often are these arrays needed (in structured programming, you use more often STRUCTURED data like b-trees and so on), so why are some people crying (thats not up to you, John) ? Developing more sophisticated languages and compilers, it is not that much the question of the architecture, if there are problems for doing this or that. With the above, I don't protect the architecture of segmented registers nor flame on linear addressing, but I like to point out, that a combination of looking at both would be more sophisticated. Rainer Gerten University of Kaiserslautern mail: gerten@uklirb.informatik.uni-kl.de