====== TOPS-20 Compilers Tutorial ====== ===== Compile-Load-Run ===== After program source has been stored in a file, the following steps are necessary before the program can be used: - Compile the source code into an object (relocatable binary .REL) file. - Load the object file into memory, linking with other object files if necessary. - Run the program in memory. (Optionally save the program's complete executable image in a .EXE file for later use.) TOPS-20 EXEC provides a number of commands to simplify the above process and automate the management of the various versions of program files produced. ==== @COMPILE ==== Compile one or more program source files and produce relocatable binary object (.REL) file(s). The correct compiler will be selected based on file type. If you use the standard file types for your ALGOL, COBOL, FORTRAN, or MACRO program (.ALG, .CBL, .FOR, .MAC, respectively), you can omit the file type and the system will search for your program source based on the specified file name. Simplest form: ''@COMPILE'' //filename// ==== @LOAD ==== Load the specified .REL file(s) into memory. ''@LINK'' will be invoked automatically if multiple object files are loaded. If a .REL file does not exist, or if the corresponding source file has been updated more recently than the .REL file, compile the program source and load the resulting object file. (The program is //not// run after loading and linking.) Simplest form: ''@LOAD'' //filename// ==== @RUN ==== If an executable file is specified and exists (default file type is .EXE), run the executable file. If a .EXE file exists, the ''@RUN'' command is unnecessary: Typing the file name by itself will cause EXEC to run the executable. If no file is specified, run the program currently loaded in memory. Simplest form: ''@RUN'' -- or -- //filename// ==== @SAVE ==== Save the program currently loaded into memory as an executable .EXE file. The default file name is the same as the loaded object file's. Saving the executable allows the program to be run later without having to compile or load/link the program. //**Executable files must be saved immediately after the object file is loaded and linked, and BEFORE the loaded program is run.**// Simplest form: ''@SAVE'' ==== @EXECUTE ==== If object (.REL) file(s) for the specified file(s) exit and are up-to-date, load, link, and run. If there is no object file, or the object file has been updated less recently than the corresponding source file, compile the program source and load, link, and run the resulting object file. Simplest form: ''@EXECUTE'' //filename// ==== Supported compilers ==== The EXEC compilation commands can invoke any of the following compilers. The compiler will be selected based on the type of the file specified, or the default selection can be overridden by specifying the command switch for the desired compiler. ^ Compiler ^Default file type(s)^Command switch(s)^ | ALGOL |.ALG[1]|/ALGOL| | BLISS-10 |.B10 .BLI|/10-BLISS| | BLISS-36 |.B36|/36-BLISS| | COBOL |.CBL[1]|/COBOL| | COBOL-68 |.C68 .68C|/68-COBOL| | COBOL-74 |.C74 .74C|/74-COBOL| | FAIL |.FAI|/FAIL| | FORTRAN |.FOR[1]|/FORTRAN| | MACRO assembler |.MAC[1]|/MACRO /MAC| | PASCAL |.PAS|/PASCAL| | SAIL |.SAI|/SAIL| | SIMULA |.SIM|/SIMULA| | SNOBOL |.SNO|/SNOBOL| [1]: The system will automatically search for source files with these standard types and run the appropriate compiler if you omit the file type(s) when you run @COMPILE, @LOAD, or @EXECUTE.