TOPS-20 User Wiki

Tutorials contributed by the users of TWENEX.ORG

User Tools

Site Tools


TOPS-20 Compilers Tutorial


After program source has been stored in a file, the following steps are necessary before the program can be used:

  1. Compile the source code into an object (relocatable binary .REL) file.
  2. Load the object file into memory, linking with other object files if necessary.
  3. 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 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 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


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 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


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)
BLISS-36 .B36/36-BLISS
COBOL-68 .C68 .68C/68-COBOL
COBOL-74 .C74 .74C/74-COBOL
MACRO assembler .MAC[1]/MACRO /MAC

[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.

tutorials/compilers.txt · Last modified: 2014/01/10 07:32 by papa