[Info-vax] BASIC and AST routines
Arne Vajhøj
arne at vajhoej.dk
Wed Nov 24 18:45:08 EST 2021
On 11/24/2021 5:34 PM, Bob Gezelter wrote:
> On Wednesday, November 24, 2021 at 2:00:49 PM UTC-5, Arne Vajhøj
> wrote:
>> On 11/24/2021 1:26 PM, Simon Clubley wrote:
>>> But to directly push values into the call frame for the routine
>>> (and hence directly visible to the routine) so they can be
>>> restored afterwards is just horrible, horrible, horrible. I have
>>> never seen another OS handle this problem in such an ugly way.
>> Now I followed Robert Gezeltzer's advice and it is worth noting
>> that this is really a VAX thing. The newer platforms do not use the
>> values - they are just there for VAX compatibility.
>
> Writing a better linkage is not a particularly difficult task. One is
> somewhat limited by the limitation that two values are passed, the
> AST Entry Address and the AST Parameter.
>
> On more than a few occasions, particularly when using ASTs with QIO
> on the RSX-11 family using 16-bit integers, where ASTPARM was not
> available, the straightforward solution was to use a data structured
> headlined by the IO Status Block. Alternatively, one could create a
> transfer vector which did nothing more than set up the context and
> pass control to an identified routine via a pointer.
>
> On OpenVMS (all architectures) on, e can do something similar, either
> hiding the non-ASTPARM parameters, or loading certain parameters from
> a data structure and then invoking a routine.
>
> It is only a problem in that some languages, e.g.. C can ignore extra
> parameters, while other languages, e.g., BASIC, actually check for
> the correct number of parameters. Languages which have type checking
> on capabilities for call gates add another complexity to this
> question.
Just to clarify - the advice I took was to read the IDSM.
And the AXP version explains that AXP (and presumedly I64) does
not actually restore or otherwise use arguments at return and
that they are only there for VAX compatibility. The R0 and R1
are restored from an AST stack.
Arne
More information about the Info-vax
mailing list