TAL Programmer's Guide

Compiling Source Files
Getting Started
2–4 096254 Tandem Computers Incorporated
Statements Statements let you specify the actions you want a program to perform. All statements
are executable. For example, you use statements to:
Call procedures
Return from called procedures
Assign values to variables
Copy data from one location to another
Scan data for a character
Select statements to execute based on a condition
The sample source file includes statements that call a procedure and assign values to
variables. The following statements appear in the sample source file:
A CALL statement that calls the INITIALIZER system procedure
An assignment statement that assigns a value to VAR1
An assignment statement that assigns a value to VAR2
An assignment statement that assigns the sum of VAR1 and VAR2 to TOTAL
Comments Comments are notes you include in the source file to explain the source code. For
example, you can use a comment to explain a construct or describe an operation.
Comments in a source file can either:
Start with two hyphens (--) and terminate with the end of the line
Start with an exclamation point (!) and terminate with either another exclamation
point or the end of the line
In the sample source file, each comment begins with an exclamation point and ends
with the end of the line.
Compiling
Source Files
When you compile a source file, the compiler produces an object file and a compiler
listing. The compiler listing consists of source code and summary information. You
can execute the object file if it contains a procedure that has the MAIN attribute.
To compile the sample source file MYSRC, issue the following compilation command
at the TACL prompt:
TAL /IN mysrc/ myprog
The preceding command sends the compiler listing to your terminal and the object
code to an object file named MYPROG. You can include compiler directives and
additional run options in the compilation command. Section 14, “Compiling
Programs,” gives an overview of run options and compiler directives.