I believe that in OS/360's time the designers then couldn't do much better.

In Germany we had at that time a machine called Telefunken TR 440, and
there were even different machine instructions to do the subroutine call,
some that used so called index cells (in memory) to store the return address, and others that used the one and only "real" index register. So every compiler used his own technique. Inter language call was possible, but the compiler builders had to talk to each other, and you had to specify on every language, what other language the module was that you wanted to call. Maybe you could call FORTRAN
from PASCAL, and ASSEMBLER, but no COBOL, no PL/1, no ALGOL etc. -
the call sequences were different.

When I first met the IBM world (in 1982), I was kind of impressed by the simple and clean structure of the OS linkage conventions, and by the fact, that every language could
call the other. I did interfaces from PASCAL-VS to DMS-PANEL, to GDDM, to
SQL/DS etc., (that was on VM/CMS, not OS, but the linkage was the same)
and I had the impression, that every sort of connection between different
software products is possible.

Later I learned that the compilers didn't adhere to those conventions in every aspect.

And still later I understood (when LE came up), that it is really hard to design a runtime system for all the languages, because - for example - the languages are so different in the details. I recall that we had lots of problems with C in the beginning,
because our ASSEMBLER and PL/1 modules enabled the 0C8 abends in the PSW
program mask (and the VL bit in the last parameter address was set), and when using such an address in C printf etc., we got 0C8 abends, because somewhere in LE
length calculation from address distance failed. The C functions believed,
that C pointers always have the first bit off. We complained at IBM about this, but no result. So we had to add logic at some places to "clean" the addresses,
when entering the C functions.

The solution that IBM later provided was: LE added logic to catch the 0C8 abends and ignore them under the cover ... C simply ignores overflow, but since the hardware allows setting the program mask, and using inter-language calls it is possible that
the 0C8 abend is enabled, you are in a mess!

So what I'd like to say is: LE has a problem, because the definitions and the spirits of the languages are really different, and LE tries do serve them all. I don't think that such a system would have been possible in the 60s or 70s. At that time, the OS conventions
was the best that the designers could have done, I think.

Kind regards

Bernd




Am 26.06.2013 18:34, schrieb John Gilmore:
Tom  Marchant wrote:

<begin extract>
That is one way to save the caller's registers, not the only
documented Linkage convention.
</end extract>

and this is formally correct.  There is, however, something of an
obligation to use a caller-/invoker-supplied save area when one is in
fact supplied.  There may even be an obligation to adhere to SA back-
and forward-chaining conventions.  (Some statement-level languages use
them not only for error handling but in implementing language
features, e.g., long jumps, out-of-block GOTOs,  and condition
handling.)

My own view is that the original---in their way admirable---linkage
conventions of OS/360 were inadequate.  They failed to encompass,
among other things, machinery for ensuring that code could be
reentrant, invoked recursively, the [optional] use of descriptors, and
for the management of stack-based automatic/scratch/local storage.

The unfortunate consequences of this minimality were many.  Different
SLPLs constructed their run-time environments very differently, and
too much detailed lore  must now be mastered before successful ILC is
possible.

It is posslble to rail against some of the design elements of the LE,
but the babel we now makes it clear that something very like it was
needed early on.

John Gilmore, Ashland, MA 01721 - USA

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN


----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to