Path: utzoo!attcan!uunet!husc6!bbn!uwmcsd1!ig!agate!ucbvax!LBL.GOV!nagy%warner.hepnet
From: nagy%warner.hepnet@LBL.GOV (Frank J. Nagy, VAX Wizard & Guru)
Newsgroups: comp.os.vms
Subject: Re: QIO Question (realy: AST parameter question)
Message-ID: <880530071209.23e03b4b@LBL.Gov>
Date: 30 May 88 14:12:09 GMT
Sender: daemon@ucbvax.BERKELEY.EDU
Organization: The Internet
Lines: 24

>   When you issue a $QIO with the "astprm" argument, how is the parameter
> passed to the completion AST?  I can't seem to find this in the orange books.

The AST calling sequence is described in Section 5.4 of the System Services
Reference Manual.  Basically the "astprm" argument is passed by value as
the first argument of the AST.  I normally declare my AST routines as
having a single argument (and don't play around with the saved R0/R1
values, etc.).   If your AST parameter is the address of an array or
other structure, then your AST routine will look fairly normal in any
high level language.  If your AST parameter is a scaler value, then
your AST routine will need to play some games if written in FORTRAN:

	Subroutine  AST(astprm)
	Integer*4 astprm
c
	If (%LOC(astprm) .EQ. ...

where the %LOC is needed since astprm is passed by-value.

= Frank J. Nagy   "VAX Guru & Wizard"
= Fermilab Research Division EED/Controls
= HEPNET: WARNER::NAGY (43198::NAGY) or FNAL::NAGY (43009::NAGY)
= BitNet: NAGY@FNAL
= USnail: Fermilab POB 500 MS/220 Batavia, IL 60510