Re: linking to libraries on A series
- From: Paul Kimpel <paul.kimpel@xxxxxxxx>
- Date: Mon, 03 Nov 2008 06:02:51 -0800
On 11/2/2008 10:47 AM, Tim McCaffrey wrote:
In article <2ad2182b-3ac1-403e-9670-40106f1ee904@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>, dvdconroy@xxxxxxxxxxxxxx says...Hi all
I am not able to grasp on how does a program link to a Library .I
think it does with the CHANGE ATTRIBUTE LIBACCESS command but I cant
say for sure
there is also a direct LINK TO command ( I cant figure out what that
is)and there is also some mention of a Binder program.Can you please
throw some light on these?
David.
You link to library either by title (file name) or by function (the function name to file title is established through the SL command). By title is easier during program development, and by function is easier when the program is in production, because you don't have to recompile to point it at a different file.
Both of these are declared in the program source, the exact syntax being language dependent. Some languages cannot directly talk to system libraries (like C), and you need to write a jacket library to translate parameters and results from one environment to the other.
An A series library is akin to a Windows DLL, BTW, not a Windows .lib file.
- Tim
CHANGE ATTRIBUTE LIBACCESS OF ... TO BYTITLE or BYFUNCTION are the ways you configure how a library is going to be linked, but I think the question David was asking is how is the linkage actually established, i.e., what initiates it?
The answer is: on first reference. There is no explicit library linkage call, at least in COBOL (there are some explicit linkage controls available in Algol, but these are normally used only with connection libraries). The first time a program calls an entry point in a server library, the MCP traps the call, checks for compatible parameter sequences, sets up the address linkage, and restarts the call. Subsequent calls suffer only a one-level address indirection, which is handled by the hardware without further MCP involvement.
This automatic linkage process is quite efficient, and is heavily based on the E-mode hardware architecture that underlies MCP systems. The compilers generate control blocks in both the calling program and the library with the necessary information needed to find entry points and check parameter sequences. The address in the calling program for the entry point is initially set up using a control word that causes an interrupt when first referenced. The MCP traps this interrupt, and using the information in the compiler-generated control blocks, establishes the hardware addressing that will be used on subsequent calls. Attempting to call an non-existent entry point or to pass an incompatible set of parameters produces a fatal error for the calling program.
The Binder is something like a link editor on other systems -- it combines separately-compiled object files into a single executable. It is a form of compiler. In my experience, it hasn't been used much since libraries came along almost 30 years ago, except perhaps in FORTRAN and C environments. Libraries are so easy to use and so efficient that MCP applications tend to use those instead.
--
Paul
.
- Follow-Ups:
- Re: linking to libraries on A series
- From: Karl
- Re: linking to libraries on A series
- References:
- linking to libraries on A series
- From: dvdconroy@xxxxxxxxxxxxxx
- Re: linking to libraries on A series
- From: Tim McCaffrey
- linking to libraries on A series
- Prev by Date: Re: Unisys 2200/1100 Basic Concept ppt
- Next by Date: Re: History of preprocessing (Burroughs ALGOL)
- Previous by thread: Re: linking to libraries on A series
- Next by thread: Re: linking to libraries on A series
- Index(es):
Relevant Pages
|