[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference vaxaxp::vmsnotes

Title:VAX and Alpha VMS
Notice:This is a new VMSnotes, please read note 2.1
Moderator:VAXAXP::BERNARDO
Created:Wed Jan 22 1997
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:703
Total number of notes:3722

457.0. "Counting procedure parameters" by SAONE::POMMIER_JC () Mon Apr 14 1997 04:27

   Hi ,

        I have a customer which is using the following 
        macro procedure ( on VAX ) to count the number of
        parameters given to a procedure ( written in fortran,
        basic,C ):

               MOVL 8(FP),R0

         As this structure doesn't exist any more on Alpha,
         is there any way to do it on an Alpha system ?

         Many thanks in advance for any help

            Jean-Claude
        
T.RTitleUserPersonal
Name
DateLines
457.1AUSS::GARSONDECcharity Program OfficeMon Apr 14 1997 04:317
    re .0
    
    That approach simply won't work on Alpha. You should use the built-in
    function appropriate to the language you are using. FORTRAN and C both
    have one. I don't know about BASIC. Try the BASIC conference. Note that
    obtaining the argument count is probably non-standard and non-portable
    in most languages.
457.2IARGCOUNT ?MUCTEC::BECKERHartmut B., VMS & Languages, MunichMon Apr 14 1997 08:476
Looks like IARGCOUNT can do the job. Help Fortran Intrinsic Iargcount
explains: A function that returns the count of actual arguments passed to
the current routine.

Hth,
Hartmut
457.3Pointers...XDELTA::HOFFMANSteve, OpenVMS EngineeringMon Apr 14 1997 10:2816
    There is a Macro32 (VAX Aseembler, Alpha Compiler) conference
    at TURRIS::MACRO.

    You will want to point the customer at the Porting Macro32
    documentation in the OpenVMS documentation set, as well.

    You will also want to point your customer at the LIB$ routines
    that look at the "invocation" construct.

    And you will want to point your customer -- in addition to the
    Fortran keyword in a previous reply -- at the C variable-length
    argument processing, which also includes a mechanism by which
    the argument count can be retrieved.  (Donno about BASIC, ask
    the folks over in the BASIC conference.)

457.4GET_INVO_XXX not useful for this stuffWIBBIN::NOYCEPulling weeds, pickin' stonesMon Apr 14 1997 10:517
>    You will also want to point your customer at the LIB$ routines
>    that look at the "invocation" construct.

No, that won't be useful for finding the number of arguments a caller
received.  The only reliable method on Alpha is to use the language's
builtin argument-count operator or function.  If BASIC doesn't have one,
then there's no reliable method for BASIC.
457.5It's The Alpha "Call-Frame Traversal" Code...XDELTA::HOFFMANSteve, OpenVMS EngineeringMon Apr 14 1997 12:068
:>    You will also want to point your customer at the LIB$ routines
:>    that look at the "invocation" construct.
:
:No, that won't be useful for finding the number of arguments a caller
:received.  

    But it is the closest Alpha mechanism available "comparable" to
    the VAX call-frame traversal scheme...
457.6TLE::REAGANAll of this chaos makes perfect senseMon Apr 14 1997 13:526
    Yes you can find the caller's frame.  But since the compiler is
    at liberty to move the argument count to anywhere (or throw it
    away altogether if it doesn't appear to be needed), you can't reliably
    find the argument count even if you have the frame pointer.
    
    				-John