Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 (Tek) 9/28/84 based on 9/17/84; site mako.UUCP Path: utzoo!watmath!clyde!cbosgd!ihnp4!houxm!vax135!cornell!uw-beaver!tektronix!orca!mako!jans From: jans@mako.UUCP (Jan Steinman) Newsgroups: net.lang.c Subject: Re: Proposal to add modules to C Message-ID: <776@mako.UUCP> Date: Mon, 20-May-85 16:32:56 EDT Article-I.D.: mako.776 Posted: Mon May 20 16:32:56 1985 Date-Received: Wed, 22-May-85 02:09:02 EDT References: <224@sdcc13.UUCP> <5400006@prism.UUCP> <5751@umcp-cs.UUCP> <5606@utzoo.UUCP> Reply-To: jans@mako.UUCP (Jan Steinman) Organization: Tektronix, Wilsonville OR Lines: 29 The NS32000 Series has hardware support for this concept. (I'm suprised Henry didn't mention this in his posting -- he seems to know the NS32000.) It is quite well explained in the National literature, so I won't go over it in detail. The trick to resolving external module addresses at run time is to store them in a "link table", then use a known index into the table to access the routine. The extra fetch adds to the (already considerable) overhead of procedure/function calls; I know of no NS32000 compilers that make use of this feature, but then I don't know of too many! For instance the function "printf()" gets compiled to the following assembly code in "traditional" use: jsr _printf ;Does not exist at assemble time, must be linked. The linker then loads in all the printf() code (which probably includes a lot of dead code if you only wanted to do "printf("%s\n", string);) and resolves the address in the "jsr" call. Using National's external addressing, the compiler-generated instruction cxp 1234 ;(or some other meaningless-to-humans index) causes a jsr (sort of) through the 1234th location in the module's link table. Linking is then a simple matter of contiguous loading with no address resolution needed. The many address fetches needed makes this a slow process; National does it about as efficiently as can be expected. This might be less than accurate, and I've left out detail, but the concept of "modules" is supported by NS32000 hardware. Look in their book for more. -- :::::: Jan Steinman Box 1000, MS 61-161 (w)503/685-2843 :::::: :::::: tektronix!tekecs!jans Wilsonville, OR 97070 (h)503/657-7703 ::::::