FORTRAN Reference Manual

Mixed-Language Programming
FORTRAN Reference Manual528615-001
13-17
Calling TAL Subprograms From FORTRAN
°
The mask must be one word for procedures with up to 16 parameters and two
words for procedures with 17 to 29 parameters.
°
The mask value must be right-justified in the word or words.
°
The bits in the mask correspond to parameters: bit 15 of the last word in the
mask is the bit associated with the last parameter; other bits correspond to the
remaining parameters in order.
°
Set the bit for each parameter whose value you supply in the call. Don’t set bits
for optional parameters that you omit, although you supply “dummy” values as
placeholders for them.
Masks for EXTENSIBLE procedures:
°
The mask must be one word for each 16 words of parameters or portion
thereof. For example, if there are 23 parameters some of which are multi-word
parameters (extended reference parameters or 32-bit or 64-bit value
parameters) so that there are a total of 37 words of parameters, you must have
three words of mask bits.
°
The mask value must be left-justified in the word or words.
°
The bits correspond to words of parameters: bit 0 of the first word in the mask
is the bit associated with the first word of the first parameter; other bits
correspond to the remaining parameter words in order.
°
Set the bit for each word of each parameter whose value you supply in the call.
Dont set bits for words of optional parameters that you omit, although you
supply “dummy” values as placeholders for them.
°
After the last mask word, you must include a single word that contains the
negative of the number of words of parameters passed (not counting the mask
words), as a 16-bit twos-complement binary integer.
If an EXTENSIBLE procedure is declared in TAL with a number in parentheses
after the word EXTENSIBLE, you can also call the procedure as a VARIABLE
procedure. If you do this, however, you can only use the first n parameters, where
n is the number in parentheses. Build the procedure call exactly as if the procedure
was declared VARIABLE and ignore all the additional parameters. In effect, you
are using an older version of the procedure that has fewer parameters.
Calling TAL Subprograms From FORTRAN
If you write a FORTRAN program that calls a TAL procedure, you must observe the
following rules:
For programs that you compile with ENV OLD in effect, the main program must be
written in FORTRAN, so that it establishes the run-time environment required by
FORTRAN object code.
You can do I/O in TAL and in FORTRAN within the same program.