pTAL Guidelines for TAL Programmers
Overview
pTAL Guidelines for TAL Programmers—527256-002
1-5
TAL
TAL
HP and its customers have written most system software in TAL. TAL includes features
found in most higher-level programming languages including:
•
Data types
•
Record layouts
•
Pointers
•
Symbolic defines (macros)
•
Expressions consisting of arithmetic, Boolean, and relational operators and
operands
•
Assignment statements
•
Control statements (IF, WHILE, DO-UNTIL, CASE, FOR, GOTO)
•
Compound statements (sequences of executable statements preceded by a
BEGIN keyword and ended by an END keyword)
•
Lexically nested (two levels deep), parameterized procedures and functions
You can write TAL programs that use only higher-level language features and that,
therefore, are potentially portable to any hardware platform for which there is a TAL
compiler.
In addition to the previously described constructs, TAL includes constructs that enable
you to access low-level data elements of TNS architecture. Programs that use these
processor-specific constructs are not easy to port to other platforms. Nonportable TAL
constructs include:
•
CODE, STACK, and STORE statements (including CODE(DPCL) and other CODE
statements that access and alter TNS registers)
•
Base-address equivalenced variables (for example, INT loc = 'L' - 4)
•
Building and altering parameter masks for variable and extensible procedures
In TAL, you must specify where you want the compiler to allocate the data for each
variable that you declare:
•
In the user data segment using direct references (variables declared with no
indirection symbol)
•
In the user data segment using indirect references (variables declared with a “.”
indirection symbol)
•
In an extended data segment (variables declared with a “.EXT” indirection symbol)
The three different storage areas, and corresponding addressing methods, are a result
of the evolutionary history of TNS architecture, beginning in the 1970s when memory
was significantly more expensive than it is in the 1990s.