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

Conference noted::hackers_v1

Title:-={ H A C K E R S }=-
Notice:Write locked - see NOTED::HACKERS
Moderator:DIEHRD::MORRIS
Created:Thu Feb 20 1986
Last Modified:Mon Aug 03 1992
Last Successful Update:Fri Jun 06 1997
Number of topics:680
Total number of notes:5456

458.0. "Number of arguments passed to a routine?" by LA780::LONGO (Bob Longo) Thu Apr 30 1987 18:24

    [also entered in the VMS notes file]

    I have a customer who is converting FORTRAN code to run on his new
    VAXes.  The FORTRAN on his old machine allowed a subroutine to
    determine the number of arguments passed to it.
    
    I have written a small routine than can be called from FORTRAN
    subroutine to determine the number of arguments passed to the FORTRAN
    subroutine.  It does this by examining the previous call frame on
    the stack and returning the argument count.  The routine I wrote
    consists of the usual argument validation and:
    	SAVAP=8
    	MOVZBL	@SAVAP(FP),@4(AP)	;Return previous prev arg count
    
    My question is this:  Is FORTRAN guaranteed to follow the procedure
    calling standard (i.e. not pass arguments to the subroutine in
    registers)?  Can anyone think of a reason why this routine would
    break in the future?  It seems to work fine, but I may be overlooking
    something that would cause it to break later.
    
    Thanks,
    -Bob
T.RTitleUserPersonal
Name
DateLines
458.1CHOVAX::YOUNGBack from the Shadows Again,Thu Apr 30 1987 18:531
    I have responded to this in vmsnotes  --  Barry