MACRO-FORTRAN LINK // COMMAND STRING PROCESSING 1) Macro-Fortran linkage subroutines and macros These routines allow MACRO-11 subroutines to be very easily linked into the FORTRAN IV or FORTRAN IV-PLUS traceback chain during execution. The macro MFSUBR defines the a global statement label (subroutine name) and links that name into the proper FORTRAN traceback list (see MACFOR.MAC and MACF4P.MAC). If errors trapped by the FORTRAN OTS (odd address traps, memory management errors, etc.) occur during the MACRO subroutine execution, a traceback, including the MACRO routine name, will print at the terminal. For specific assembly language routine debugging, the FORTRAN statement number may be incremented in the MACRO routine. Also, there is a macro that sets up a subroutine call to decode a FORTRAN subroutine argument list onto the stack so that arguments and/or argument addresses may be popped off the stack in order (1st arg first...). The macro allows you to specify whether arguments are required or optional and whether they have any default values. MFARG.MAC is the subroutine that does the decoding. The following MACRO routines all use the above mentioned macros, so you can look at them for an example of usage. 2) Get Command Line //FORTRAN callable interface The file GETCMD.MAC defines a set of FORTRAN callable routines that allow you to EASILY set up calls to the system GCML$ library. GCML is documented in the RSX-11M I/O Operations Manual in Chapter 6. The documentation in GETCMD.MAC and the usage in EXAMPLE.FTN should explain the FORTRAN interface pretty thoroughly. 3) Command String Interpreter // FORTRAN callable interface The files CSI.MAC, CSISW.MAC, and CSISV.MAC define a set of FORTRAN callable routines that interface to the system CSI$ library. Used in conjuction with GETCMD described above, they form a very powerful parsing tool. EXAMPLE.FTN is a heavily documented example of how this tool can very easily implement a parsing algorithm for a FORTRAN compiler command line, including switches and switch values. Chapter 6 of the RSX-11M I/O Operations Manual describes CSI$ in detail. Note that these routines do substantially more than what is documented in the manual....namely, these routines allow you to manipulate the input and output filespec defaults on all fields. Look very carefully at the documentation for CSIDEF to understand how this works. Note that the current default is to propagate ALL fields, excluding version number. Also, CSI2 returns a syntactically rigid ASCIZ filespec that may be submitted verbatim to a FORTRAN OPEN statement (e.g. OPEN (NAME=ouftil,...) and/or squished (spaces, etc. removed) for pretty printing by the CSIFIL subroutine. The above GCML$ and CSI$ routines were implemented using the MACRO-11 macros in MFPRE.MAC for linking FORTRAN programs to assembly language routines. It would be especially useful if these macros were re-written to support linkages to other languages (i.e. PASCAL, C, etc.) so that the code in GETCMD, CSI, CSISW, and CSISV could be used verbatim with these languages. Please let me know if you make any enhancements. Daniel Steinberg SRI International loc. K1023 333 Ravenswood Menlo Park, CA 94025 (415) 326-6200 ext.5539 The files in this directory are: README.1ST - This file MFLIB.CMD - Command file to build MFLIB.OLB and EXAMPLE.TSK MFLIB.DOC - Documentation for all this stuff, extracted from the sources EXAMPLE.FTB - TKB or FTB command file to build EXAMPLE EXAMPLE.FTN - Extensively documented example of the use of GETCMD, CSI, etc. If you plan on trying this package out, i recommend that you read through this sample program. CSI.MAC - Source code for CSI$ routines CSISV.MAC - Source code for CSI$ switch value routines CSISW.MAC - Source code for CSI$ switch table routines GETCMD.MAC - Source code for GCML$ routines MACFOR.MAC - Source code for FORTRAN-MACRO linkage MACF4P.MAC - Source code for F4P-MACRO linkage MFARG.MAC - Source code for FORTRAN argument decoding MFPRE.MAC - Prefix file for MACRO sources