Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!uunet!seismo!lll-lcc!ames!ucbcad!ucbvax!YALE.ARPA!LEICHTER-JERRY
From: LEICHTER-JERRY@YALE.ARPA
Newsgroups: comp.os.vms
Subject: Re: Help Request
Message-ID: <8707170644.AA16158@ucbvax.Berkeley.EDU>
Date: Fri, 17-Jul-87 02:44:51 EDT
Article-I.D.: ucbvax.8707170644.AA16158
Posted: Fri Jul 17 02:44:51 1987
Date-Received: Sat, 18-Jul-87 11:39:07 EDT
Sender: daemon@ucbvax.BERKELEY.EDU
Reply-To: 
Distribution: world
Organization: The ARPA Internet
Lines: 32


    [In response to a comment of mine on the lack of any certain way of
    determining the address of the END of a FORTRAN function, Mr. Hanrahan
    writes:  ]
    VAX-11 FORTRAN supports the ENTRY statement ... Thus, you can ...
    
    	INTEGER*4 FUNCTION LOCKED_FUNC (ARG, ...)
    	-
    	-
    	(declarations, code, etc.)
    	-
    	-
    	ENTRY LOCKED_FUNC_END (ARG, ...)
    	END
    
    ... [and] use %LOC(LOCKED_FUNC) and %LOC(LOCKED_FUNC_END) to get the
    addresses of the beginning and end of the procedure.

Again, this will PROBABLY work, but there is NOTHING in any FORTRAN definition
I know of that specifies where the code generated for an ENTRY statement will
actually be placed.  The fact that control will enter the function just after
the entry statement is irrelevant - the compiler can allocate the actual entry
code anywhere it likes, then provide a branch to the appropriate point within
the function.

Note that the compiler will, if it places the actual code for the ENTRY in
line, have to generate a branch around it.  If the ENTRY was inside a loop -
wierd, but certainly possible, even legal if the loop is constructed using
IF's and GOTO's rather than DO - moving the code out of line makes a lot of
sense.
							-- Jerry
----eli>