FORTRAN Reference Manual
Mixed-Language Programming
FORTRAN Reference Manual—528615-001
13-10
The FORTRAN Calling Sequence
FORTRAN generates object code to call a procedure that could be declared in TAL as:
PROC mycroft (holmes, doyle);
INT .holmes;
REAL .doyle;
BEGIN
STRING .result = 'L' - 5;
result ':=' ... ;
END;
Note that you do not specify a type in the TAL procedure for the TAL return value.
If you specify the FORTRAN compiler directive EXTENDEDREF:
PROC mycroft (holmes, doyle);
INT .EXT holmes;
REAL .EXT doyle;
BEGIN
STRING .EXT result = 'L' - 8;
result ':=' ... ;
END;
For the statement:
conan = mycroft (holmes, doyle)
FORTRAN generates code equivalent to:
STACK @temp
CALL mycroft (holmes, doyle)
conan = temp
where TEMP is a CHARACTER*7 variable created by the compiler, so that the function
reference has the desired effect. This elicits a “return type mismatch” warning message
from Binder, because FORTRAN describes the procedure to Binder as a function that
returns a character string value, but the TAL code does not specify a return value.
Character Parameter Lengths
Whenever a subprogram has a type CHARACTER parameter, either as an explicit
parameter or as the function-value pseudo-parameter for a CHARACTER function,
FORTRAN stores a 16-bit word containing that parameter’s length on top of the stack,
just below the words containing the parameter list.
If the procedure is not EXTENSIBLE, the length words are stored in the same relative
order as the procedure’s type CHARACTER parameters, with no gaps for parameters










