TAL Reference Manual Abstract This manual provides syntax descriptions and error messages for TAL (Transaction Application Language) for system and application programmers. Product Version TAL D40 Supported Release Version Updates (RVUs) This publication supports D40.00 and all subsequent D-series RVUs, and G01.00 and all subsequent G-series RVUs until otherwise indicated in a new edition.
Document History Part Number Product Version Published 15998 TAL C20 March 1989 065722 TAL D10 January 1993 096255 TAL C30, TAL D10 & TAL D20 September 1993 526371-001 TAL D40 September 2003
TAL Reference Manual Glossary Index Tables What’s New in This Manual xxxix Manual Information xxxix New and Changed Information xxxix About This Manual xli Audience xli How to Use this Manual Set xli Manual Organization xlii System Dependencies xliii Compiler Dependencies xliv Additional Information xlv Notation Conventions xlvii Railroad Diagrams xlvii Branching xlvii Spacing xlviii Case Conventions xlviii Example Diagrams xlviii Hypertext Links xlix General Syntax Notation xlix Notation for Messages l
2. Language Elements Contents 2. Language Elements Character Set 2-1 Declarations 2-1 Statements 2-2 Keywords 2-2 Identifiers 2-4 Identifier Classes 2-4 Constants 2-5 Constant Expressions 2-5 Number Bases 2-5 Variables 2-6 Symbols 2-6 Indirection Symbols 2-7 Base Address Symbols 2-7 Delimiters 2-7 Operators 2-9 3.
3. Data Representation (continued) Contents 3. Data Representation (continued) Storage Format 3-14 REAL and REAL (64) Numeric Constants 3-14 Examples of REAL and REAL (64) Numeric Constants Storage Format 3-15 Examples of Storage Formats 3-16 Constant Lists 3-16 Examples of Constant Lists 3-17 4.
4. Expressions (continued) Contents 4. Expressions (continued) Examples of Bit Shifts 4-30 5. LITERALs and DEFINEs LITERAL Declaration 5-1 Usage Considerations 5-2 Examples of LITERAL Declarations 5-2 DEFINE Declaration 5-3 Usage Considerations 5-4 Examples of DEFINE Declarations 5-5 Invoking DEFINEs 5-6 Compiler Action 5-7 Passing Actual Parameters 5-7 Examples of Passing DEFINE Parameters 5-8 6.
8. Structures (continued) Contents 8.
. Structures (continued) Contents 8. Structures (continued) Usage Considerations 8-25 Example of Structure Pointer Redefinitions 8-25 9. Pointers Simple Pointer Declaration 9-2 Usage Considerations 9-2 Examples of Simple Pointer Declarations 9-4 Structure Pointer Declaration 9-5 Usage Considerations 9-6 Examples of Structure Pointer Declarations 9-7 10.
10. Equivalenced Variables (continued) Contents 10. Equivalenced Variables (continued) Base-Address Equivalenced Structure Pointer Usage Considerations 10-18 10-17 11. NAMEs and BLOCKs NAME Declaration 11-1 Usage Considerations 11-2 Example of NAME Declaration 11-2 BLOCK Declaration 11-2 Usage Considerations 11-3 Examples of BLOCK Declarations 11-4 Coding Data Blocks 11-5 Unblocked Declarations 11-5 12.
12. Statements (continued) Contents 12.
13. Procedures Contents 13.
14. Standard Functions (continued) Contents 14.
14. Standard Functions (continued) Contents 14.
. Standard Functions (continued) Contents 14.
14. Standard Functions (continued) Contents 14.
15. Privileged Procedures (continued) Contents 15.
16. Compiler Directives (continued) Contents 16.
16. Compiler Directives (continued) Contents 16.
16. Compiler Directives (continued) Contents 16.
16. Compiler Directives (continued) Contents 16.
16. Compiler Directives (continued) Contents 16.
A. Error Messages (continued) Contents A. Error Messages (continued) Common Run-Time Environment Messages A-57 B.
B. TAL Syntax Summary (Railroad Diagrams) (continued) Contents B.
B. TAL Syntax Summary (Railroad Diagrams) (continued) Contents B.
B. TAL Syntax Summary (Railroad Diagrams) (continued) Contents B.
B. TAL Syntax Summary (Railroad Diagrams) (continued) Contents B.
B. TAL Syntax Summary (Railroad Diagrams) (continued) Contents B.
Contents C. TAL Syntax Summary (Bracket-and-Brace Diagrams) (continued) C.
Contents C. TAL Syntax Summary (Bracket-and-Brace Diagrams) (continued) C.
C. TAL Syntax Summary (Bracket-and-Brace Diagrams) (continued) Contents C.
Contents C. TAL Syntax Summary (Bracket-and-Brace Diagrams) (continued) C.
C. TAL Syntax Summary (Bracket-and-Brace Diagrams) (continued) Contents C.
C. TAL Syntax Summary (Bracket-and-Brace Diagrams) (continued) Contents C.
Tables (continued) Contents Tables (continued) Table v. Table 1-1. Table 2-1. Table 2-2. Table 2-3. Table 2-4. Table 2-5. Table 2-6. Table 2-7. Table 2-8. Table 2-9. Table 3-1. Table 3-2. Table 3-3. Table 3-4. Table 3-5. Table 4-1. Table 4-2. Table 4-3. Table 4-4. Table 4-5. Table 4-6. Table 4-7. Table 4-8. Table 4-9. Table 4-10. Table 4-11. Table 4-12. Table 4-13. Table 4-14. Table 8-1. Table 8-2. Table 8-3. Table 8-4. Table 8-5. Table 9-1. Table 9-2. Table 9-3.
Tables (continued) Contents Tables (continued) Table 10-1. Table 12-1. Table 13-1. Table 14-1. Table 14-2. Table 14-3. Table 14-4. Table 16-1.
Contents TAL Reference Manual—526371-001 xxxiv
What’s New in This Manual Manual Information TAL Reference Manual Abstract This manual provides syntax descriptions and error messages for TAL (Transaction Application Language) for system and application programmers. Product Version TAL D40 Supported Release Version Updates (RVUs) This publication supports D40.00 and all subsequent D-series RVUs, and G01.00 and all subsequent G-series RVUs until otherwise indicated in a new edition.
New and Changed Information What’s New in This Manual • Added Built-in Functions on page 14-44 to document that TAL directly implements pTAL built-ins TAL Reference Manual—526371-001 xxxvi
About This Manual The Transaction Application Language (TAL) is a high-level, block-structured language used to write system software and transaction-oriented applications. The TAL compiler compiles TAL source programs into executable object programs. The TAL compiler and the object programs it generates execute under control of the HP NonStop™ Kernel operating system. This manual describes the syntax for using TAL and the TAL compiler.
Manual Organization About This Manual Table i. TAL Manual Set Manual Description TAL Programmer’s Guide Helps you get started in creating, structuring, compiling, running and debugging programs. Describes how to declare and access procedures and variables and how the TAL compiler allocates storage for variables.
System Dependencies About This Manual Section 10, Equivalenced Variables describes the syntax for declaring equivalenced variables Section 11, NAMEs and BLOCKs describes the syntax for NAME and BLOCK declarations Section 12, Statements describes the syntax for specifying statements Section 13, Procedures describes the syntax for declaring procedures, subprocedures, entry points, and labels Section 14, Standard Functions describes the syntax for using standard functions Section 15, Privileged Pro
Compiler Dependencies About This Manual Table ii.
Additional Information About This Manual If you need to develop and maintain C-series TAL applications on a D-series system, the following files must be restored from the C-series system: C-Series File to Restore Description TAL TAL Compiler TALERROR TAL Error Messages TALLIB TAL Run-time Library TALDECS TAL External Declarations FIXERRS TACL macro for correcting TAL source files BINSERV Binder server for compilers SYMSERV Symbol-table server for compilers The C-series compiler expects a C
Additional Information About This Manual Table iv describes manuals about programming in the NonStop environment. Table iv. Programming Manuals Manual Description Guardian Procedure Calls Reference Manual Gives the syntax and programming considerations for using system procedures. Guardian Programmer’s Guide Tells how to use the programmatic interface of the operating system.
Notation Conventions About This Manual Notation Conventions Railroad Diagrams This manual presents syntax in railroad diagrams. To use a railroad diagram, follow the direction of the arrows and specify syntactic items as indicated by the diagram and the term definitions that follow the diagram. Here is an example of a railroad diagram: SOURCE file-name define-name ( assign-name section-name , ) VSTAB02.
Spacing About This Manual Spacing Where no space is allowed, the notation ns appears in the railroad diagram. Here is an example of a diagram in which spaces are not allowed: ns int-expression ns := . ns < left-bit > ns ns : ns right-bit VSTAB03.vsd You can prefix identifiers of standard indirect variables with the standard indirection symbol (.) with no intervening space.
Hypertext Links About This Manual C[0] INT (32) c[0:4] := ["abcd", 1D, 3D, "XYZ", %20D]; ! Declare an array and initialize ! the array elements with values ! specified in a constant list "a" "b" "c" "d" C[1] 1D C[2] 3D "X" "Y" "Z" "" C[3] C[4] %20D VSTAB04.vsd Hypertext Links Blue underline is used to indicate a hypertext link within text. By clicking a passage of text with a blue underline, you are taken to the location described.
General Syntax Notation About This Manual italic computer type. Italic computer type letters within text indicate C and Open System Services (OSS) variable items that you supply. Items not enclosed in brackets are required. For example: pathname [ ] Brackets. Brackets enclose optional syntax items. For example: TERM [\system-name.]$terminal-name INT[ERRUPTS] A group of items enclosed in brackets is a list from which you can choose one item or none.
General Syntax Notation About This Manual Quotation marks around a symbol such as a bracket or brace indicate the symbol is a required character that you must type as shown. For example: "[" repetition-constant-list "]" Item Spacing. Spaces shown between items are required unless one of the items is a punctuation symbol such as a parenthesis or a comma. For example: CALL STEPMOM ( process-id ) ; If there is no space between two items, spaces are not permitted.
Notation for Messages About This Manual Notation for Messages This list summarizes the notation conventions for the presentation of displayed messages in this manual. Bold Text. Bold text in an example indicates user input typed at the terminal. For example: ENTER RUN CODE ?123 CODE RECEIVED: 123.00 The user must press the Return key after typing the input. Nonitalic text. Nonitalic letters, numbers, and punctuation indicate text that is displayed or returned exactly as shown. For example: Backup Up.
Notation for Management Programming Interfaces About This Manual | Vertical Line. A vertical line separates alternatives in a horizontal list that is enclosed in brackets or braces. For example: Transfer status: { OK | Failed } % Percent Sign. A percent sign precedes a number that is not in decimal notation. The % notation precedes an octal number. The %B notation precedes a binary number. The %H notation precedes a hexadecimal number.
About This Manual Notation for Management Programming Interfaces TAL Reference Manual—526371-001 l
1 Introduction The Transaction Application Language (TAL) is a high-level, block-structured language that works efficiently with the system hardware to provide optimal object program performance. The TAL compiler compiles TAL source programs into executable object programs.The compiler and the object programs it generates execute under control of the NonStop Kernel.
Major Features Introduction • • • • • • • • • • • Subprocedures—A procedure can contain subprocedures, callable only from within the same procedure. When a subprocedure calls another subprocedure, the caller’s environment remains in place. The operating system saves the location in the caller to which control is to return when the called subprocedure terminates. Private data area—Each activation of a procedure or subprocedure has its own data area.
System Services Introduction • • • Modular programming—You can divide a large program into modules, compile them separately, and then bind the resulting object files into a new object file. Mixed-language programming—You can use NAME and BLOCK declarations, procedure declaration options—such as public name, language attribute, and parameter pairs—and compiler directives in support of mixed-language programming.
CRE Services Introduction CRE Services The CRE provides services that support mixed-language programs compiled on Dseries compilers. A mixed-language program can consist of C, COBOL85,FORTRAN, Pascal, and TAL routines. A routine is a program unit that is callable from anywhere in your program.
2 Language Elements This section lists the elements that make up the TAL language.
Statements Language Elements Statements Statements specify operations to be performed on declared objects. Statements are summarized in Table 2-1 and described in Section 12, Statements. Table 2-1.
Keywords Language Elements Table 2-2.
Identifiers Language Elements Identifiers Identifiers are names you declare for objects such as variables, LITERALs, DEFINEs, and procedures (including functions). Identifiers must conform to the following rules: • • • • • • They can be up to 31 characters long. They can begin with an alphabetic character, an underscore (_), or a circumflex (^). They can contain alphabetic characters, numeric characters, underscores, or circumflexes. They can contain lowercase and uppercase characters.
Constants Language Elements Table 2-4.
Variables Language Elements Decimal 47 Binary %B101111 Octal %57 Hexadecimal %H2F Variables A variable is a symbolic representation of data. It can be a single-element variable or a multiple-element variable. You use variables to store data that can change during program execution. The compiler does not automatically initialize variables.
Indirection Symbols Language Elements Indirection Symbols Indirection symbols let you use indirect addressing to save space in limited storage areas, as described in the TAL Programmer’s Guide. Indirect addressing requires two memory references, first to a location that contains an address and then to the data located at the address. Table 2-6 lists indirection symbols. Table 2-6. Indirection Symbols Symbol Meaning .
Delimiters Language Elements Table 2-8. Delimiters (page 1 of 2) Symbol Character Representation Uses ! Exclamation mark Begins and optionally ends a comment -- Two hyphens Begins a comment , Comma Separates fields of information, such as in declarations, statements, directives, and constant lists ; Semicolon Terminates data declarations Separates statements Separates declaration options .
Operators Language Elements Table 2-8.
Operators Language Elements Table 2-9.
3 Data Representation Data is the information on which a program operates. Your program data includes variables and constants. Variables hold values that can change during program execution. When you declare a variable, you specify a data type that determines the amount of storage the variable requires, the kind of values it can represent, and other characteristics. Constants are values that do not change during program execution.
Data Types Data Representation Table 3-1 gives information about each data type. Table 3-1.
Specifying Data Types Data Representation Specifying Data Types The format for specifying data types in declarations is: STRING INT REAL ( width ) UNSIGNED ( width ) ( fpoint ) FIXED * VST0301.vsd width is a constant expression that specifies the width, in bits, of the variable. The constant expression can include LITERALs and DEFINEs (previously declared constants and text).
Data Type Aliases Data Representation Specifying Widths When you specify the width of the INT, REAL, or UNSIGNED data type, the constant expression can include LITERALs and DEFINEs. Here is an example that includes a LITERAL: LITERAL int_size = (2 * 4) + 8; !INT_SIZE equals 16 INT(int_size) num; !Data type is INT(16) Section 6, Simple Variables describes LITERALs and DEFINEs on page 5-1.
Storage Units Data Representation Storage Units Storage units are the containers in which you can access data stored in memory. The system fetches and stores all data in 16-bit words, but you can access data as any of the storage units listed in Table 3-2. Table 3-2.
Functions by Data Type Data Representation Table 3-3. Operations by Data Type (page 2 of 2) Operation STRING INT or Unsigned (1-16) INT (32) or Unsigned (17-31) FIXED REAL or REAL (64) Relational Operations Yes Yes Yes Yes Yes Bit shifts Yes Yes Yes No No Byte scans Yes Yes Yes Yes Yes Section 4, Expressions, explains how the data type of an operand affects its behavior in expressions. Addresses as Data You can store standard (16-bit) addresses in INT variables.
Address Types Data Representation Address Types TAL supports the following pTAL address types. For further details, see the pTAL Reference Manual. pTAL supports 10 address types that control the addresses you store into pointers. pTAL uses address types to ensure that your program addresses the same relative data locations on a RISC processor as it does on a CISC processor.
Character String Constants Data Representation • • • • • INT numeric constants INT(32) numeric constants FIXED numeric constants REAL and REAL(64) numeric constants Constant lists Character String Constants A character string constant consists of one or more ASCII characters stored in a contiguous group of bytes. " string " VST0302.vsd string is a sequence of one or more ASCII characters enclosed in quotation mark delimiters.
Example of Character String Constant Data Representation In assignment statements, a character string can contain at most four characters, depending on the data type of the variable. Example of Character String Constant This example declares an INT variable and initializes it with a character string: INT chars := "AB"; String Numeric Constants Representation: Unsigned 8-bit integer Range: 0 through 255 integer base VST0303.
INT Numeric Constants Data Representation INT Numeric Constants Representation: Signed or Unsigned 16-bit integer Range (unsigned): 0 through 65,535 Range (signed): –32,768 through 32,767 integer base + - VST0304.vsd base is %, %B, or %H, which indicates a number base: Octal % Binary %B Hexadecimal %H The default base is decimal. Unsigned integers greater than 32,767 must be in octal, binary, or hexadecimal base. integer is one or more digits.
Examples of INT Numeric Constants Data Representation Examples of INT Numeric Constants Here are examples of INT numeric constants: Decimal 3 -32045 Octal %177 -%5 Binary %B01010 %b1001111000010001 Hexadecimal %H1A %h2f Storage Format The system stores signed integers in two’s complement notation. It obtains the negative of a number by inverting each bit position in the number, and then adding 1.
Examples of INT (32) Numeric Constants Data Representation integer is one or more digits.
FIXED Numeric Constants Data Representation FIXED Numeric Constants Representation: Signed 64-bit fixed-point number Range: –9,223,372,036,854,775,808 through +9,223,372,036,854,775,807 integer base + F . fraction %F VST0306.vsd base is %, %B, or %H, which indicates a number base: Octal % Binary %B Hexadecimal %H The default base is decimal integer is one or more digits.
Examples of FIXED Numeric Constants Data Representation Examples of FIXED Numeric Constants Decimal 1200.09F 0.1234567F 239840984939873494F -10.09F Octal %765235512F Binary %B1010111010101101010110F Hexadecimal %H298756%F Storage Format The system stores a FIXED number in binary notation. When the system stores a FIXED number, it scales the constant as dictated by the declaration or expression. Scaling means the system multiplies or divides the constant by powers of 10 to move the decimal.
Examples of REAL and REAL (64) Numeric Constants Data Representation integer is one or more decimal digits that compose the integer part. fraction is one or more decimal digits that compose the fractional part. E and L are suffixes that specify floating-point constants: REAL E REAL(64) L exponent is one or two decimal digits that compose the exponential part. Examples of REAL and REAL (64) Numeric Constants Here are the examples of REAL and REAL(64) numeric constants.
Examples of Storage Formats Data Representation The system stores the parts of a floating-point constant as follows: Data Type Sign Bit Fraction Exponent REAL <0> <1:22> <23:31> REAL <0> <1:54> <55:63> Examples of Storage Formats 1. For the following REAL constant, the sign bit is 0, the fraction bits are 0, and the exponent bits contain %400 + 2, or %402: 4 = 1.0 * 2 2 stored as %000000 %000402 2. For the following REAL constant, the sign bit is 1, the fraction bits contain %.2 (decimal .
Examples of Constant Lists Data Representation [ repetition-factor constant-list-seq * ] VST0309.vsd repetition-factor is an INT constant that specifies the number of times constant-list-seq occurs. constant-list-seq is a list of one or more constants, each stored on an element boundary. constant repetition-constant-list , VST0310.vsd constant is a character string, a number, or a LITERAL specified as a single operand.
Examples of Constant Lists Data Representation 3. This example initializes a STRING array with a repetition constant list: STRING b[0:79] := 80 * [" "]; 4. This example initializes an INT(32) array with a mixed constant list containing values of the same data type.
4 Expressions This section describes the syntax for: • • • Arithmetic and conditional expressions Special expressions (assignment, CASE, IF, group comparison) Bit operations (extraction and shift) Section 5, “Using Expressions,” in the TAL Programmer’s Guide describes: • • Assigning conditional expressions Dereferencing simple variables (formerly called temporary pointers) About Expressions An expression is a sequence of operands and operators that, when evaluated, produces a single value.
Data Types of Expressions Expressions Expression Description Examples Arithmetic expression An expression that computes a single numeric value and that consists of operands and arithmetic operators. 398 + num / 84 Constant expression An arithmetic expression that contains only constants, LITERALs, and DEFINEs as operands. 398 + 46 / 84 Conditional expression An expression that establishes the relationship between values and that results in a true or false value.
Precedence of Operators Expressions Precedence of Operators Operators in expressions can be arithmetic (signed, unsigned, or logical) or conditional (Boolean or relational, signed or unsigned). Within an expression, the compiler evaluates the operators in the order of precedence. Within each level of precedence, the compiler evaluates the operators from left to right. Table 4-1 shows the level of precedence for each operator, from highest (0) to lowest (9). Table 4-1.
Precedence of Operators Expressions Table 4-1. Precedence of Operators (page 2 of 2) Operator Operation Precedence >= Signed greater than or equal to 5 <> Signed not equal to 5 ‘<‘ Unsigned less than 5 ‘=’ Unsigned equal to 5 ‘>’ Unsigned greater than 5 ‘<=’ Unsigned less than or equal to 5 ‘>=’ Unsigned greater than or equal to 5 ‘<>’ Unsigned not equal to 5 NOT Boolean negation 6 AND Boolean conjunction 7 OR Boolean disjunction 8 := Assignment* 9 .<...
Arithmetic Expressions Expressions Arithmetic Expressions An arithmetic expression is a sequence of operands and arithmetic operators that computes a single numeric value of a specific data type. operand arithmetic - operator operand + - VST0402.vsd + and - are unary plus and minus operators applied to the leftmost operand of the expression. If you do not use the unary plus or unary minus operator, the default is unary plus. operand is a value in an arithmetic expression.
Examples of Arithmetic Expressions Expressions Examples of Arithmetic Expressions Following are examples of arithmetic expressions: var1 !operand -var1 !- operand +var1 * 2 !+ operand arithmetic-operator operand var1 / var2 !operand arithmetic-operator operand var1 * (–var2) !operand arithmetic-operator operand 2 * 3 + var / 2 2 * var * 4 Operands in Arithmetic Expressions An operand consists of one or more elements that evaluate to a single value.
Signed Arithmetic Operators Expressions Table 4-3.
Signed Arithmetic Operators Expressions A positive fpoint specifies the number of decimal places to the right of the decimal point: FIXED(3) x := 0.642F; !Stored as 642 A negative fpoint specifies a number of integer places to the left of the decimal point. To store a FIXED value, a negative fpoint truncates the value leftward from the decimal point by the specified number of digits.
Unsigned Arithmetic Operators Expressions FIXED a; FIXED (2) b; FIXED (-1) c; a := 2.015F * (b Data declarations + C); up 3 3 The fpoint of C is increased by 3 2 5 The final result is truncated by 5 places to match the fpoint of A 0 VST0403.vsd Effect on Hardware Indicators Signed arithmetic operators affect the hardware indicators as described in Testing Hardware Indicators on page 4-16.
Unsigned Arithmetic Operators Expressions Table 4-5. Unsigned Arithmetic Operators (page 2 of 2) Operator Operation Operand Type Example ‘/’ Unsigned division INT(32) or UNSIGNED (17–31) dividend and STRING, INT, or UNSIGNED(1–16) divisor alpha '/' beta ‘\’ Unsigned modulo division INT(32) or UNSIGNED (17–31) dividend and STRING, INT, or UNSIGNED(1–16) divisor alpha '\' beta * Unsigned modulo operations return the remainder.
Bitwise Logical Operators Expressions Effect on Hardware Indicators Unsigned add and subtract operators affect the carry and condition code indicators as described in Testing Hardware Indicators on page 4-16. Bitwise Logical Operators You use logical operators—LOR, LAND, and XOR—to perform bit-by-bit operations on STRING, INT, and UNSIGNED(1–16) operands only. Logical operators always return 16-bit results. Table 4-7 gives information about these operators. Table 4-7.
Conditional Expressions Expressions Conditional Expressions A conditional expression is a sequence of conditions and Boolean or relational operators that establishes the relationship between values. You can use conditional expressions to direct program flow. condition NOT AND OR condition NOT VST0404.vsd condition is an operand in a conditional expression.
Examples of Conditional Expressions Expressions Examples of Conditional Expressions Following are examples of conditional expressions: a !condition NOT a !NOT condition a OR b !condition OR condition a AND b !condition AND condition a AND NOT b OR c !condition AND NOT condition ... Conditions A condition is an operand in a conditional expression that represents a true or false state. A condition can consist of one or more of the elements listed in Table 4-8. Table 4-8.
Boolean Operators Expressions Boolean Operators You use Boolean operators—NOT, OR, and AND—to set the state of a single value or the relationship between two values. Table 4-9 describes the Boolean operators, the operand types you can use with them, and the results that such operators yield. Table 4-9.
Relational Operators Expressions Table 4-10.
Testing Hardware Indicators Expressions Testing Hardware Indicators Hardware indicators include condition code, carry, and overflow settings. Arithmetic and conditional operations, assignments, and some file-system calls affect the setting of the hardware indicators. To check the setting of a hardware indicator, use an IF statement immediately after the operation that affects the hardware indicator.
Carry Indicator Expressions CALL WRITE( ... ); IF >= THEN system_message := -1; !True ELSE system_message := 0; !False IF system_message = -1 THEN ... ; Carry Indicator The carry indicator is bit 9 in the environment register (ENV.K).
Special Expressions Expressions Operation Overflow Indicator Type conversions On, off, or preserved Array indexing and extended structure addressing Undefined Assignment or shift operation Preserved For example, the following operations turn on the overflow indicator (and interrupt the system overflow trap handler if the overflow trap is armed through ENV.
Assignment Expression Expressions Table 4-12. Special Expressions Expression Form Kind of Expression Assignment Description Page Arithmetic Assigns the value of an expression to a variable 4-19 CASE Arithmetic Selects one of several expressions 4-20 IF Arithmetic Conditionally selects one of two expressions 4-21 Group comparison Conditional Does unsigned comparison of two sets of data 4-23 Assignment Expression The assignment expression assigns the value of an expression to a variable.
CASE Expression Expressions 3. This example mixes the assignment form with a relational form. It assigns the value of B to A, then checks for equality with 0: IF (a := b) = 0 THEN ... ; CASE Expression The CASE expression selects one of several expressions. CASE selector OF BEGIN expression ; END otherwise expression ; VST0406.vsd selector is an INT arithmetic expression that selects the expression to evaluate.
IF Expression Expressions You can nest CASE expressions. CASE expressions resemble unlabeled CASE statements except that CASE expressions select expressions rather than statements. Example of CASE Expression This example selects an expression based on the value of A and assigns it to X: INT x, a, b, c, d; !Code to initialize variables x := CASE a OF BEGIN b; !If A is 0, assign value of B to X. c; !If A is 1, assign value of C to X. d; !If A is 2, assign value of D to X.
IF Expression Expressions Usage Considerations If the condition is true, the result of the THEN expression becomes the result of the overall IF expression. If the condition is false, the result of the ELSE expression becomes the result of the overall IF expression. You can nest IF expressions within an IF expression or within other expressions.
Group Comparison Expression Expressions Group Comparison Expression The group comparison expression compares a variable with a variable or constant. var1 relational operator var2 FOR count countunit -> nextaddr constant [ constant ] constant list VST0408.vsd var1 is the identifier of a variable, with or without an index, that you want to compare to var2, constant, or constant-list.
Group Comparison Expression Expressions count is a positive INT arithmetic expression that defines the number of units in var2 to compare.
Group Comparison Expression Expressions If you enclose constant in brackets ([ ]) and if the destination has a byte address or is a STRING structure pointer, the system compares a single byte regardless of the size of constant. If you do not enclose constant in brackets or if the destination has a word address or is an INT structure pointer, the system compares a word, doubleword, or quadrupleword as appropriate for the size of constant.
Group Comparison Expression Expressions Variables (including structure data items) are byte addressed or word addressed as follows: Byte addressed STRING simple variables STRING arrays Variables to which STRING simple pointers point Variables to which STRING structure pointers point Substructures Word addressed INT, INT(32), FIXED, REAL(32), or REAL(64) simple variables INT, INT(32), FIXED, REAL(32), or REAL(64) arrays Variables to which INT, INT(32), FIXED, REAL(32), or REAL(64) simple pointers point
Bit Operations Expressions 3. To compare structure or substructure occurrences, you must specify the ELEMENTS keyword in the group comparison expression: STRUCT struct_one [0:9]; BEGIN INT a[0:2]; INT b[0:7]; STRING c; END; STRUCT struct_two (struct_one) [0:9]; !Code here to assign values to structures IF struct_one = struct_two FOR 10 ELEMENTS THEN ... ; 4.
Bit Extractions Expressions Bit Extractions A bit extraction lets you access a bit field in an INT expression without altering the expression. ns ns int-expression . ns < > left-bit ns ns : ns right-bit VST0409.vsd int-expression is an INT expression (which can include STRING, INT, or UNSIGNED(1–16) values).
Bit Shifts Expressions 2. This example assigns bits <4:7> of the sum of two numbers to RESULT. The parentheses cause the numbers to be added before the bits are extracted: INT result; INT num1 := 51; INT num2 := 28; result := (num1 + num2).<4:7>; 3. This conditional expression checks bit <15> for a nonzero value: STRING var; IF var.<15> THEN ...
Usage Considerations Expressions Usage Considerations Table 4-14 lists the bit-shift operators you can specify. Table 4-14. Bit-Shift Operators Operator Function Result ‘<<‘ Unsigned left shift through bit <0> Zeros fill vacated bits from the right ‘>>’ Unsigned right shift Zeros fill vacated bits from the left. << Signed left shift through bit <0> or bit <1> Zeros fill vacated bits from the right.
Examples of Bit Shifts Expressions 3. This signed left shift shows how zeros fill the vacated bits from the right, while the sign bit remains the same (TNS systems only): Initial value = 1 011 101 010 100 000 << 1 = 1 111 010 101 000 000 4. This signed right shift shows how the sign bit fills the vacated bits from the left: Initial value = 1 111 010 101 000 000 >> 3 = 1 111 111 010 101 000 5.
Examples of Bit Shifts Expressions TAL Reference Manual—526371-001 4- 32
5 LITERALs and DEFINEs This section describes LITERAL and DEFINE declarations. A LITERAL declaration associates identifiers with constant values. A DEFINE declaration associates identifiers (and parameters if any) with text. (DEFINE declarations differ from TACL DEFINE commands, which are described in Appendix E, “File Names and TACL Commands,” in the TAL Programmer’s Guide.) You can declare LITERALs and DEFINEs once in a program, and then refer to them by identifier many times throughout the program.
Usage Considerations LITERALs and DEFINEs Usage Considerations The compiler allocates no storage for LITERAL constants. It substitutes the constant at each occurrence of the identifier. You access a LITERAL constant by using its identifier in declarations and statements. LITERAL identifiers make the source code more readable. For example, identifiers such as BUFFER_LENGTH and TABLE_SIZE are more meaningful than their respective constant values of 80 and 128. Examples of LITERAL Declarations 1.
DEFINE Declaration LITERALs and DEFINEs 3. This example specifies two of eight numeric constants; the compiler supplies the remaining constants: LITERAL d, -- The compiler assigns 0 e, -- The compiler assigns 1 f, -- The compiler assigns 2 -- The compiler assigns 1 j, -- The compiler assigns 18 k; -- The compiler assigns 19 g = 0, h, i = 17, 4.
LITERALs and DEFINEs Usage Considerations identifier is the identifier of the DEFINE. param-name is the identifier of a formal parameter. You can specify up to 31 formal parameters. An actual parameter can be up to 500 bytes long. define-body is all characters between the = and # delimiters. define-body can span multiple source lines. Enclose character strings in quotation marks (").
LITERALs and DEFINEs • Examples of DEFINE Declarations If expanded DEFINEs must produce correct TAL constructs. To list the expanded DEFINEs in the compiler listing, specify the DEFEXPAND directive before the DEFINE declarations. (For more information, see Compiler Action on page 5-7.) Note. if you use a DEFINE to name and access a structure item, the DEFINE identifier must be unique among the identifiers of all structure items in the compilation unit.
LITERALs and DEFINEs Invoking DEFINEs PROC myproc MAIN; BEGIN DEFINE myname = item1#, yrname = item2#; STRUCT mystruct; BEGIN INT item1; INT item2; INT yrname; END; !Structure item has same ! identifier as a DEFINE mystruct.myname := 1; !Okay, 1 is assigned to ! MYSTRUCT.ITEM1 mystruct.yrname := 2; !Compiler issues warning; !2 is assigned to !MYSTRUCT.YRNAME, not to !MYSTRUCT.ITEM2 !More code END; Invoking DEFINEs You invoke a DEFINE by using its identifier in a statement.
LITERALs and DEFINEs Compiler Action For example, the following declaration can invoke a DEFINE named Y but not a DEFINE named X: INT x := y; Compiler Action The compiler allocates no storage for DEFINEs. When the compiler encounters a statement that uses a DEFINE identifier, the compiler expands the DEFINE as follows: • • • It replaces the DEFINE identifier with the DEFINE body, replaces formal parameters with actual parameters, compiles the DEFINE, and emits any machine instructions needed.
LITERALs and DEFINEs Examples of Passing DEFINE Parameters If the number of actual parameters exceeds the number of formal parameters, the compiler issues an error. For example: DEFINE something (a, b, c) = anything and everything #; nothing := something (a, b, c, d); !Too many parameters You can pass a DEFINE that has no formal parameters as an actual parameter.
LITERALs and DEFINEs Examples of Passing DEFINE Parameters 3. This example fills an array with zeros: DEFINE zero_array (array, length) = BEGIN array[0] := 0; array[1] ':=' array FOR length - 1; END #; LITERAL len = 50; INT buffer[0:len - 1]; zero_array (buffer, len); !Fill buffer with zeros 4. This example displays a message, checks the condition code, and assigns an error if one occurs: INT INT INT INT INT error; file; .
LITERALs and DEFINEs Examples of Passing DEFINE Parameters TAL Reference Manual—526371-001 5- 10
6 Simple Variables A simple variable is a single-element data item of a specified data type. After you declare a simple variable, you can use its identifier in statements to access or change the data contained in the variable. You must declare variables before you use them to access data. This section defines the syntax for declaring simple variables.
Simple Variables • • Usage Considerations For a global simple variable, use a constant expression. For a local or sublocal simple variable, use any arithmetic expression including variables. You can initialize simple variables of any data type except UNSIGNED. Usage Considerations Simple variables are always directly addressed. Initializing With Numbers When you initialize with a number, it must match the data type specified for the simple variable.
Simple Variables Examples of Simple Variable Declarations 2. The following examples declare and initialize simple variables: STRING y := "A"; !Character string STRING z := 255; !Byte value INT a := "AB"; !Character string INT b := 5 * 2; !Expression INT c := %B110; !Word value INT(32) dblwd2 := %B1011101D; !Doubleword value INT(32) dblwd3 := $DBL(%177775); !Standard function REAL flt1 := 365335.6E-3; !Doubleword value REAL(64) flt2 := 2718.2818284590452L-3; !Quadrupleword value 3.
Simple Variables Examples of Simple Variable Declarations TAL Reference Manual—526371-001 6 -4
7 Arrays In TAL, an array is a one-dimensional set of elements of the same data type. Each array is stored as a collective group of elements. Once you declare an array, you can use its identifier to access the array elements individually or as a group. This section defines the syntax for declaring arrays.
Arrays Array Declaration type identifier [ lowerbound : upperbound . .EXT ; ] := initialization , VST0701.vsd type is any data type described in Section 3, Data Representation. . (a period) is the standard indirection symbol and denotes 16-bit indirect addressing. An absence of any indirection symbol (. or .EXT) denotes 16-bit direct addressing. Do not use an indirection symbol with sublocal or UNSIGNED arrays. .EXT is the extended indirection symbol and denotes 32-bit indirect addressing.
Arrays Usage Considerations elements, the values of uninitialized elements are undefined. You cannot initialize extended indirect local arrays or UNSIGNED arrays. Specify initialization values that are appropriate for the data type of the array. For example, if the decimal setting of an initialization value differs from the fpoint of a FIXED array, the system scales the initialization value to match the fpoint. If the initialization value is scaled down, some precision is lost.
Arrays Examples of Array Declarations 3. These examples declare and initialize arrays using constant lists: INT .c_array[0:5] := [1,2,3,4,5,6]; !Constant list STRING .buffer[0:102] := [ "A constant list can consist ", "of several character string constants, ", "one to a line, separated by commas." ]; INT(32) .mixed[0:3] := ["abcd", 1D, %B0101011D, %20D]; !Mixed constant list LITERAL len = 80; !Length of array STRING .buffer[0:len - 1] := len * [" "]; !Repetition factor FIXED .
Arrays Read-Only Array Declaration Read-Only Array Declaration A read-only array declaration allocates storage for a nonmodifiable array in a user code segment. Read-only arrays are sometimes referred to as P-relative arrays, because they are addressed using the program counter (the P register). type = identifier [ 'p' := lowerbound initialization upperbound : ] ; , VST0702.vsd type is any data type except UNSIGNED. identifier is the identifier of the read-only array.
Arrays Usage Considerations FIXED array, the system scales the initialization value to match the fpoint. If the initialization value is scaled down, some precision is lost. Usage Considerations Because code segments have no primary or secondary areas, read-only arrays must be direct. If you declare an indirect read-only array, the compiler ignores the indirection symbol and issues warning 37 (array access changed from indirect to direct). You must initialize read-only arrays.
8 Structures A structure is a collectively stored set of data items that you can access individually or as a group. Structures contain structure items (fields) such as simple variables, arrays, simple pointers, structure pointers, and nested structures (called substructures). The structure items can be of different data types. Structures usually contain related data items such as the fields of a file record.
Structures Structure Layout Structure Layout The structure layout (or body) is a BEGIN-END construct that contains declarations of structure items. Table 8-2 lists structure items. Table 8-2.
Structures Definition Structure Declaration Definition Structure Declaration A definition structure declaration describes a structure layout and allocates storage for it. STRUCT identifier . .EXT ; [ lower bound : upper bound structurelayout ; ] VST0801.vsd . (a period) is the standard indirection symbol and denotes 16-bit indirect addressing. An absence of any indirection symbol (. or .EXT) denotes 16-bit direct addressing. Do not use an indirection symbol with sublocal structures. .
Structures Usage Considerations structure-layout is a BEGIN-END construct that can contain declarations for simple variables, arrays, substructures, filler bits, filler bytes, redefinitions, simple pointers, and structure pointers. The size of one occurrence of the structure is the size of the layout. A single structure occurrence must not exceed 32,767 bytes. Usage Considerations Structures declared in subprocedures must be directly addressed.
Structures Template Structure Declaration Template Structure Declaration A template structure declaration describes a structure layout but allocates no space for it. You use the template layout in subsequent structure, substructure, or structure pointer declarations. STRUCT ( identifier * ) ; structurelayout ; VST0802.vsd identifier is the identifier of the template structure, with no indirection symbol. (*) is the symbol for a template structure.
Structures Referral Structure Declaration Referral Structure Declaration A referral structure declaration allocates storage for a structure whose layout is the same as the layout of a previously declared structure or structure pointer. STRUCT ( identifier ) referral . .EXT ; [ lower bound : upper bound ] VST0803.vsd . (a period) is the standard indirection symbol and denotes 16-bit indirect addressing. An absence of any indirection symbol (. or .EXT) denotes 16-bit direct addressing.
Structures Usage Considerations occurrence you want to allocate. The default value is 0. For a single-occurrence structure, omit both bounds or specify the same value for both bounds. Usage Considerations The compiler allocates storage for the referral structure based on the following characteristics: • • The addressing mode and number of occurrences specified in the new declaration The layout of the previous declaration Structures declared in subprocedures must be directly addressed.
Structures Usage Considerations type is any data type described in Section 3, Data Representation. identifier is the identifier of the simple variable. Usage Considerations You cannot initialize a simple variable when you declare it inside a structure. You can subsequently assign a value to the simple variable by using an assignment statement. Example of Simple Variables in Structures This example declares simple variables in a structure: STRUCT .
Structures Usage Considerations upper-bound is an INT constant expression (in the range –32,768 through 32,767) that specifies the index (relative to the zeroth array element) of the last array element you want allocated. Both lower and upper bounds are required. Usage Considerations When you declare arrays inside a structure, the following guidelines apply: • • • You cannot initialize arrays declared in structures. You can assign values to such arrays only by using assignment statements.
Structures Definition Substructure Declaration Definition Substructure Declaration A definition substructure describes a layout and allocates storage for it. STRUCT identifier [ lowerbound upperbound : ; ] substructurelayout ; VST0806.vsd identifier is the identifier of the definition substructure.
Structures Example of Definition Substructure Declaration Example of Definition Substructure Declaration This example declares two occurrences of a structure, each of which contains 50 occurrences of a definition substructure: STRUCT .
Structures Example of Referral Substructure Declaration upper-bound is an INT constant expression (in the range –32,768 through 32,767) that specifies the index (relative to the zeroth occurrence) of the last substructure occurrence you want allocated. The default value is 0. For a single-occurrence substructure, omit both bounds or specify the same value for both bounds.
Structures Usage Considerations Usage Considerations You can declare filler bits and filler bytes, but you cannot access such filler locations. If the structure layout must match a structure layout defined in another program, your structure declaration need only include data items used by your program and can use filler bits or bytes for the unused space. You can also use filler bytes to document compiler-allocated alignment pad bytes (described in the TAL Programmer’s Guide).
Structures Usage Considerations type is any data type except UNSIGNED. The data type determines how much data the simple pointer can access at a time—a byte, word, doubleword, or quadrupleword. . (period) is the standard indirection symbol and denotes a standard (16-bit) pointer. .EXT is the extended indirection symbol and denotes an extended (32-bit) pointer. identifier is the identifier of the simple pointer.
Structures Example of Simple Pointer Declarations Table 8-4. Addresses in Simple Pointers Addressing Mode Data Type Kind of Addresses Standard Any except STRING 16-bit word address in the user data segment. Extended STRING 32-bit byte address, normally in the automatic extended data segment. Extended Any except STRING 32-bit even-byte address, normally in the automatic extended data segment. (If you specify an odd-byte address, results are undefined.
Structures Usage Considerations . (period) is the standard indirection symbol and denotes a standard (16-bit) pointer. .EXT is the extended indirection symbol and denotes an extended (32-bit) pointer. identifier is the identifier of the structure pointer. referral is the identifier of a structure that provides the structure layout. You can specify any previously declared structure (including the encompassing structure) or structure pointer.
Structures Example of Structure Pointer Declaration Before you reference a pointer declared in a structure, be sure to assign an address to it by using an assignment statement, as described in Section 8, “Using Structures,” in the TAL Programmer’s Guide. Example of Structure Pointer Declaration This example shows a structure pointer declaration within a structure: STRUCT struct_a; !Declare STRUCT_A BEGIN INT a; INT b; END; STRUCT struct_b; !Declare STRUCT_B BEGIN INT .
Structures Simple Variable Redefinition Simple Variable Redefinition A simple variable redefinition associates a new simple variable with a previous item at the same BEGIN-END level of a structure. type = identifier previous-identifier ; VST0811.vsd type is any data type except UNSIGNED. identifier is the identifier of the new simple variable. previous-identifier is the identifier of a simple variable, array, substructure, or pointer previously declared in the same structure.
Structures Array Redefinition Array Redefinition An array redefinition associates a new array with a previous item at the same BEGINEND level of a structure. type identifier [ lowerbound upperbound : = ] previousidentifier ; VST0812.vsd type is any data type except UNSIGNED. identifier is the identifier of the new array.
Structures Example of Array Redefinition Example of Array Redefinition This declaration redefines an INT array as an INT(32) array: STRUCT .s; BEGIN INT a[0:3]; INT(32) b[0:1] = a; END; !Redefinition Definition Substructure Redefinition A definition substructure redefinition associates a new definition substructure with a previous item at the same BEGIN-END level of a structure. STRUCT identifier [ = lowerbound previousidentifier upperbound : ; ] substructurelayout ; VST0813.
Structures Usage Considerations substructure-layout is the same BEGIN-END construct as for structures. It can contain declarations for simple variables, arrays, substructures, filler bits, filler bytes, redefinitions, simple pointers, and structure pointers. The size of one substructure occurrence is the size of the layout, either in odd or even bytes. The total layout for one occurrence of the encompassing structure must not exceed 32,767 bytes.
Structures Referral Substructure Redefinition Referral Substructure Redefinition A referral substructure redefinition associates a new referral substructure with a previous item at the same BEGIN-END level of a structure. STRUCT ( identifier ) referral = [ lowerbound : upperbound previousidentifier ; ] VST0814.vsd identifier is the identifier of the new substructure. referral is the identifier of a structure that provides the structure layout.
Structures Example of Referral Substructure Declaration Example of Referral Substructure Declaration This example declares a referral substructure redefinition that uses a template structure layout: STRUCT temp(*); BEGIN STRING a[0:2]; INT b; STRING c; END; !Declare template structure STRUCT .
Structures Example of Simple Pointer Redefinition Example of Simple Pointer Redefinition This example declares new simple pointer EXT_POINTER to redefine simple variable VAR: STRUCT my_struct; BEGIN STRING var[0:5]; STRING .EXT ext_pointer = var; END; !Redefinition Structure Pointer Redefinition A structure pointer redefinition associates a new structure pointer with a previous item at the same BEGIN-END level of a structure. STRING . INT .
Structures Usage Considerations referral is the identifier of a structure that provides the structure layout. You can specify any previously declared structure (including the encompassing structure) or structure pointer. previous-identifier is the identifier of a simple variable, array, substructure, or pointer previously declared in the same structure. No index is allowed with this identifier.
Structures Example of Structure Pointer Redefinitions TAL Reference Manual—526371-001 8- 26
9 Pointers This section describes the syntax for declaring and initializing pointers you manage yourself. You can declare the following kinds of pointers: • • Simple pointer—a variable into which you store a memory address, usually of a simple variable or array, which you can access with this simple pointer. Structure pointer—a variable into which you store the memory address of a structure which you can access with this structure pointer.
Pointers Simple Pointer Declaration Simple Pointer Declaration A simple pointer declaration associates an identifier with a memory location that contains the user-initialized address of a simple variable or array. type identifier . ; .EXT := initialization , VST0901.vsd type is any data type except UNSIGNED. The data type determines how much data the simple pointer can access at one time—byte, word, doubleword, or quadrupleword. .
Pointers Usage Considerations Table 9-1. Data Accessed by Simple Pointers Data Type Accessed Data STRING Byte INT Word INT (32) Doubleword REAL Doubleword REAL (64) Quadrupleword FIXED Quadrupleword Simple Pointer Initializations The addressing mode and data type of the simple pointer determines the kind of address the pointer can contain, as described in Table 9-2. Table 9-2.
Pointers Examples of Simple Pointer Declarations Expression Meaning @identifier ‘ >>’1 Converts byte address to word address @identifier[index] Accesses address of variable indicated by index Standard function Any that return a constant value, such as $OFFSET The following table shows the kinds of global variables to which you can apply the @ operator: Variable @identifier? Direct array Yes Standard indirect array Yes Extended indirect array No Direct structure Yes Standard indirect stru
Pointers Structure Pointer Declaration 3. This example declares a STRING simple pointer and initializes it with the converted byte address of an INT array. This allows byte access to the wordaddressed array: INT .a[0:39]; !Declare INT array STRING .ptr := @a[0] '<<' 1; !Declare STRING simple !pointer initialized with !byte address of A[0] 4.
Pointers Usage Considerations STRING is the STRING attribute. INT is the INT attribute. . (period) is the standard indirection symbol and denotes a standard (16-bit) pointer. .EXT is the extended indirection symbol and denotes an extended (32-bit) pointer. identifier is the identifier of the structure pointer. referral is the identifier of a previously declared structure or structure pointer that provides the structure layout for this structure pointer.
Pointers Examples of Structure Pointer Declarations Table 9-3.
Pointers Examples of Structure Pointer Declarations STRUCT .st; BEGIN INT j; STRUCT ss (t); END; !Definition structure INT .ip := @st '+' $OFFSET (st.j) '>>' 1; !Simple pointer INT .stp (t) := @st '+' $OFFSET (st.ss) '>>' 1; !INT structure pointer STRING .sstp (t) := @st '<<' 1 '+' $OFFSET (st.ss); !STRING structure pointer 2.
Pointers Examples of Structure Pointer Declarations 4. This example initializes a local or sublocal STRING structure pointer with the address of a substructure: STRUCT name_def(*); BEGIN STRING first[0:3]; STRING last[0:3]; END; STRUCT .record; BEGIN STRUCT name (name_def); INT age; END; !Declare substructure STRING .my_name (name_def) := @record.name; !Structure pointer contains !address of substructure my_name ':=' ["Sue Law"]; 5.
Pointers Examples of Structure Pointer Declarations TAL Reference Manual—526371-001 9- 10
10 Equivalenced Variables Equivalencing lets you declare more than one identifier and description for a location in a primary storage area. Equivalenced variables that represent the same location can have different data types and byte-addressing and word-addressing attributes. You can, for example, reference an INT(32) variable as two separate words or four separate bytes.
Equivalenced Variables Equivalenced Simple Variable Equivalenced Simple Variable An equivalenced simple variable declaration associates a new simple variable with a previously declared variable. type identifier = previous-identifier ; [ index + offset ] , VST1001.vsd type is any data type except UNSIGNED. identifier is the identifier of a simple variable to be made equivalent to previous-identifier.
Equivalenced Variables Examples of Equivalenced Simple Variable Declarations For portability to future software platforms, declare equivalenced variables that fit entirely within the previous variable. Examples of Equivalenced Simple Variable Declarations 1. This example equivalences a STRING variable and an INT(32) variable to an INT array: INT w[0:1]; STRING b = w[0]; INT(32) d = b; W[0] B[0] B[1] W[1] B[2] B[3] D VST1002.vsd 2. This example equivalences a simple variable to a simple pointer.
Equivalenced Variables Usage Consideration type is any data type except UNSIGNED. The data type determines how much data the simple pointer can access at a time (byte, word, doubleword, or quadrupleword). . (period) is the standard indirection symbol and denotes a standard (16-bit) pointer. .EXT is the extended indirection symbol and denotes an extended (32-bit) pointer. identifier is the identifier of a simple pointer to be made equivalent to previous-identifier.
Equivalenced Variables Example of Equivalenced Simple Pointer Declaration Example of Equivalenced Simple Pointer Declaration This example declares an INT(32) simple pointer equivalent to an INT simple pointer. Both contain a word address: PTR2 = 200 PTR1 = 200 INT .ptr1 := 200; INT(32) .ptr2 = ptr1; . . . G[200] VST1005.vsd Equivalenced Definition Structure An equivalenced definition structure declaration associates a new structure with a previously declared variable.
Equivalenced Variables Usage Considerations previous-identifier is the identifier of a previously declared simple variable, array, simple pointer, structure, structure pointer, or equivalenced variable. index is an INT constant that specifies an element offset from previous-identifier, which must be a direct variable. The data type of previous-identifier dictates the element size. The location represented by index must begin on a word boundary.
Equivalenced Variables Example of Equivalenced Definition Structure Declaration Example of Equivalenced Definition Structure Declaration The following example declares an extended indirect definition structure equivalent to a previously declared extended indirect structure: STRUCT .EXT xstr1; BEGIN STRING old_name[0:20]; STRING old_addr[0:50]; END; Primary area of user data segment ptr to XSTR1 ptr to XSTR2 XSTR1 XSTR2 . . . . . . STRUCT .
Equivalenced Variables Usage Considerations identifier is the identifier of a referral structure to be made equivalent to previous-identifier. referral is the identifier of a previously declared structure or structure pointer that provides the structure layout for identifier. previous-identifier is the identifier of a previously declared simple variable, array, simple pointer, structure, structure pointer, or equivalenced variable.
Equivalenced Variables Example of Equivalenced Referral Structure Declaration Example of Equivalenced Referral Structure Declaration The following example declares a referral structure equivalent to a previously declared definition structure: STRUCT .d_str; BEGIN STRING name[0:19]; STRING address [0:49]; END; ptr to D_STR D_STR R_STR STRUCT tmp (*); BEGIN INT name[0:9]; INT address[0:24]; END; STRUCT .r_str (tmp) = d_str; . . . . . . ptr to R_STR . . . Secondary area VST1009.
Equivalenced Variables Usage Considerations . (period) is the standard indirection symbol and denotes a standard (16-bit) pointer. .EXT is the extended indirection symbol and denotes an extended (32-bit) pointer. identifier is the identifier of a structure pointer to be made equivalent to previous-identifier. referral is the identifier of a previously declared structure or structure pointer that provides the structure layout for identifier.
Equivalenced Variables Example of Equivalenced Structure Pointer Declaration For portability to future software platforms, declare equivalenced variables that fit entirely within the previous variable. Example of Equivalenced Structure Pointer Declaration The following example declares structure pointers equivalent to another structure pointer and to an indirect structure: Primary area of user data segment STRUCT temp (*); BEGIN STRING S[0:71]; END; STRUCT .
Equivalenced Variables Base-Address Equivalenced Simple Variable Base-Address Equivalenced Simple Variable A base-address equivalenced simple variable declaration associates a new simple variable with a global, local, or top-of-stack base address. = identifier type base-address ; [ index + offset ] , VST1012.vsd type is any data type except UNSIGNED. variable is the identifier of a simple variable to be made equivalent to base-address.
Equivalenced Variables Example of Base-Address Equivalenced Simple Variable Declaration Example of Base-Address Equivalenced Simple Variable Declaration The following example declares an INT simple variable equivalent to an 'L'-relative base address: INT var1 = 'L'[5]; INT(32) var2 = 'G'[10]; Base-Address Equivalenced Simple Pointer A base-address equivalenced simple pointer declaration associates a new simple pointer with a global, local, or top-of-stack base address. type = identifier .
Equivalenced Variables Usage Considerations base-address is one of the following base address symbols: 'G' Denotes global addressing relative to G[0] 'L' Denotes local addressing relative to L[0] 'S' Denotes top-of-stack addressing relative to S[0] index and offset are equivalent INT values giving a location in the following ranges: 0 through 255 For 'G' addressing –255 through 127 For 'L' addressing –31 through 0 For 'S' addressing Usage Considerations The data type determines how much data
Equivalenced Variables Usage Considerations . (period) is the standard indirection symbol and denotes 16-bit indirect addressing. An absence of any indirection symbol (. or .EXT) denotes 16-bit direct addressing. .EXT is the extended indirection symbol and denotes 32-bit indirect addressing. An absence of any indirection symbol (. or .EXT) denotes 16-bit direct addressing. identifier is the identifier of a definition structure to be made equivalent to base-address.
Equivalenced Variables Base-Address Equivalenced Referral Structure Base-Address Equivalenced Referral Structure A base-address equivalenced referral structure declaration associates a new structure with a global, local, or top-of-stack base address. identifier STRUCT ( referral ) . .EXT = ; base-address [ index + offset ] - VST1015.vsd . (period) is the standard indirection symbol and denotes 16-bit indirect addressing. An absence of any indirection symbol (. or .
Equivalenced Variables Usage Considerations index and offset are equivalent INT values giving a location in the following ranges: 0 through 255 For 'G' addressing –255 through 127 For 'L' addressing –31 through 0 For 'S' addressing Usage Considerations If you use the CRE, locations G[0] and G[1] are not available for your data. References to 'G', 'L', or 'S' are not portable to future software platforms.
Equivalenced Variables Usage Considerations identifier is the identifier of a structure pointer to be made equivalent to base-address. referral is the identifier of a previously declared structure or structure pointer that provides the structure layout for identifier.
11 NAMEs and BLOCKs Your input to a compilation session is a single source file. The source file contains declarations, statements, and compiler directives that you can compile into an object file. The source file and any other source code that is read in by SOURCE directives together compose a compilation unit. The output from a compilation session is an executable or bindable object file that consists of relocatable code and data blocks.
NAMEs and BLOCKs Usage Considerations Usage Considerations A compilation unit that contains a NAME declaration as its first declaration is called a named compilation unit. If the compilation unit contains no BLOCK declarations, the NAME declaration is optional. If a compilation unit contains a BLOCK declaration, the NAME declaration must be the first declaration in the compilation unit. NAME is a reserved keyword only within the first declaration; you can use the term NAME elsewhere as an identifier.
NAMEs and BLOCKs Usage Considerations PRIVATE specifies a private global data block, which is accessible within the current compilation unit only. AT (0) directs Binder to locate the block at location G[0]. (If you specify this option and run your program in the CRE, conflicts could arise.) BELOW (64) directs Binder to locate the block below location G[64]. BELOW (256) directs Binder to locate the block below location G[256].
NAMEs and BLOCKs • ° ° ° Examples of BLOCK Declarations Share data with compilation units written in other languages Run your program in the CRE Use 0D as nil for pointers Some of the AT and BELOW clauses are not portable to future software platforms. Efficient Code For extended pointers declared within BLOCK declarations that specify AT (0) or BELOW (64), the compiler generates efficient code using the XX instructions (LWXX, SWXX, LBXX, and SBXX).
NAMEs and BLOCKs Coding Data Blocks Coding Data Blocks Here are guidelines for coding global data blocks: • Place global declarations, if present, in the following order within a compilation unit: 1. NAME declaration 2. Unblocked global data declarations 3. BLOCK declarations (named or private) 4. PROC declarations • • • Make sure that the target file contains no more than a total of 256 words of primary global blocks.
NAMEs and BLOCKs Unblocked Declarations TAL Reference Manual—526371-001 11- 6
12 Statements Statements—also known as executable statements—perform operations in a program. They can modify the program’s data or control the program’s flow. Table 12-1 summarizes statements. Table 12-1.
Statements • • Compound Statements A semicolon must not immediately precede an ELSE or UNTIL keyword. A semicolon alone in place of a statement creates a null statement. The compiler generates no code for null statements. You can use a null statement wherever you can use a statement except immediately before an ELSE or UNTIL keyword. Compound Statements A compound statement is a BEGIN-END construct that groups statements to form a single logical statement. BEGIN END statement ; ; VST1201.
Statements ASSERT Statement 2. This example shows a compound statement BEGIN a := b + c; d := %B101; f := d - e; END; ASSERT Statement The ASSERT statement conditionally invokes the procedure specified in an ASSERTION directive. ASSERT assert-level : condition VST1202.vsd assert-level is an integer in the range 0 through 32,767.
Statements Example of ASSERT Statement 3. During program execution, if an assert-level is equal to or higher than the current assertion-level and the associated condition is true, the compiler invokes the errorhandling procedure. 4.
Statements Usage Considerations variable is the identifier of a simple variable, array element, simple pointer, structure pointer, or structure data item, with or without a bit deposit field and/or index. To update a pointer’s content, prefix the pointer identifier with @.
Statements Examples of Assignment Statements Examples of Assignment Statements 1. This example shows various assignment statements: INT array[0:2]; INT .ptr; REAL real_var; FIXED fixed_var; array[2] := 255; @ptr := @array[1]; !Declare an array !Declare a simple pointer !Declare a REAL variable !Declare a FIXED variable !Assign a value to ARRAY[2] !Assign address of ARRAY[1] !to PTR ptr := array[2]; !Assign value of ARRAY[2] !to ARRAY[1], to which PTR !points real_var := 36.
Statements Bit-Deposit Assignment Statement Bit-Deposit Assignment Statement The bit deposit form of the assignment statement lets you assign a value to an individual bit or to a group of sequential bits. ns variable ns := . ns < left-bit > ns ns : ns right-bit := expression VST1204.vsd variable is the identifier of a STRING or INT variable, but not an UNSIGNED(1–16) variable.
Statements Examples of Bit Deposit Assignments Specify the variable/bit-field construct with no intervening spaces. For example: myvar.<0:5> Do not use bit deposit fields to pack data. Instead, declare an UNSIGNED variable and specify the appropriate number of bits in the bit field. Bit deposits are not portable to future software platforms. Where possible, isolate bit deposits in a routine that can be modified in the future. Examples of Bit Deposit Assignments 1.
Statements CALL Statement CALL Statement The CALL statement invokes a procedure, subprocedure, or entry-point identifier, and optionally passes parameters to it. identifier ( CALL ) param param-pair , VST1205.vsd identifier is the identifier of a previously declared procedure, subprocedure, or entry-point identifier. param is a variable identifier or an expression that defines an actual parameter to pass to a formal parameter declared in identifier.
Statements Usage Considerations Usage Considerations To invoke procedures and subprocedures (but usually not functions), use the CALL statement. To invoke functions, you usually use their identifiers in expressions. If you invoke a function by using a CALL statement, the caller ignores the returned value of the function.
Statements CASE Statement 4. This example omits all parameters: CALL extensible_proc ( ); 5. These examples omit some optional parameters: CALL variable_proc( , , , , , x); CALL variable_proc (n, , char, , , eof); CALL variable_proc (n, !name!, char, !type!, !size!, eof); CASE Statement The CASE statement executes a choice of statements based on a selector value. Normally, you use labeled CASE statements. Labeled CASE statements are described first, followed by unlabeled CASE statements.
Statements Usage Considerations -> case-label lower-caselabel .. uppercase-label statement ; , VST1208.vsd case-label is a signed INT constant or LITERAL. Each case-label must be unique in the CASE statement. lower-case-label is the smallest value in an inclusive range of signed INT constants or LITERALs. upper-case-label is the largest value in an inclusive range of signed INT constants or LITERALs. statement is any statement described in this section.
Statements Unlabeled CASE Statement 213, 818 -> location := los_angeles; 808 -> location := hawaii; OTHERWISE -> location := elsewhere; END; END; !End CASE statement !End AREA_PROC Unlabeled CASE Statement The unlabeled CASE statement executes a choice of statements, based on an inclusive range of implicit selector values, from 0 through n, with one statement for each value. CASE selector OF ; BEGIN statement END ; OTHERWISE statement VST1209.
Statements Examples of Unlabeled CASE Statements selector is 4, the fifth statement executes. Conversely, if the selector does not match a compiler-assigned number, the OTHERWISE statement, if any, executes. For unlabeled CASE statements, the compiler always generates the branch table form (described in “Labeled CASE Statement” in the TAL Programmer’s Guide).
Statements CODE Statement CASE selector OF BEGIN !Move statements !0! a_array ':=' "Training Program"; !1! a_array ':=' "End of Program"; !2! a_array ':=' "Input Error"; !3! a_array ':=' "Home Terminal Now Open"; OTHERWISE a_array ':=' "Bad Message Number"; END; !End of CASE statement END; !End of procedure CODE Statement The CODE statement enables you to specify machine-level instructions and pseudocodes to compile into the object code. ( CODE ) instruction ; VST1210.
Statements Usage Considerations mnemonic is either an instruction code or a pseudocode. . (period) is the dereferencing operator, which converts the value of identifier into the standard word address of another data item. @ removes indirection. If identifier is a pointer, @ accesses the address contained in the pointer. Otherwise, @ accesses the address of identifier. identifier is the identifier of a procedure or label: • • For a PCAL or XCAL instruction, it is a procedure.
Statements Usage Considerations Pseudocodes You can use pseudocodes and instruction codes as CODE statement mnemonics. The form numbers in the following descriptions correlate to form numbers shown in the CODE statement instruction form diagrams: ACON A form 3 mnemonic that emits the value specified in constant. constant is the absolute run-time code address associated with the label in the next instruction location.
Statements Examples of CODE Statements FOR Statements and CODE Statements If you use a CODE statement to make a conditional jump from an optimized FOR loop, the compiler emits warning 78 (TAL cannot set the RP value for the forward branch). To set the RP value for the jump condition, use a CODE (STRP ...) statement or an RP directive. The compiler can generate correct code only for the nonjump condition. Examples of CODE Statements 1.
Statements DO Statement DO Statement The DO statement is a posttest loop that repeatedly executes a statement until a specified condition becomes true. UNTIL DO statement condition VST1212.vsd statement is any statement described in this section. condition is either: • • A conditional expression An INT arithmetic expression. If the result of the arithmetic expression is not 0, condition is true. If the result is 0, condition is false. If condition is false, the DO loop continues to execute.
Statements DROP Statement 2. This DO statement loops through ARRAY_A, assigning a 0 to each element until all the elements contain a 0: LITERAL limit = 9; INT index := 0; STRING .
Statements Examples of DROP Statements Dropping Registers You reserve index registers by issuing USE statements. When you no longer need a reserved index register, drop (RVU) it by issuing a DROP statement. After you drop an index register, do not use its identifier without issuing a new USE statement and assigning a value to it. If you do not drop all reserved index registers, the compiler automatically drops them when the procedure or subprocedure completes execution.
Statements FOR Statement FOR Statement The FOR statement is a pretest loop that repeatedly executes a statement while incrementing or decrementing an index automatically. The loop terminates when the index reaches a set value. FOR index := initial-value TO limit DOWNTO DO BY step statement VST1214.vsd index is a value that increments or decrements automatically until it reaches limit and terminates the loop.
Statements Usage Considerations Usage Considerations The FOR statement tests index at the beginning of each iteration of the loop. If index passes limit on the first test, the loop never executes. You can nest FOR loops to any level. FOR statement execution is shown in the TAL Programmer’s Guide. Standard FOR Loops For index, standard FOR loops specify an INT variable. Standard FOR loops execute as follows: • • When the looping terminates, index is greater than limit if: ° ° ° The step value is 1.
Statements Examples of FOR Statements Inclusion of procedure calls in the FOR loop slows down the loop because the compiler must emit code to save and restore registers before and after each CALL statement. The following operations are not portable to future software platforms: • • Using a CODE statement to conditionally jump out of an optimized FOR loop. The compiler generates correct code only for the nonjump condition. Jumping into an optimized FOR loop. Examples of FOR Statements 1.
Statements GOTO Statement GOTO Statement The GOTO statement unconditionally transfers program control to a statement that is preceded by a label. GOTO label-name VST1215.vsd label-name is the identifier of a label that is associated with a statement. It cannot be an entrypoint identifier. Usage Considerations A local GOTO statement can refer only to a local label in the same procedure. A local GOTO statement cannot refer to a label in a subprocedure or in any other procedure.
Statements IF Statement GOTO a; END; !Sublocal branch to local label a : i := 0; !More code END; !Place label at local statement IF Statement The IF statement conditionally selects one of two statements. IF condition THEN statement ELSE statement VST1216.vsd condition is either: • • A conditional expression An INT arithmetic expression. If the result of the arithmetic expression is not 0, condition is true. If the result is 0, condition is false.
Statements Example of IF Statements For more information on the IF statement execution and IF-ELSE pairing, see Section 12, “Controlling Program Flow,” in the TAL Programmer’s Guide. Example of IF Statements This example compares two arrays: INT .new_array[0:9]; INT .old_array[0:9]; INT item_ok; IF new_array = old_array FOR 10 WORDS THEN item_ok := 1 ELSE item_ok := 0; MOVE Statement The move statement copies contiguous bytes, words, or elements to a new location.
Statements MOVE Statement source is the identifier, with or without an index, of the variable from which the copy operation begins. It can be a simple variable, array, read-only array, simple pointer, structure, structure data item, or structure pointer. count is an unsigned INT arithmetic expression that defines the number of units in source to copy.
Statements Usage Considerations If count-unit is not BYTES, WORDS, or ELEMENTS, the compiler issues an error. If you specify BYTES, WORDS, or ELEMENTS for count-unit, that term cannot also appear as a DEFINE or LITERAL identifier in the global declarations or in any procedure or subprocedure in which the move statement appears. constant is a numeric constant, a character string constant, or a LITERAL to copy.
Statements Examples of MOVE Statements Variables (including structure data items) are byte addressed or word addressed as follows: Byte addressed STRING simple variables STRING arrays Variables to which STRING simple pointers point Variables to which STRING structure pointers point Substructures Word addressed INT, INT(32), FIXED, REAL(32), or REAL(64) simple variables INT, INT(32), FIXED, REAL(32), or REAL(64) arrays Variables to which INT, INT(32), FIXED, REAL(32), or REAL(64) simple pointers point
Statements RETURN Statement 3. This example copies three occurrences of one structure to another: LITERAL copies = 3; !Number of occurrences STRUCT .s[0:copies - 1]; BEGIN INT a, b, c; END; !Source structure STRUCT .d (s) [0:copies - 1]; !Destination structure PROC p; BEGIN d ':=' s FOR copies ELEMENTS;!Word move of three END; ! structure occurrences 4. This example copies three occurrences of a substructure: LITERAL copies = 3; !Number of occurrences STRUCT .
Statements Usage Considerations cc-expression is an INT expression whose numeric value specifies the condition code value to return to the caller. If cc-expression is: Less than 0 Set the condition code to less than (<) Equal to 0 Set the condition code to equal (=) Greater than 0 Set the condition code to greater than (>) result-expression is an arithmetic or conditional expression that a function must return to the caller.
Statements Examples of RETURN Statements Examples of RETURN Statements 1. This function contains two RETURN statements nested in an IF statement: INT PROC other (nuff, more); INT nuff; INT more; BEGIN IF nuff < more THEN RETURN nuff * more ELSE RETURN 0; END; !Declare function with ! return type INT !IF statement !Return a value !Return a different value 2.
Statements SCAN Statement 5. If you call a function, rather than invoking it in an expression, you can test the returned condition code: INT PROC p1 (i); INT i; BEGIN RETURN i; END; INT PROC p2 (i); INT i; BEGIN INT j := i + 1; RETURN i, j; END; CALL IF < CALL IF < p1 (i); THEN ... ; p2 (i); THEN ... ; !Test the condition code !Test the condition code SCAN Statement The SCAN or RSCAN statement searches a scan area for a test character from left to right or from right to left, respectively.
Statements Usage Considerations • • • The variable can be a simple variable, array, read-only array, simple pointer, structure pointer, structure, or structure data item. The variable can be of any data type but UNSIGNED. The variable must be located either: ° ° • In the lower 32K-word area of the user data segment. In the same 32K-word area of the current code segment as the procedure that accesses the variable. The variable cannot have extended indirection.
Statements Example of SCAN Statements character did not occur. If $CARRY is true after SCAN WHILE, a character other than the test character did not occur. Here are examples for using $CARRY: IF $CARRY THEN ... ; IF NOT $CARRY THEN ... ; !If test character not found !If test character found To determine the number of multibyte elements processed, divide (next-addr '–' byte address of identifier) by the number of bytes per element, using unsigned arithmetic.
Statements Examples of STACK Statements track of the size and data type of stacked values. It loads byte values in bits <8:15> and a 0 in bits <0:7>. Modularize any use of STACK statements as much as possible; they are not portable to future software platforms. Examples of STACK Statements This example loads values of various data types onto the register stack: 0 STRING .
Statements Examples of STORE Statements Modularize any use of STORE statements as much as possible; they are not portable to future software platforms. Examples of STORE Statements 1. This example stores the content of the register stack starting at the current setting of the RP into variables of various data types: LITERAL len = 100; STRING .byte[0:len - 1]; INT word; INT(32) twowords; STORE twowords, word, byte[3]; 2.
Statements Usage Considerations Usage Considerations The compiler associates each identifier specified in a USE statement with an index register starting with R[7] down to R[5]. Thus, you can use at most three reserved registers at a time. Statements that appear between a USE statement and a corresponding DROP statement or the end of the procedure or subprocedure can access the reserved index register.
Statements WHILE Statement LITERAL len = 100; INT .array [0:len - 1]; INT i; FOR i := 0 TO len - 1 DO array[i] := array[i] + 5; !Standard FOR loop USE x; FOR x := 0 to len - 1 DO array[x] := array[x] + 5; !Optimized FOR loop uses ! an index register DROP x; !Release the register WHILE Statement The WHILE statement is a pretest loop that repeatedly executes a statement while a specified condition is true. WHILE condition DO statement VST1223.
Statements Examples of WHILE Statements Examples of WHILE Statements 1. This WHILE loop continues while ITEM is less than LEN: LITERAL len = 100; INT .array[0:len - 1]; INT item := 0; WHILE item < len DO !WHILE statement BEGIN array[item] := 0; item := item + 1; END; !ITEM equals LEN at this point 2. This WHILE loop increments INDEX until a nonalphabetic character occurs: LITERAL len = 255; STRING .array[0:len - 1]; INT index := -1; WHILE (index < len - 1) AND ($ALPHA(array[index := index + 1])) DO . . .
Statements Examples of WHILE Statements TAL Reference Manual—526371-001 12 -42
13 Procedures Procedures are program units that contain the executable portions of a TAL program and that are callable from anywhere in the program. Procedures allow you to segment a program into discrete parts that each perform a particular task such as I/O or error handling. An executable program contains at least one procedure. One procedure in the program has the attribute MAIN, which identifies it as the first procedure to execute when you run the program.
Procedures Procedure Declaration Procedure Declaration A procedure is a program unit that is callable from anywhere in the program. You declare a procedure as follows: PROC identifier type public-name-spec parameter-list proc-attribute , ; proc-body param-spec ; ; EXTERNAL FORW ARD VST1301.vsd type specifies that the procedure is a function that returns a result and indicates the data type of the returned result. type can be any data type described in Section 3, Data Representation.
Procedures Procedure Declaration parameter-list has the form: ( ) param-name param-pair , VST1303.vsd param-name is the identifier of a formal parameter. A procedure can have up to 32 formal parameters, with no limit on the number of words of parameters. param-pair is a pair of formal parameter identifiers that comprises of a languageindependent string descriptor in the form: string : length VST1304.vsd string is the identifier of a standard or extended STRING simple pointer.
Procedures Usage Considerations proc-body is a BEGIN-END construct that contains local declarations and statements, as described in Procedure Body on page 13-13. FORWARD specifies that the procedure body is declared later in the source file. EXTERNAL specifies that the procedure body is declared in another compilation unit.
Procedures Procedure Attributes Procedure Attributes Procedures can have the following attributes: MAIN INTERRUPT RESIDENT CALLABLE PRIV VARIABLE EXTENSIBLE ( LANGUAGE count ) C COBOL FORTRAN PASCAL UNSPECIFIED VST1305.vsd MAIN The MAIN attribute causes the procedure to execute first when you run the program. When the MAIN procedure completes execution, it passes control to the PROCESS_STOP_ system procedure, rather than executing an EXIT instruction.
Procedures INTERRUPT INTERRUPT The INTERRUPT attribute causes the compiler to generate an IXIT (interrupt exit) instruction instead of an EXIT instruction at the end of execution. Only operating system interrupt handlers use the INTERRUPT attribute. An example is: PROC int_handler INTERRUPT; BEGIN !Do some work END; RESIDENT The RESIDENT attribute causes procedure code to remain in main memory for the duration of program execution. The operating system does not swap pages of this code.
Procedures VARIABLE VARIABLE The VARIABLE attribute means the compiler treats all parameters of the procedure (or subprocedure) as if they are optional, even if some are required by your code. If you add parameters to the VARIABLE procedure (or subprocedure) declaration, all procedures that call it must be recompiled.
Procedures LANGUAGE LANGUAGE In a D-series EXTERNAL procedure declaration, you can use the LANGUAGE attribute to specify that the external routine is a C, COBOL, FORTRAN, or Pascal routine. If you do not know if the external routine is a C, COBOL, FORTRAN, or Pascal routine, you can use the LANGUAGE UNSPECIFIED option. The following example shows the LANGUAGE COBOL option and a public name "A-PROC" (in COBOL identifier format): PROC a_proc = "a-proc" (a, b, c) LANGUAGE COBOL; STRING .a, .b, .
Procedures Formal Parameter Specifications param-type is the parameter type of the formal parameter. Table 13-1 on page 13-12 lists the parameter types you can specify depending on the kind of actual parameter expected for this formal parameter. param-type can be one of: STRING INT REAL ( width ) UNSIGNED ( width ) ( fpoint ) FIXED * STRUCT PROC type PROC (32) VST1307.vsd width is a constant expression that specifies the number of bits in the variable.
Procedures Formal Parameter Specifications type specifies that the pa]rameter is a function procedure, the return value of which is one of the following data types: STRING INT REAL ( width ) UNSIGNED ( width ) ( fpoint ) FIXED * VST1308.
Procedures • • • Usage Considerations Arrays Structures Simple variables (when you want to update the original value in the caller’s scope) An absence of any indirection symbol (. or .EXT) denotes 16-bit direct addressing. .EXT is the extended indirection symbol. Its presence denotes a reference parameter that has a 32-bit address. Specify reference parameters for actual parameters that are arrays or structures or for actual parameters that you want to update. An absence of any indirection symbol (.
Procedures Usage Considerations Table 13-1.
Procedures Examples of Formal Parameter Specification For information on using the PROC(32) parameter type, see Section 17, MixedLanguage Programs, in the TAL Programmer’s Guide. Examples of Formal Parameter Specification 1. This example shows a function that has two formal parameters, of which one is a value parameter and the other is a reference parameter. The compiler treats VAR1 as if it were a simple variable and treats VAR 2 as if it were a simple pointer: INT PROC mult (var1, var2); INT var1, .
Procedures Usage Consideration local-decl is a declaration for one of: Simple variable Array (direct, indirect, or read-only) Structure (direct or indirect) Simple pointer Structure pointer Equivalenced variable LITERAL DEFINE Label Entry point FORWARD subprocedure subproc-decl is a subprocedure declaration, as described in Subprocedure Declaration on page 13-15. statement is any statement described in Section 12, Statements.
Procedures Subprocedure Declaration 2.
Procedures Subprocedure Declaration parameter-list has the form: ( param-name ) param-pair , VST1311.vsd param-name is the identifier of a formal parameter. The number of formal parameters a subprocedure can have is limited by space available in the parameter area of the subprocedure. param-pair is a pair of formal parameter identifiers that comprises of a languageindependent string descriptor in the form: string : length VST1312.
Procedures Subprocedure Body subproc-body is a BEGIN-END construct that contains sublocal declarations and statements, as described in Subprocedure Body on page 13-17. FORWARD means the subprocedure body is declared later in this procedure. Subprocedure Body A subprocedure body can contain sublocal declarations and statements. BEGIN END sublocal-decl ; ; statement ; VST1313.
Procedures Example of Subprocedure Declaration Sublocal Variables In subprocedures, declare pointers and directly addressed variables only. Here are examples: Sublocal Variable Example Simple variable (which are always direct) INT var; Direct array INT array[0:5]; Read-only array INT ro_array = 'P' := [0,1,2,3,4,5]; Direct structure STRUCT struct_a; BEGIN INT a, b, c; END; Simple pointer INT .simple_ptr; Structure pointer STRING .struct_ptr (struct_a); If you use an indirection symbol (.
Procedures Usage Considerations ENTRY identifier , ; VST1314.vsd identifier is an entry-point identifier to be placed in the procedure or subprocedure body. It is an alternate or secondary point in the procedure or subprocedure at which to start executing. Usage Considerations An entry point of a procedure or subprocedure is a location at which execution can start. The primary entry point is the procedure or subprocedure identifier.
Procedures Examples of Entry-Point Declarations Subprocedure Entry-Point Identifiers Here are guidelines for using subprocedure entry-point identifiers: • • • • • • • Declare all entry-point identifiers for a subprocedure within the subprocedure. Place each entry-point identifier and a colon (:) at a point in the subprocedure at which execution is to start. You invoke a subprocedure entry-point identifier from anywhere in the encompassing procedure, including from within the same subprocedure.
Procedures Label Declaration 2. This example shows FORWARD declarations for entry points: INT to_this := 314; PROC add_1 (g2); INT .g2; FORWARD; !FORWARD entry-point ! identifier declaration PROC add_2 (g2); INT .g2; FORWARD; !FORWARD entry-point ! identifier declaration PROC add_3 (g2); INT .g2; FORWARD; !FORWARD procedure ! declaration PROC mymain MAIN; BEGIN CALL add_1 (to_this); END; !Main procedure declaration PROC add_3 (g2); INT .
Procedures Usage Considerations Usage Considerations Labels are the only declarable objects that you need not declare before using them. For best program management, however, declare all labels. For example, declaring a label helps ensure that you access the label, not a variable that has the same identifier. Local Labels You can use a local label as follows: 1. Declare the label inside a procedure at the local level. 2.
Procedures Examples of Label Declarations 2. In this example, sublocal GOTO statements branch to local labels A and B.
Procedures Examples of Label Declarations TAL Reference Manual—526371-001 13 -24
14 Standard Functions TAL provides a variety of standard functions that perform frequently used operations. This section describes the syntax for calling each standard function. For information on privileged standard functions—$AXADR, $BOUNDS, and $SWITCHES—see Section 15, Privileged Procedures. Summary of Standard Functions Standard functions—also known as built-in functions—perform a variety of operations.
Standard Functions Summary of Standard Functions Table 14-1.
Standard Functions Summary of Standard Functions Table 14-1.
Standard Functions Type-Transfer Functions Table 14-1.
Standard Functions Rounding by Standard Functions Table 14-2. Type-Transfer Functions by Data Type (page 2 of 2) Result Expression INT INT (32) FIXED REAL REAL (64) FIXED $FIXI $FIXL $INT $INTR $DBL $DBLR $FIXD $FIX $FIXR $FLT $FLTR $EFLT $EFLTR REAL $INT $INTR $DBL $DBLR $FIX $FIXR - $EFLT $EFLTR REAL (64) $INT $INTR $DBL $DBLR $FIX $FIXR $FLT $FLTR - Rounding by Standard Functions Type-transfer functions that have names ending in R, such as $DBLR, round the result.
Standard Functions Data Types of Expression Arguments Data Types of Expression Arguments Expressions can be any data type except STRING and UNSIGNED. INT and INT(32) expressions, however, can include such operands as follows. In any other expressions, all operands must be of the same data type. INT Expressions An INT expression can include STRING, INT, and UNSIGNED(1–16) operands. The system treats STRING and UNSIGNED(1–16) operands as if they were 16-bit values.
Standard Functions Usage Considerations Usage Considerations If the absolute value of a negative INT, INT(32), or FIXED expression cannot be represented in two’s complement form, $ABS sets the overflow indicator. For example, if X has the INT value –32,768, $ABS(X) causes an arithmetic overflow.
Standard Functions Example of $ALPHA Function Example of $ALPHA Function In this example, $ALPHA tests for an alphabetic character in a STRING argument: STRING some_char; !Declare variable IF $ALPHA (some_char) THEN ... ; !Test for alphabetic ! character $AXADR Function The $AXADR function is described in Section 15, Privileged Procedures. $BITLENGTH Function The $BITLENGTH function returns the length, in bits, of a variable. $BITLENGTH ( variable ) VST1403.
Standard Functions Example of $BITLENGTH Function Example of $BITLENGTH Function In this example, $BITLENGTH returns the length, in bits, of one occurrence of structure S: INT s_len; !Declare variable STRUCT .
Standard Functions Example of $BITOFFSET Function Example of $BITOFFSET Function In this example, $BITOFFSET returns the offset (in bits) of the third occurrence of substructure AB: STRUCT a; BEGIN INT array[0:40]; STRUCT ab[0:9]; BEGIN UNSIGNED(1) flag; UNSIGNED(15) offset; END; END; !Declare structure !Declare substructure AB ! with ten occurrences INT c; c := $BITOFFSET (a.
Standard Functions Example of $CARRY Function To check the state of the carry indicator, use $CARRY in an IF statement immediately following the operation that affects the carry indicator. If the carry indicator is on, $CARRY is –1 (true). If the carry indicator is off, $CARRY is 0 (false).
Standard Functions Usage Consideration $DBL ( expression ) VST1407.vsd expression is an INT, FIXED(0), REAL, or REAL(64) expression. Usage Consideration If expression is too large in magnitude to be represented by a 32-bit two’s complement integer, $DBL sets the overflow indicator.
Standard Functions Examples of $DBLL Function Examples of $DBLL Function 1. In this example, $DBLL returns an INT(32) value formed from two INT variables, FIRST_INT and SECOND_INT: INT first_int, second_int; INT(32) some_double; !Declare variables some_double := $DBLL (first_int, second_int); !Return INT(32) value 2. In this example, $DBLL returns an extended (32-bit) address from two INT constants that represent a standard (16-bit) address in the current user code segment: INT .
Standard Functions $DFIX Function 2. Here is another example: REAL realnum := 123.456E0; INT(32) dblnum; !Declare variables dblnum := $DBLR (realnum); !Return 123D $DFIX Function The $DFIX function returns a FIXED(fpoint) expression from an INT(32) expression. $DFIX ( dbl-expression , fpoint ) VST1410.vsd dbl-expression is an INT(32) arithmetic expression. fpoint is a value in the range –19 through +19 that specifies the position of the implied decimal point in the result.
Standard Functions $EFLT Function $EFLT Function The $EFLT function returns a REAL(64) value from an INT, INT(32), FIXED(fpoint), or REAL expression. $EFLT ( expression ) VST1411.vsd expression is an INT, INT(32), FIXED(fpoint), or REAL expression. Usage Consideration If a FIXED expression has a nonzero fpoint, the compiler multiplies or divides the result by the appropriate power of ten.
Standard Functions Example of $EFLTR Function Example of $EFLTR Function In this example, $EFLTR returns a rounded REAL(64) value from a FIXED(3) expression: REAL(64) rndnum; FIXED(3) fixnum := 12345.678F; !Declare variables rndnum := $EFLTR (fixnum); !Return rounded REAL(64) ! value $FIX Function The $FIX function returns a FIXED(0) value from an INT, INT(32), REAL, or REAL(64) expression. $FIX ( expression ) VST1413.vsd expression is an INT, INT(32), FIXED, REAL, or REAL(64) expression.
Standard Functions Usage Consideration fixed-expression is a FIXED expression, which $FIXD treats as a FIXED(0) expression, ignoring any implied decimal point. Usage Consideration If the result cannot be represented in a signed doubleword, $FIXD sets the overflow indicator.
Standard Functions $FIXL Function $FIXL Function The $FIXL function returns the unsigned INT equivalent of a FIXED(0) expression. $FIXL fixed-expression ( ) VST1416.vsd fixed-expression is a FIXED expression, which $FIXL treats as a FIXED(0) expression, ignoring any implied decimal point. Usage Considerations If the result cannot be represented in an unsigned 16-bit integer, $FIXL sets the overflow indicator.
Standard Functions Example of $FIXR Function Example of $FIXR Function 1. In this example, $FIXR returns a rounded FIXED(0) value from a REAL(64) expression: FIXED rfixnum; REAL(64) bigrealnum := -1.5L0; !Declare variables rfixnum := $FIXR (bigrealnum); !Return -1F 2. In this example, $FIXR returns a rounded FIXED(0) value from a REAL expression: FIXED rndfnum; REAL realnum := 123.
Standard Functions $FLTR Function $FLTR Function The $FLTR function returns a REAL value from an INT, INT(32), FIXED(fpoint), or REAL(64) expression and applies rounding to the result. $FLTR expression ( ) VST1419.vsd expression is an INT, INT(32), FIXED(fpoint), REAL, or REAL(64) expression. Usage Consideration If a FIXED expression has a nonzero fpoint, the compiler multiplies or divides the result by the appropriate power of ten.
Standard Functions $IFIX Function $IFIX Function The $IFIX function returns a FIXED( fpoint) value from a signed INT expression. $IFIX ( int-expression , fpoint ) VST1421.vsd int-expression is a signed INT expression. fpoint is a value in the range –19 through +19 that specifies the position of the implied decimal point in the result. A positive fpoint specifies the number of decimal places to the right of the decimal.
Standard Functions Usage Considerations Usage Considerations If expression is INT, INT(32), or FIXED(0), $INT returns the low-order (least significant) 16 bits and does not explicitly maintain the sign. No overflow occurs. If expression is REAL or REAL(64), $INT returns a fully converted INT value, not a truncation. If the converted value of expression is too large to be represented by a 16bit two’s complement integer, an overflow trap occurs. Examples of $INT Function 1.
Standard Functions Example of $INTR Function If expression is type REAL or REAL(64), $INTR returns a fully converted and rounded INT value, not a truncation. If the converted value of expression is too large to be represented by a 16-bit two’s complement integer, an overflow trap occurs.
Standard Functions Example of $LADR Function Example of $LADR Function In this example, $LADR returns a standard (16-bit) address from an extended (32-bit) address: STRING .ptr; STRING .EXT array[0:99]; STRING .EXT xptr := @array[0]; !Declare variables @ptr := $LADR (xptr); !Return 16-bit address ! from 32-bit address $LEN Function The $LEN function returns the length, in bytes, of one occurrence of a variable. $LEN ( variable ) VST1425.
Standard Functions Examples of $LEN Function Examples of $LEN Function 1. In this example, $LEN returns the number of bytes in an array element: INT b; INT a [0:11]; !Declare variables b := $LEN (a); !Return 2 2. In this example, $LEN returns the number of bytes in one occurrence of a structure: INT s_len; STRUCT .s[0:99]; BEGIN INT(32) array[0:2]; END; !Declare 100 occurrences of ! a structure s_len := $LEN (s); !Return 12 3.
Standard Functions Usage Consideration to the right of the decimal. A negative fpoint specifies the number of integer places to the left of the decimal point. Usage Consideration $LFIX places the INT value in the low-order (least significant) word of the quadrupleword and sets the three high-order (most significant) words to 0.
Standard Functions Example of $LMIN Function int-expression is an unsigned INT arithmetic expression. Example of $LMIN Function In this example, $LMIN returns the minimum of an unsigned INT expression and a constant: INT intval := 3; min := $LMIN (intval, 5); !Return 3 $MAX Function The $MAX function returns the maximum of two signed INT, INT(32), FIXED(fpoint), REAL, or REAL(64) expressions. $MAX ( expression , expression ) VST1429.
Standard Functions Example of $MIN Function Example of $MIN Function In this example, $MIN returns the minimum of a FIXED expression and a constant: FIXED fixval := -3F; min := $MIN (fixval, 5F); !Return -3F $NUMERIC Function The $NUMERIC function tests the right half of an INT value for the presence of an ASCII numeric character. $NUMERIC ( int-expression ) VST1431.vsd int-expression is an INT expression.
Standard Functions $OCCURS Function $OCCURS Function The $OCCURS function returns the number of occurrences of a variable. $OCCURS ( variable ) VST1432.
Standard Functions Examples of $OCCURS Function Examples of $OCCURS Function 1. In this example, $OCCURS returns the number of occurrences of a structure, which is 6: INT index; STRUCT .job_data[0:5]; BEGIN INT i1; STRING s1; END; !Declare structure FOR index := 0 TO $OCCURS (job_data) - 1 DO ... ; !Return 6, the number of ! structure occurrences 2. In this example, $OCCURS returns the number of elements in an array, and $LEN returns the number of bytes in each element.
Standard Functions Usage Considerations Usage Considerations The zeroth structure occurrence has an offset of 0. For items other than a structure data item, $OFFSET returns a 0. When you qualify the identifier of variable, you can use constant indexes but not variable indexes; for example: $OFFSET (struct1.subst[1].
Standard Functions $OPTIONAL Function STRING s; END; STRUCT .st; BEGIN INT i; INT j; INT .st_ptr(tt END; !Declare structure ST !Declare structure pointer ! that points to structure TT INT x; x := $OFFSET (st.j); x := $OFFSET (tt.s); x := $OFFSET (st.st_ptr.s); !X gets 2 !X gets 6 !X gets 6 3. This example applies $OFFSET to an indexed template structure: INT x; STRUCT st[-1:1]; BEGIN INT item; FIXED(2) price; END; x := $OFFSET (st[-1].
Standard Functions string Usage Considerations : length VST1435.vsd string is the identifier of a STRING array or simple pointer declared inside or outside a structure. length is an INT expression that specifies the length, in bytes, of string. Usage Considerations A call to a VARIABLE or EXTENSIBLE procedure can omit some or all parameters. $OPTIONAL lets your program pass a parameter (or parameter-pair) based on a condition at execution time.
Standard Functions Examples of the $OPTIONAL Function 2. This example shows that a called procedure cannot distinguish between a parameter that is omitted conditionally and one that is omitted unconditionally: PROC p1 (i) EXTENSIBLE; INT i; BEGIN !Lots of code END; PROC p2; BEGIN INT n := 1; CALL p1 ($OPTIONAL (n < 0, n) ); CALL p1 ( ); END; !These two calls are ! indistinguishable. 3. This example shows how you can conditionally pass or not pass a parameter and a parameter pair.
Standard Functions $OVERFLOW Function PROC p2 (p, q) EXTENSIBLE; INT .p; INT .q; BEGIN !Lots of code CALL p1 ($OPTIONAL ($PARAM (p), p ), $OPTIONAL ($PARAM (q), q )); !Lots of code END; $OVERFLOW Function The $OVERFLOW function checks the state of the overflow indicator and indicates whether an overflow occurred. $OVERFLOW VST1436.vsd Usage Considerations The overflow indicator is bit 8 in the environment register (ENV.V).
Standard Functions Example of $OVERFLOW Function Example of $OVERFLOW Function This example turns overflow trapping off, tests the overflow indicator, and turns overflow trapping back on.
Standard Functions Example of $PARAM Function Example of $PARAM Function In this example, $PARAM checks for the absence of each required parameter and for the presence of the optional parameter: PROC var_proc (buffer,length,key) VARIABLE; INT .buffer, length, !Required parameters key; !Optional parameter BEGIN !Some code here IF NOT $PARAM (buffer) OR NOT $PARAM (length) THEN RETURN; !Return 1 or 0 for each ! required parameter IF $PARAM (key) THEN ...
Standard Functions $READCLOCK Function $READCLOCK Function The $READCLOCK function returns the current setting of the system clock. $READCLOCK VST1439.vsd Usage Considerations $READCLOCK returns the current setting of the system clock as a FIXED(0) value. $READCLOCK invokes the RCLK instruction, described in the System Description Manual for your system.
Standard Functions $SCALE Function $SCALE Function The $SCALE function moves the position of the implied decimal point by adjusting the internal representation of a FIXED(fpoint) expression. $SCALE fixed-expression ( , scale ) VST1441.vsd fixed-expression is a FIXED expression. scale is an INT constant in the range –19 to +19 that defines the number of positions to move the implied decimal point to the left (scale > 0) or to the right (scale < 0) of the least significant digit.
Standard Functions $SPECIAL Function $SPECIAL Function The $SPECIAL function tests the right half of an INT value for the presence of an ASCII special (non-alphanumeric) character. $SPECIAL ( int-expression ) VST1442.vsd int-expression is an INT expression. Usage Considerations $SPECIAL inspects bits <8:15> of the int-expression and ignores bits <0:7>. It tests for a special character according to the following criterion: int-expression.<8:15> <> alphabetic AND int-expression.
Standard Functions $TYPE Function $TYPE Function The $TYPE function returns a value that indicates the data type of a variable. $TYPE variable ( ) VST1443.vsd variable is the identifier of a simple variable, array, simple pointer, structure, structure data item, or structure pointer.
Standard Functions Usage Consideration int-expression is an unsigned INT expression. Usage Consideration $UDBL places the INT value in the low-order 16 bits of an INT(32) variable and sets the high-order 16 bits to 0.
Standard Functions Example of $USERCODE Function Example of $USERCODE Function In this example, $USERCODE returns the content of a word located at a label in the current user code segment: PROC p; BEGIN INT a, b, c; !Some code here u_code_location: a := a + b; !More code here c := $USERCODE (@u_code_location); END; !Declare procedure !Declare variables !Label a location !Get content of word ! located at label $XADR Function The $XADR function converts a standard address to an extended address.
Standard Functions Examples of $XADR Function Examples of $XADR Function 1. This example initializes an extended pointer with the extended (32-bit) address that $XADR returns from a standard (16-bit) address: INT .array[0:49]; !ARRAY has 16-bit address STRING .EXT xptr := $XADR (array); !Initialize XPTR with 32-bit ! address returned by $XADR 2.
Standard Functions Built-in Functions Some built-ins are functions that return values, as in the following: a := $ATOMIC_GET(b); t := $READTIME; TAL directly implements pTAL built-ins. However, the only parameter data type to some pTAL built-ins that must be correct is the parameter size. For example, the parameter for type-transfer functions is checked for size, but not for type. TAL is used only to generate TNS code on behalf of the pTAL compiler.
Standard Functions Built-in Functions Table 14-4.
Standard Functions Built-in Functions Table 14-4.
Standard Functions Built-in Functions TAL Reference Manual—526371-001 14 -48
15 Privileged Procedures This section gives information on privileged mode and operations and accessing the global data area of the system data segment.
Privileged Procedures Nonprivileged Procedures The following PRIV procedure is called by the preceding CALLABLE procedure: PROC priv_proc PRIV; BEGIN !Privileged instructions END; Nonprivileged Procedures A nonprivileged procedure that is called by a CALLABLE or PRIV procedure executes in privileged mode and can call PRIV procedures. Privileged Operations Only procedures that operate in privileged mode can access system global data.
Privileged Procedures System Global Pointer Declaration System Global Pointer Declaration The system global pointer declaration associates an identifier with a memory location at which you store the address of a variable located in the system global data area. type identifier .SG ; := presetaddress , VST1501.vsd type is any data type except UNSIGNED and specifies the data type of the value to which the pointer points. .
Privileged Procedures 'SG'-Equivalenced Variable Declarations 'SG'-Equivalenced Variable Declarations 'SG' equivalencing associates a global, local, or sublocal identifier with a location that is relative to the base address of the system global area.
Privileged Procedures Example of 'SG'-Equivalenced Simple Variable Example of 'SG'-Equivalenced Simple Variable This example declares a simple variable equivalent to location SG + 15 in the system global data area: INT item = 'SG' + 15; 'SG'-Equivalenced Definition Structure The 'SG'-equivalenced definition structure declaration associates a definition structure with a location relative to the base address of the system global data area. = identifier STRUCT .SG . .SG .
Privileged Procedures Usage Consideration index and offset are equivalent INT values in the range 0 through 63. structure-layout is a BEGIN-END construct that contains declarations for structure items. Usage Consideration If you specify an indirection symbol (., .SG, or .EXT), the structure behaves like a structure pointer. If you do not specify an indirection symbol, the structure has direct addressing mode.
Privileged Procedures Usage Considerations . (period) is the standard indirection symbol and denotes 16-bit addressing, in this case in the system global data area. .SG is the system global indirection symbol and denotes 16-bit addressing in the system global data area. .EXT is the extended indirection symbol and denotes 32-bit addressing. identifier is the identifier of a referral structure to be made equivalent to 'SG'.
Privileged Procedures 'SG'-Equivalenced Simple Pointer 'SG'-Equivalenced Simple Pointer The 'SG'-equivalenced simple pointer declaration associates a simple pointer with a location relative to the base address of the system global data area. type identifier . = 'SG' .SG .EXT ; [ index + offset ] , VST1505.vsd type is any data type except UNSIGNED and specifies the data type of the value to which the pointer points. .
Privileged Procedures Example of 'SG'-Equivalenced Simple Pointer index and offset are equivalent INT values in the range 0 through 63. Example of 'SG'-Equivalenced Simple Pointer This example declares a simple pointer equivalent to location SG + 2 in the system global data area: INT .ptr = 'SG' + 2; 'SG'-Equivalenced Structure Pointer The 'SG'-equivalenced structure pointer declaration associates a structure pointer with a location relative to the base address of the system global data area.
Privileged Procedures Usage Considerations .EXT is the extended indirection symbol and denotes 32-bit addressing. identifier is the identifier of a structure pointer to be made equivalent to 'SG'. referral is the identifier of a previously declared structure or structure pointer that is to provide the layout for identifier. 'SG' is the symbol that denotes the base address of the system global data area; identifier is addressed relative to SG[0].
Privileged Procedures Functions for Privileged Operations Functions for Privileged Operations The following privileged functions perform operations that are restricted to procedures running in privileged mode: Standard Function Operation $AXADR Converts a standard address or a relative extended address to an absolute extended address $BOUNDS Checks the locations of parameters passed to system procedures $SWITCHES Returns the current setting of the switch register The following pages describe each
Privileged Procedures $BOUNDS Function $BOUNDS Function The $BOUNDS function checks the location of a parameter passed to a system procedure to prevent a pointer that contains an incorrect address from overlaying the stack (S) register with data. $BOUNDS param ( , count ) VST1508.vsd param is the identifier of an INT reference parameter of the procedure from which the $BOUNDS function is called. param must be declared at the global level.
Privileged Procedures $SWITCHES Function $SWITCHES Function The $SWITCHES function returns the current content of the switch register. $SWITCHES VST1509.vsd Usage Considerations For NonStop and TXP processors, the switch register stores the current setting of the physical switches on the processor. $SWITCHES is not portable to future software platforms.
Privileged Procedures Usage Considerations Usage Considerations You can specify TARGET in the compilation command or anywhere in the source code any number of times. Do not, however, specify both TARGET TNS_ARCH and TARGET TNS_R_ARCH in the same compilation unit. You can use TARGET to source in system-specific blocks of declarations from library files, such as operating system declaration files.
Privileged Procedures Examples of TARGET Directive Any TARGET Directive If any TARGET directive is in effect, the compiler: • • Compiles code between IF TARGETSPECIFIED and ENDIF TARGETSPECIFIED Skips code between IFNOT TARGETSPECIFIED and ENDIF TARGETSPECIFIED If no TARGET directive is in effect, the compiler: • • Compiles code between IFNOT TARGETSPECIFIED and ENDIF TARGETSPECIFIED Skips code between IF TARGETSPECIFIED and ENDIF TARGETSPECIFIED Examples of TARGET Directive 1.
Privileged Procedures Examples of TARGET Directive 4. If your program uses MAX_FILE_SIZE, you must specify either TARGET option to avoid compilation errors on the BYTES_IN_SEG declaration. The object file does not rely on system-specific declarations, so you can run the object file on both systems by using the stand-alone Binder command SET TARGET ANY.
16 Compiler Directives This section describes compiler directives provided by the TAL compiler. Compiler directives let you: • • • • Specify input source code Select options that control listings, generate object code, and build the object file Perform conditional compilation Allocate and delete the compiler’s internal data structures Specifying Compiler Directives You can specify compiler directives either in a compilation command or in a directive line, unless otherwise noted in this section.
Compiler Directives Directive Line Directive Line A directive line in your source code can contain one or more compiler directives unless otherwise noted in the directive descriptions. ? directive , VST1601.vsd ? indicates a directive line. ? can appear only in column 1. directive is the name of a compiler directive described in this section. Usage Considerations • • • • • Begin each directive line and each continuation directive line by specifying ? in column 1.
Compiler Directives Directive Stacks 2. This directive line shows proper placement of the leading parenthesis of the argument list: ?NOLIST, SOURCE $SYSTEM.SYSTEM.EXTDECS ( ? PROCESS_GETINFO_, ? PROCESS_STOP_) Directive Stacks Several directives have a compile-time directive stack on which you can push and pop directive settings. Directives that have directive stacks are: CHECK CODE DEFEXPAND ICODE INNERLIST INT32INDEX LIST MAP Each directive stack is 32 levels deep.
Compiler Directives File Names As Directive Arguments Directive Stack Example In the following example: 1. LIST is the default setting for the source file. 2. PUSHLIST pushes the LIST directive setting onto the LIST directive stack. 3. NOLIST suppresses listing of sourced-in procedures. 4. POPLIST pops the top value off the LIST directive stack and restores LIST as the current setting for the remainder of the source file: !LIST is the default setting for the source file ?PUSHLIST, NOLIST, SOURCE $SYSTEM.
Compiler Directives Logical File Names Logical File Names A logical file name is a TACL DEFINE name or a TACL ASSIGN name. The following directives accept a logical file name in place of a file name: ERRORFILE SAVEGLOBALS SEARCH SOURCE USEGLOBALS Appendix E in the TAL Programmer’s Guide gives more information on disk file names and TACL DEFINE and ASSIGN commands. Summary of Compiler Directives Table 16-1 on page 16-6 summarizes directives grouped in the following categories.
Compiler Directives Summary of Compiler Directives Table 16-1.
Compiler Directives Summary of Compiler Directives Table 16-1.
Compiler Directives Summary of Compiler Directives Table 16-1.
Compiler Directives Summary of Compiler Directives Table 16-1.
Compiler Directives Summary of Compiler Directives Table 16-1.
Compiler Directives Summary of Compiler Directives Table 16-1.
Compiler Directives ABORT Directive ABORT Directive With ABORT, the compiler terminates compilation if it cannot open a file specified in a SOURCE directive. The default is ABORT. ABORT NOABORT VST1602.vsd Usage Considerations This directive can appear in the compilation command or anywhere in the source code. ABORT If ABORT is in effect and the compiler cannot open a file listed in a SOURCE directive, the compilation session terminates.
Compiler Directives Example of ABORT Directive Example of ABORT Directive In this example, NOABORT prompts you for a file name when the compiler cannot open a file listed in a SOURCE directive: !This is MYSOURCE file !Global declarations ?NOABORT ?SOURCE somefile (proc1, proc2, proc3) ?SOURCE anyfile !Procedure declarations ABSLIST Directive ABSLIST lists code addresses relative to the code area base. The default is NOABSLIST. ABSLIST NOABSLIST VST1603.
Compiler Directives • • Example of ABSLIST Considerations Does not supply enough PEP table space in the PEP directive Does not declare all procedures FORWARD Also, if the file reaches the 64K-word limit, the compiler disables ABSLIST, starts printing offsets from the procedure base, and emits a warning.
Compiler Directives Example of ASSERTION Directive 1. Place an ASSERTION directive in the source code where you want to start debugging. In the directive, specify an assertion-level and an error-handling procedure such as the D-series PROCESS_DEBUG_ or the C-series DEBUG procedure: ?ASSERTION 5, PROCESS_DEBUG_ !Assertion-level is 5 2. Place an ASSERT statement at the point where you want to invoke the errorhandling procedure when some condition occurs.
Compiler Directives BEGINCOMPILATION Directive If you change the assertion-level to 30, you nullify all the ASSERT statements. Thus, if ASSERT statements that cover a particular condition all have the same assert-level, it is easier to nullify specific levels of ASSERT statements. BEGINCOMPILATION Directive BEGINCOMPILATION marks the point in the source file where compilation is to begin if the USEGLOBALS directive is in effect. BEGINCOMPILATION VST1605.
Compiler Directives CHECK Directive CHECK Directive CHECK generates range-checking code for certain features. The default is NOCHECK. CHECK NOCHECK PUSHCHECK POPCHECK VST1606.vsd Usage Considerations You can specify the CHECK directive in the compilation command or anywhere in the source text. CHECK turns the checking setting on for subsequent code. NOCHECK turns the checking setting off for subsequent code.
Compiler Directives • Example of CHECK Directive If NOCHECK is in effect or if your program has disabled arithmetic traps, control passes to the statement following the unlabeled CASE statement and program results are unpredictable. Labeled CASE Statement CHECK and NOCHECK do not affect the labeled CASE statement. If you omit the OTHERWISE clause in a labeled CASE statement and the selector value does not select an alternative, a run-time error occurs.
Compiler Directives Usage Considerations Usage Considerations This directive can appear in the compilation command or anywhere in the source code. CODE turns the code-listing setting on for subsequent code. CODE has no effect if NOLIST or SUPPRESS is in effect. NOCODE turns the code-listing setting off for subsequent code. PUSHCODE pushes the current code-listing setting onto the directive stack without changing the current setting.
Compiler Directives Usage Considerations you specify a value smaller than 12, the compiler issues a warning and uses 12. If you specify a value larger than 132, the compiler issues a warning and uses 132. Usage Considerations COLUMNS can appear in the compilation command or anywhere in the source code. In the source code, COLUMNS if present must be the first or only directive in the directive line.
Compiler Directives • Examples of COLUMNS Directive In all other cases, the columns-value is set by the most recently processed COLUMNS directive. If a SOURCE directive lists sections, the compiler processes no source code outside the listed sections except any COLUMNS directives that appear before the first SECTION directive in the sourced-in file. For more information on sourcing in files or sections, see the SOURCE and SECTION directives. Examples of COLUMNS Directive 1.
Compiler Directives Example of COMPACT Directive Example of COMPACT Directive This example specifies the COMPACT directive at the end of the source file in case sourced-in files specify NOCOMPACT. This is to ensure that BINSERV fills in gaps in the lower 32K-word area of the code segment: !This is MYSOURCE file !Lots of code !Last procedure ?COMPACT !End of source file CPU Directive CPU specifies that the object file runs on a TNS system. (The need for this directive no longer exists.
Compiler Directives Usage Considerations CROSSREF class NOCROSSREF ( class ) , VST1611.vsd class is an identifier class. The default list of classes includes all classes except UNREF.
Compiler Directives Usage Considerations Selecting Classes You can make changes to the current class list at any point in the compilation unit. The compiler collects cross-references for the class list in effect at the end of the compilation: • • To add classes, specify CROSSREF and list the classes you want to add. To delete classes, specify NOCROSSREF and list the classes you want to delete.
Compiler Directives Example of CROSSREF Directive Example of CROSSREF Directive This example makes changes to the current class list and turns the collection and listing of cross-references on and off: !Default LIST and NOSUPPRESS are in effect; ! list cross-references.
Compiler Directives Usage Considerations Usage Considerations Before compilation, you can specify the number of data area memory pages as follows: • • You can specify the DATAPAGES directive in the compilation command or anywhere in the source code. If you specify a num-pages value greater than 32, DATAPAGES overrides the STACK and EXTENDSTACK directives.
Compiler Directives Usage Considerations Usage Considerations DECS can appear anywhere in the source code outside the global declarations. It cannot appear in the compilation command. If you manipulate data stack contents without the compiler’s knowledge (with CODE statements, for example), you should use DECS to calibrate the compiler’s internal Sregister counter.
Compiler Directives Usage Considerations DEFEXPAND NODEFEXPAND PUSHDEFEXPAND POPDEFEXPAND VST1614.vsd Usage Considerations This directive can appear in the compilation command or anywhere in the source code. DEFEXPAND turns the define-listing setting on for subsequent code. DEFEXPAND has no effect if NOLIST or SUPPRESS is in effect. NODEFEXPAND turns the define-listing setting off for subsequent code.
Compiler Directives DEFINETOG Directive DEFINETOG Directive DEFINETOG specifies named or numeric toggles, without changing any prior settings, for use in conditional compilation. DEFINETOG is a D20 or later feature. toggle-name DEFINELOG toggle-number , ( toggle-name ) toggle-number , VST1615.vsd toggle-name is a user-defined name that conforms to the TAL identifier format. toggle-number is an unsigned decimal constant in the range 1 through 15. Leading zeros are ignored.
Compiler Directives Examples of DEFINETOG Directive you use depends on whether you want settings of named toggles unchanged or turned on or off: Directive Setting of New Toggle Setting of Specified Existing Toggle DEFINETOG Off Unchanged SETTOG On On RESETTOG Off Off You can use DEFINETOG if you are not sure the toggles were created earlier in the compilation, possibly in a file that you sourced in.
Compiler Directives DUMPCONS Directive ?DEFINETOG emitter !Some code here !Specify toggle EMITTER ?IFNOT emitter PROC kept; BEGIN !More code here END; ?ENDIF emitter !Test toggle for off state !Find it off; compile procedure !End of compiled part 4. In this example, SETTOG turns on toggle ON_TOG. DEFINETOG then specifies ON_TOG but does not change its setting.
Compiler Directives Example of DUMPCONS Directive The compiler generates an unconditional branch around each insertion of constants and labels into the object code. Use With CODE Statements If you use CODE statements to create a block of data in your code, the compiler might insert constants or branch labels in the middle of your block of data. If you need to keep the data generated by your CODE statements in one contiguous sequence, put a DUMPCONS directive immediately before the CODE statements.
Compiler Directives Usage Considerations The meaning of the ENV attributes are: ENV Attribute Intended Run-Time Environment COMMON The CRE OLD A COBOL or FORTRAN run-time environment outside the CRE NEUTRAL None; the program relies primarily on system procedures Usage Considerations ENV can appear only once in a compilation unit, either in the compilation command or in the source code before any declarations. Use ENV only with a D-series compilation unit.
Compiler Directives Examples of ENV Directive Using Binder, you can bind an object file compiled with ENV OLD to any object file except those compiled with ENV COMMON. Each procedure in the new object file retains its original ENV attribute. A D-series TAL program compiled with ENV OLD can run on a C-series system. To debug the program with the Inspect product, however, your system must be a release level C30.06 or later.
Compiler Directives Usage Considerations file-name ERRORFILE define-name assign-name VST1618.vsd file-name is the name of either: • • An existing error file created by ERRORFILE. Such a file has file code 106 (an entry-sequenced disk file used only with the TACL FIXERRS macro). The compiler purges any data in it before logging errors and warnings. A new error file to be created by ERRORFILE if errors occur.
Compiler Directives Example of ERRORFILE Directive FIXERRS Macro After the compiler logs messages to the error file, you can invoke the TACL FIXERRS macro and correct the source file. FIXERRS uses the PS Text Edit ANYHOW option to open the source file in a two-window session. One window displays a diagnostic message. The other window displays the source code to which the message applies. If you have write access to the file, you can correct the source code.
Compiler Directives ERRORS Directive ERRORS Directive ERRORS sets the maximum number of error messages to allow before the compiler terminates the compilation. ERRORS num-messages = VST1620.vsd num-messages is the maximum number of error messages to allow before the compilation terminates. Specify an unsigned decimal constant in the range 0 through 32,767. Usage Considerations ERRORS can appear in the compilation command or anywhere in the source code. A single error can cause many error messages.
Compiler Directives Usage Considerations num-pages is the number of 2048-byte memory pages to add to Binder’s estimate of the data stack size. Specify an unsigned decimal constant in the range 0 through 32. Usage Considerations EXTENDSTACK can appear in the compilation command or anywhere in the source code. If you omit this directive, the default is the data stack size estimated by Binder.
Compiler Directives Example of EXTENDTALHEAP Directive If a heap overflow terminates your compilation, you must specify the EXTENDTALHEAP directive in all subsequent compilations. Example of EXTENDTALHEAP Directive This compilation command starts the compiler and adds 120 memory pages to the compiler’s internal heap: TAL /in mysrc/ myobj; EXTENDTALHEAP 120 FIXUP Directive FIXUP directs BINSERV to perform its fixup step. The default is FIXUP. FIXUP NOFIXUP VST1623.
Compiler Directives Example of FIXUP Directive Example of FIXUP Directive This example requests that BINSERV not perform its fixup step because the file is created for later binding: PROC last_proc; BEGIN !Lots of code END; ?NOFIXUP FMAP Directive FMAP lists the file map. The default is NOFMAP. FMAP NOFMAP VST1624.vsd Usage Considerations FMAP and NOFMAP can appear in the compilation command or anywhere in the source code.
Compiler Directives Examples of FMAP Directive Examples of FMAP Directive 1. This example enables printing of the file map, which shows the fully qualified name of each file from which the compilation read source text: ?FMAP 2. This example disables printing of the file map: ?NOFMAP GMAP Directive GMAP lists the global map. The default is GMAP. GMAP NOGMAP VST1625.vsd Usage Considerations You can specify GMAP or NOGMAP in the compilation command or anywhere in the source code.
Compiler Directives HEAP Directive 2. This example disables printing of the global map: ?NOGMAP HEAP Directive HEAP sets the size of the CRE user heap for a D-series compilation unit if the ENV COMMON directive is in effect. HEAP num-pages = VST1626.vsd num-pages is the number of 2048-byte memory pages to allocate for the CRE user heap (named #HEAP).
Compiler Directives Example of HEAP Directive Example of HEAP Directive This example sets the size of the user run-time heap for the large memory model: ?HEAP 200 HIGHPIN Directive HIGHPIN sets the HIGHPIN attribute in a D-series object file. HIGHPIN VST1627.vsd Usage Considerations HIGHPIN can appear in the compilation command or anywhere in the source code. HIGHPIN can appear any number of times in a compilation. It need not appear in each source file, just once in the compilation unit.
Compiler Directives Examples of Running Object Files at HIGHPIN The following sequence of examples show how to run an object file at high PIN from the TACL prompt. The examples show how to check your processor configuration and high-PIN availability, set the HIGHPIN attribute, and override the TACL HIGHPIN setting if it is off. Examples of Running Object Files at HIGHPIN 1. To check the number of PCBs configured in your processor and to see if high PINs are available, run the Peek product.
Compiler Directives HIGHREQUESTERS Directive HIGHREQUESTERS Directive HIGHREQUESTERS sets the HIGHREQUESTERS attribute in a D-series object file. HIGHREQUESTERS VST1628.vsd Usage Considerations HIGHREQUESTERS can appear in the compilation command or anywhere in the source code. HIGHREQUESTERS can appear any number of times in a compilation. It need not appear in each source file, just once in the compilation unit.
Compiler Directives ICODE Directive ICODE Directive ICODE lists the instruction-code (icode) mnemonics for subsequent procedures. The default is NOICODE. ICODE NOICODE PUSHICODE POPICODE VST1629.vsd Usage Considerations This directive can appear in the compilation command or anywhere in the source code. ICODE lists mnemonics for entire procedures and cannot be turned on and off within a procedure. (By contrast, INNERLIST lists mnemonics for statements and can be turned on and off within procedures.
Compiler Directives Example of ICODE Directive Example of ICODE Directive This compilation command lists the icode mnemonics starting with the first procedure to be compiled: TAL /IN mysrc, OUT $s.#lists/ myobj; ICODE IF and ENDIF Directives IF and IFNOT control conditional compilation based on a condition. The ENDIF directive terminates the range of the matching IF or IFNOT directive. The D20 or later release supports named toggles and target-system toggles in addition to numeric toggles.
Compiler Directives Usage Considerations Usage Considerations IF, IFNOT, and ENDIF can appear in a directive line anywhere in the source code but not in the compilation command. IF and IFNOT must appear last in any directive line. ENDIF must be the only directive on the directive line. For ENDIF, always specify a toggle that matches a previous IF or IFNOT toggle. ENDIF terminates the compilation begun by the IF or IFNOT that specifies the matching toggle.
Compiler Directives Examples of IF and ENDIF Directives Target-System Toggle For target-system toggles, IF causes compilation of subsequent text only if you turned the same toggle on with TARGET. You can specify target-system, for example, when the code deals with the processor state or memory management tables or other processor-specific areas. For information on how IF, IFNOT, and ENDIF work with the TARGET directive, see the TARGET directive, described in Section 15, Privileged Procedures.
Compiler Directives INHIBITXX Directive 3. In this example, SETTOG creates toggle DONE and turns it on. IFNOT tests the toggle for the off state, finds it is on, and causes the compiler to skip the source text between IF DONE and ENDIF DONE: ?SETTOG done !Some code here !Create toggle DONE; turn it on ?IFNOT done PROC skipped; BEGIN !Lots of code END; ?ENDIF done !Test toggle for off state !Find it on; skip procedure !End of skipped portion 4. In this example, SETTOG turns on toggle 1.
Compiler Directives Example of INHIBITXX Directive NOINHIBITXX turns the INHIBITXX setting off for subsequent declarations. Such declarations retain the INHIBITXX or NOINHIBITXX attribute throughout the compilation. NOINHIBITXX enables compiler use of XX instructions (LWXX, SWXX, LBXX, and SBXX), which generate efficient indexing for extended declarations located between G[0] and G[63].
Compiler Directives INNERLIST Directive !Default NOINHIBITXX in effect STRUCT .EXT xstruct[0:9];!XSTRUCT has NOINHIBITXX attribute BEGIN STRING array[0:9]; END; INT index; STRING var; ?INHIBITXX !Set INHIBITXX attribute for} ! for next declaration STRING .EXT xstruct2 (xstruct); !XSTRUCT2 has INHIBITXX attribute PROC my_proc MAIN; BEGIN @xstruct2 := @xstruct; var := xstruct[index].
Compiler Directives Usage Considerations Usage Considerations This directive can appear in the compilation command or anywhere in the source code. INNERLIST turns the innerlisting setting on and lists mnemonics for subsequent statements and can be turned on and off within procedures. (By contrast, ICODE lists mnemonics for entire procedures and cannot be turned on and off within procedures.) It has no effect if NOLIST or SUPPRESS is in effect.
Compiler Directives INSPECT Directive INSPECT Directive INSPECT sets the Inspect product as the default debugger for the object file. The default is NOINSPECT. INSPECT NOINSPECT VST1633.vsd Usage Considerations This directive can appear in the compilation command or anywhere in the source code. The last INSPECT or NOINSPECT directive in a source file takes effect for the object file. If you omit the INSPECT directive, Debug is the default debugger for the object file.
Compiler Directives INT32INDEX Directive INT32INDEX Directive INT32INDEX generates INT(32) indexes from INT indexes for accessing items in an extended indirect structure in a D-series program. The default is NOINT32INDEX. INT32INDEX NOINT32INDEX PUSHINT32INDEX POPINT32INDEX VST1634.vsd Usage Considerations This directive can appear in the compilation command or any number of times in a Dseries compilation unit. INT32INDEX turns the INT32INDEX setting on for subsequent declarations.
Compiler Directives Example of INT32INDEX Directive NOINT32INDEX does not override INHIBITXX or NOINHIBITXX. Example of INT32INDEX Directive The following example shows the use of INT32INDEX, which always generates correct offsets, and NOINT32INDEX, which generates incorrect offsets in certain cases: ?INT32INDEX !Set INT32INDEX attribute ! for next declaration STRUCT .
Compiler Directives LARGESTACK Directive LARGESTACK Directive LARGESTACK sets the size of the extended stack in the automatic extended data segment. num-pages LARGESTACK = VST1635.vsd num-pages is the number of 2048-byte memory pages to allocate for the extended stack. Specify an unsigned decimal constant in the range 0 through 32,767. The default is the maximum extended stack space required by any single procedure or 64K bytes, whichever is greater.
Compiler Directives LIBRARY Directive LIBRARY Directive LIBRARY specifies the name of the TNS software user run-time library to be associated with the object file at run time. file-name LIBRARY VST1636.vsd file-name specifies a user run-time library to search before searching the system library to satisfy external references. file-name must be the name of a disk file. It cannot be the name of a TACL DEFINE or a TACL ASSIGN logical file.
Compiler Directives • LINES Directive To extend a single application’s code space To build user libraries, there are certain restrictions that user library files need to follow. For more information on user library restrictions, refer to the Binder Manual. LINES Directive LINES sets the maximum number of output lines per page. LINES num-lines = VST1637.vsd num-lines is the maximum number of lines per page. Specify an unsigned decimal constant in the range 10 through 32,767.
Compiler Directives Usage Consideration Usage Consideration This directive can appear in the compilation command or anywhere in the source code. LIST turns the listing setting on for subsequent code. LIST has no effect if SUPPRESS is in effect. LIST is required by the ABSLIST, CODE, CROSSREF, DEFEXPAND, FMAP, GMAP, ICODE, INNERLIST, MAP, PAGE, and PRINTSYM directives. To list cross-references, LIST and NOSUPPRESS must be in effect at the end of the source file.
Compiler Directives LMAP Directive 2. In this example, PUSHLIST pushes the current listing setting (LIST) onto the directive stack, NOLIST suppresses listing of system declarations, and POPLIST resumes the listing: !Default listing setting is LIST ?PUSHLIST, NOLIST, SOURCE $SYSTEM.SYSTEM.EXTDECS ( ? PROCESS_GETINFO_, FILE_OPEN_, WRITEREADX, READX) ?POPLIST LMAP Directive LMAP lists load-map and cross-reference information. The default is LMAP ALPHA.
Compiler Directives Example of LMAP Directive If LMAP is in effect, NOLMAP with options suppresses the specified load maps. NOLMAP without options suppresses all load maps. LMAP has no effect if SUPPRESS is in effect. Example of LMAP Directive This example illustrates the LMAP directive: ?LMAP (LOC, XREF) !Adds LOC and XREF to ALPHA default !Some code here ?NOLMAP (XREF) !Deletes only XREF from the listing MAP Directive MAP lists the identifier maps. The default is MAP.
Compiler Directives Example of MAP Directive Map Listing MAP lists sublocal identifiers after each subprocedure, local identifiers after each procedure, and global identifiers after the last procedure in the source program.
Compiler Directives OPTIMIZE Directive OPTIMIZE Directive OPTIMIZE specifies the level at which the compiler optimizes the object code. level OPTIMIZE = VST1642.vsd level is the level of optimization, specified as 0, 1, or 2. The default level is 1.
Compiler Directives PAGE Directive 2. When a statement references a variable that was assigned a value by the previous statement, level 2 transforms a store and a load into a nondestructive store: STOR L+1 !Transform to NSTO L+1 LOAD L+1 PAGE Directive PAGE optionally prints a heading and causes a page eject. PAGE heading-string " " VST1643.vsd heading-string is a character string of up to 82 characters, specified on a single line and enclosed in quotation marks.
Compiler Directives PEP Directive PEP Directive PEP specifies the size of the procedure entry-point (PEP) table. pep-table-size PEP = VST1644.vsd pep-table-size is the number of words to allocate for the PEP table. Specify an unsigned decimal constant in the range 3 through 512. Usage Considerations The PEP directive can appear in the compilation command or anywhere in the source code.
Compiler Directives PRINTSYM Directive PRINTSYM Directive PRINTSYM lists symbols. The default is PRINTSYM. PRINTSYM NOPRINTSYM VST1645.vsd Usage Considerations This directive can appear in the compilation command or anywhere in the source code. You can use PRINTSYM and NOPRINTSYM to list individual symbols or groups of symbols, such as global, local, or sublocal declarations. PRINTSYM turns the symbol-listing setting on for subsequent declarations.
Compiler Directives Usage Considerations Usage Considerations RELOCATE can appear in the compilation command or in the source code. RELOCATE affects only the source code that follows it, however, so it is safest to specify it at the beginning of the compilation. The compiler checks for nonrelocatable data only if RELOCATE appears. Use RELOCATE when the primary global data area (the area below word address G[256]) is relocatable.
Compiler Directives Usage Considerations toggle-name is a named toggle to turn off. You must specify each named toggle you want to turn off. toggle-number is a numeric toggle to turn off. Specify an unsigned decimal constant in the range 1 through 15. Leading zeros are ignored. RESETTOG with no arguments turns off all numeric toggles but does not affect named toggles. Usage Considerations RESETTOG can appear anywhere in the source code and in the compilation command.
Compiler Directives Example of RESETTOG Directive Example of RESETTOG Directive In this example, RESETTOG turns off two of six toggles that were turned on by SETTOG.
Compiler Directives Example of ROUND Directive truncated assignment value is 5 or more, a one is added to the absolute value of the final least significant digit. NOROUND turns the rounding setting off. That is, rounding does not occur when a FIXED value is assigned to a FIXED variable that has a smaller fpoint. If the fpoint of the assignment value is greater than that of the variable, the assignment value is truncated and some precision is lost.
Compiler Directives Example of RP Directive If you manipulate data stack contents without the compiler’s knowledge (with CODE statements, for example), you should use the RP directive to calibrate the compiler’s internal RP count. If the compiler decrements (or increments) the RP register below (or above) its initial value in a procedure or subprocedure, the compiler issues a warning of RP register underflow (or overflow).
Compiler Directives RUNNAMED Directive RUNNAMED Directive RUNNAMED causes a D-series object file to run on a D-series system as a named process even if you do not provide a name for it. RUNNAMED VST1650.vsd Usage Considerations The RUNNAMED directive can appear in the compilation command or anywhere in the source code. It can appear any number of times in a compilation unit, but need appear just once in the compilation unit. Use RUNNAMED only with D-series compilation units.
Compiler Directives Usage Considerations SAVEABEND NOSAVEABEND VST1651.vsd Usage Considerations SAVEABEND and NOSAVEABEND can appear in the compilation command or anywhere in the source program. The compiler uses the last specification when it builds the object file. SAVEABEND requests a save file and sets the INSPECT directive on; at run time the Inspect product must be available on the system that runs the process. NOSAVEABEND suppresses the save file but does not affect the INSPECT directive setting.
Compiler Directives SAVEGLOBALS Directive SAVEGLOBALS Directive SAVEGLOBALS saves all global data declarations in a file for use in subsequent compilations that specify the USEGLOBALS directive. file-name SAVEGLOBALS define-name assign-name VST1652.vsd file-name is the name of a disk file to which the compiler is to write the global data declarations. If file-name already exists, the compiler purges the existing file and creates an unstructured global declarations file that has a file code of 105.
Compiler Directives Usage Considerations Saving Global Data Declarations When you compile with SAVEGLOBALS, the compiler saves the global data declarations in a file. If you make no changes in the global data declarations, you can use the saved declarations in subsequent compilations and reduce the compilation time.
Compiler Directives Usage Considerations Retrieving Global Data Declarations After a SAVEGLOBALS compilation completes successfully, you can specify the following directives in a USEGLOBALS compilation to retrieve the global data declarations and initializations: Directive in USEGLOBALS Compilation Effect in Same USEGLOBALS Compilation USEGLOBALS Retrieves global data declarations; suppresses compilation of text lines and SOURCE directives (but not other directives) until BEGINCOMPILATION appears SEAR
Compiler Directives Examples of SAVEGLOBALS Directive Examples of SAVEGLOBALS Directive 1. The following source file (MYPROG) is compiled in examples 2 through 5, which show how the SAVEGLOBALS, USEGLOBALS, BEGINCOMPILATION, SEARCH, and SYNTAX directives interact: !Source file MYPROG !Unless USEGLOBALS (examples 3 and 5) is in effect, ! compile the entire source file.
Compiler Directives SEARCH Directive 5. After you correct any errors, you can recompile MYPROG as follows, assuming there are no global initializations: TAL /IN myprog/; USEGLOBALS talsym SEARCH Directive SEARCH specifies object files from which BINSERV can resolve unsatisfied external references and validate parameter lists at the end of compilation. By default, BINSERV does not attempt to resolve unsatisfied external references.
Compiler Directives Usage Considerations Usage Considerations SEARCH can appear in the compilation command or anywhere in the source code. A SEARCH directive can extend to continuation lines, each line beginning with ? in column 1. Search List The compiler sends the list of object files from each SEARCH directive to BINSERV. BINSERV appends the file names in the order specified to the master search list for the current source file.
Compiler Directives Examples of SEARCH Directive Examples of SEARCH Directive 1. This example shows SEARCH directives for a search in the order FILE1, FILE2, FILE3, and FILE4: ?SEARCH (file1, file2) ?SEARCH (file3, file4) 2.
Compiler Directives Example of SECTION Directive Example of SECTION Directive 1. This example gives a different section name, such as SORT_PROC and NEXT_PROC, to each procedure in a source library: !File ID APPLLIB ?SECTION sort_proc PROC sort_on_key(key1, key2, key3, length); INT .key1, .key2, .key3, length; BEGIN !Lots of code END; ?SECTION next_proc 2.
Compiler Directives Usage Considerations Usage Considerations SETTOG can appear anywhere in the source code and in the compilation command. SETTOG without a parenthesized list must be the last directive on the line. When SETTOG has a parenthesized list, other directives can follow on the same line, with a comma separating the closing parenthesis from the next directive. SETTOG interacts with the IF, IFNOT, and ENDIF directives.
Compiler Directives SOURCE Directive 2. In this example, IFNOT tests a toggle for the off state, finds it is turned on, and causes the compiler to skip the source text between IFNOT SCANNER and ENDIF SCANNER: ?SETTOG scanner !Some code here !Turn toggle SCANNER on ?IFNOT scanner PROC skipped; BEGIN !More code here END; ?ENDIF scanner !Test toggle for off state !Find it on; skip procedure !End of skipped procedure 3. In this example, SETTOG turns on toggle 1.
Compiler Directives Usage Considerations define-name is the name of a TACL MAP DEFINE that refers to a disk file from which the compiler is to read source code. assign-name is a logical file name you have equated to a disk file (from which the compiler is to read source code) by issuing a TACL ASSIGN command. section-name is an identifier specified in a SECTION directive within the sourced-in file. If the compiler does not find section-name in the specified file, it issues a warning.
Compiler Directives Examples of SOURCE Directive Effect of Other Directives If LIST and NOSUPPRESS are in effect after a SOURCE directive completes execution, the compiler prints a line identifying the source file to which it reverts and begins reading at the line following the SOURCE directive. If USEGLOBALS is in effect, the compiler ignores all SOURCE directives until it encounters BEGINCOMPILATION. For more information on how these directives interact, see the SAVEGLOBALS Directive on page 16-75.
Compiler Directives STACK Directive STACK Directive STACK sets the size of the data stack in the user data segment. STACK num-pages = VST1657.vsd num-pages is the number of 2048-byte memory pages to allocate for the data stack (storage area for local and sublocal data). Specify an unsigned decimal constant in the range 0 through 32. Usage Considerations STACK can appear in the compilation command or anywhere in the source code.
Compiler Directives Usage Considerations subtype-number specifies the process subtype number by which the object file is to identify itself to other processes. Specify an unsigned decimal constant in the range 0 through 63. The default process subtype is 0. Usage Considerations SUBTYPE can appear in the compilation command or anywhere in the source code. If SUBTYPE appears more than once in a compilation, the compiler uses the subtype number specified in the last SUBTYPE directive it encounters.
Compiler Directives Usage Considerations SUPPRESS NOSUPPRESS VST1659.vsd Usage Considerations This directive can appear in the compilation command or anywhere in the source code. Both SUPPRESS and NOSUPPRESS can appear in the source code. SUPPRESS suppresses all compilation listings except the compiler leader text, diagnostic messages, and the trailer text. That is, the compiler and BINSERV produce diagnostic and trailer text, but BINSERV does not produce the load maps.
Compiler Directives Usage Considerations Usage Considerations SYMBOLPAGES can appear only in the compilation command, not in the source code. SYMBOLPAGES sets the size of the compiler’s internal symbol table, which resides in the automatic extended data segment. The compiler uses the symbol table as a temporary storage area, for example, when processing variables and SQL statements. For more information on SQL, see the NonStop SQL Programming Manual for TAL.
Compiler Directives Examples of SYMBOLS Directive structure definition that was not saved, the compilation terminates with an error message from SYMSERV. Deleting Symbols After debugging the program, you can use Binder to: • Create a new object file without symbols. The old object file remains intact, but you drastically reduce what you can do with the Inspect product.
Compiler Directives SYNTAX Directive END; ?NOSYMBOLS !Stop saving symbols SYNTAX Directive SYNTAX checks the syntax of the source text without producing an object file. SYNTAX VST1662.vsd Usage Considerations SYNTAX can appear in the compilation command or anywhere in the source code. You can use the compiler to detect syntax errors before you code large portions of the source code. If SYNTAX is in effect, the compiler checks the syntax of the source text without producing an object file.
Compiler Directives TARGET Directive produced no object file, you need not use SEARCH to retrieve global initializations as you normally would when you use USEGLOBALS.) TAL /IN myprog/; USEGLOBALS talsym, SYNTAX TARGET Directive TARGET lets you specify the target system for which conditional code is written. For more information on the syntax for TARGET, see Section 15, Privileged Procedures.
Compiler Directives Usage Considerations Usage Considerations USEGLOBALS can appear either in the compilation command or in the source code before any global data declarations. If USEGLOBALS appears anywhere else, the compiler issues a warning and ignores the directive. Note. Do not use USEGLOBALS and SAVEGLOBALS in the same compilation unit. If you do, the compiler issues an error message and uses only the first of the two directives. Do not use USEGLOBALS and CROSSREF in the same compilation unit.
Compiler Directives Example of USEGLOBALS Directive Whenever you switch to a new version of the compiler, you must recompile the source code using SAVEGLOBALS to create a new global declarations file.
Compiler Directives Usage Considerations Usage Considerations WARN or NOWARN can appear in the compilation command or anywhere in the source code. To print selected warnings, you must specify WARN before any NOWARN directives. If you specify NOWARN first, any subsequent WARN warning-number directives have no effect. You can use NOWARN when a compilation produces a warning and you have determined that no real problem exists.
A Error Messages This appendix describes compiler messages: • • • Compiler initialization messages Error messages Warning messages Compiler Initialization Messages Initialization messages are unnumbered diagnostic messages that can appear during compiler initialization. If the OUT file is available, the compiler sends the messages there; otherwise, it sends them to the home terminal.
Error Messages Error Messages To indicate the location of the error or potential error, the compiler prints a circumflex symbol (^) in the source listing. The circumflex usually appears under the first character position following the detection of the error. (However, if the error involves the relationship of the current source line with a previous line, the circumflex does not always point to the actual error.) On the next line, the compiler displays a message describing the nature of the error.
Error Messages • 1 ° A substructure that has an odd length, starts with an INT item, and has the same nonzero upper and lower bounds. The compiler does not pad this substructure properly. ° ° Syntax errors within a structure declaration. ° Parameter identifiers not separated by commas in the formal parameter list of a procedure declaration. ° ° ° ° ° ° ° A formal parameter identifier that is a reserved keyword.
Error Messages 2 2 Identifier declared more than once Duplicate identifiers are declared within this scope. Replace one of the identifiers with an identifier that is unique within this scope. For example, identifier RESULT is declared twice within a procedure: PROC p; BEGIN LABEL result; INT result; !Duplicate identifier END; 3 Recursive DEFINE invocation A reference to a DEFINE declaration that is recursive appears in your source code. The message appears when the compiler expands the DEFINE.
Error Messages 6 Declare most global arrays and structures by using indirection. Declare very large global arrays and structures by using extended indirection. 6 Illegal digit A numeric constant contains a digit that is incorrect in the stated base of the constant. For example, an octal constant contains the digit 9. Correct the constant in accordance with Section 3, Data Representation. 7 String overflow A character string appears that: • • Contains more than 128 characters.
Error Messages 10 10 Address range violation This message indicates one of the following conditions: • A declaration specifies addresses beyond the allowable range; for example: INT i = 'G' + 300; Declare at most 256 words of directly addressable data relative to 'G', 127 words relative to 'L', and 31 words relative to 'S'. • • • • • • • A subprocedure parameter or a sublocal variable cannot be accessed because other items have been pushed onto the data stack.
Error Messages • • 12 A CALL statement passes a value parameter to a procedure that expects a reference parameter. Replace the parameter indicated by parameter-number with a reference parameter. A CODE statement includes indirect branches such as the following. Remove any indirect branches from the CODE statement. CODE (BANZ .
Error Messages 14 14 Only initialization with constant value(s) is allowed A global initialization expression includes variables. Initialize global data only with constant expressions, which can include @identifier when used with standard functions that return a constant value. @ accesses the address of identifier, which must be a nonpointer variable with a 16-bit address. For example: STRUCT .st[0:1]; BEGIN INT a; INT b; INT c; END; INT .p1 := @st.b; -- error 14 INT .p2 := @st '+' $OFFSET (st.
Error Messages • • 17 The SQL PAGES value The combined SQL PAGES and SYMBOLPAGES values Reduce the value that is too large, or specify another swap volume. 17 Formal parameter type specification is missing A declaration for a formal parameter is missing in the procedure or subprocedure header. Declare the missing formal parameter or remove its identifier from the formal parameter list. 18 Illegal array bounds specification Incorrect bounds appear in an array declaration.
Error Messages 21 21 Label declared more than once The same identifier appears more than once as a statement label in the same scope. Specify label identifiers that are unique within a scope. For example, MYLABEL appears twice as statement labels within a procedure : PROC q; BEGIN mylabel: !Some statements here mylabel: !More statements here END; !Duplicate statement label 22 Only standard indirect variables are allowed The extended (32-bit) indirection symbol (.
Error Messages 26 26 Routine declared forward more than once More than one FORWARD declaration for the given procedure or subprocedure is present. Declare a procedure or subprocedure FORWARD only once. Delete all duplicate FORWARD declarations. 27 Illegal syntax A statement or the line preceding it contains one or more syntax errors.
Error Messages 29 29 Illegal use of identifier name An identifier appears in the formal parameter specification of a procedure or subprocedure declaration but not in the formal parameter list. Either include the identifier in the formal parameter list or remove the identifier from the formal parameter specification. 30 Only label or USE variable allowed A DROP statement specifies an incorrect identifier. In the DROP statement, specify the identifier of a label or a USE statement variable.
Error Messages • • 33 An undeclared variable prefixed by @ is passed as an actual parameter. The compiler treats the undeclared variable as a label, so if the allocated size of the formal parameter does not match that of the label address, the compiler issues the error. Declare the variable before passing it as a parameter. A character string is assigned to a FIXED or REAL(64) variable. Change the value from a character string, or change the data type.
Error Messages 38 38 Illegal index register specification You tried to reserve more than three registers for use as index registers. Use a DROP statement to reduce the number of reserved registers. 39 Open failed on file file-name The compiler could not open the file you specified in a SOURCE directive. If NOABORT is in effect, the compiler prompts you for the name of a source file. You can take any of the following alternative actions: • • • • Retry the same source file name.
Error Messages • 41 To correct the preceding error, assign the expression to a STRING or INT variable and then append the bit-deposit field to the variable: INT a, b, var; !Code to store values in A and B var := a + b; var.<2:5> := 0; 41 Undefined ASSERTION procedure: proc-name An ASSERT statement invokes an undeclared procedure specified in an ASSERTION directive. Either declare the procedure or specify an existing procedure in the ASSERTION directive.
Error Messages 44 44 Illegal Instruction The specified mnemonic does not match those for the NonStop system. As of release C00, the compiler does not generate code for the NonStop 1+ system. Replace the instruction with one described in the System Description Manual for your system. 45 Only INT(32) value(s) allowed A value of the wrong data type appears. In this context, specify an INT(32) value. 46 Illegal indirection specification The period symbol (.
Error Messages 50 50 Cannot drop this Label 50 Cannot drop this Label A DROP statement refers to an undeclared or unused label. Drop a label only after you declare it and after the compiler reads all references to it. Dropping a label saves symbol table space and allows its reuse (as in a DEFINE macro). 51 Index register allocation failed The compiler is unable to allocate an index register.
Error Messages 55 55 Illegal SUBPROC attribute A subprocedure declaration includes an incorrect subprocedure attribute such as EXTERNAL or EXTENSIBLE. Remove the incorrect attribute from the subprocedure declaration. Subprocedures can only have the VARIABLE attribute. 56 Illegal use of USE variable A USE variable is used incorrectly. Correct the usage in accordance with the descriptions of the USE statement or the optimized FOR statement.
Error Messages 61 61 Actual/formal parameter count mismatch A call to a procedure or subprocedure supplies more (or fewer) parameters than you defined in the procedure or subprocedure declaration. Supply all required parameters, and supply at least commas for all optional parameters. 62 Forward/external parameter count mismatch The number of parameters specified in a FORWARD or EXTERNAL declaration differs from that specified in the procedure body declaration.
Error Messages 66 66 Unable to process remaining text This message is usually the result of a poorly structured program, when numerous errors are compounded and concatenated to the point where the compiler is unable to proceed with the analysis of the remaining source lines. Review the code to determine how to correct the errors. 67 Source commands nested too deeply The compilation unit nests SOURCE directives to more than seven levels, not counting the original outermost source file.
Error Messages 71 71 Only INT or STRING STRUCT pointers are allowed A structure pointer of an incorrect data type (attribute) occurs. Specify only the INT or STRING attribute when you declare structure pointers. 72 Indirection must be supplied An indirection symbol is missing from a pointer declaration. When you declare a pointer, specify an indirection symbol preceding the pointer identifier. 73 Only a structure identifier may be used as a referral An incorrect referral occurs in a declaration.
Error Messages • • • • 77 In a group comparison expression In a SCAN or RSCAN statement As an actual reference parameter As @identifier in an expression 77 Unsigned variables may not be subscripted An indexed (subscripted) reference to an UNSIGNED simple variable occurs. Remove the index from the identifier of the UNSIGNED simple variable. 78 Invalid number form A floating-point constant appears in an incorrect form.
Error Messages 82 82 CROSSREF does not work with USEGLOBALS The USEGLOBALS directive appears in a source file submitted to the stand-alone Crossref product. The compiler issues error 82 and stops the Crossref product. Before resubmitting the source file to the Crossref product, remove the USEGLOBALS directive from the source file. 83 CPU type must be set initially A CPU directive appears in the wrong place. Specify this directive preceding any data or procedure declarations.
Error Messages 88 88 Expression too complex. Please simplify The current expression is too complex. The compiler’s stack overflowed and the compilation terminated. Simplify the expression. 89 Only arrays of simple data types can be declared read-only A structure declaration contains = 'P', which is restricted to read-only array declarations. Either remove = 'P' from the structure declaration, or replace the structure declaration with a read-only array declaration.
Error Messages 94 94 Declaration must be in a data block An unblocked global data declaration appears after a BLOCK declaration. Either place all unblocked global declarations inside BLOCK declarations or place them before the first BLOCK declaration or SOURCE directive that includes a BLOCK. This message occurs only if the compilation begins with a NAME declaration.
Error Messages 99 99 Initialization list exceeds space allocated A constant list contains values that exceed the space allocated by the data declaration. List smaller values in the constant list or declare larger variables. 100 Nested parametric-DEFINE definition encountered during expansion Nesting of DEFINE declarations occurs. Remove the DEFINE declaration that is nested within another DEFINE declaration.
Error Messages 104 104 This procedure has missing label - label-name The procedure refers to either: • • A label identifier that is missing from the procedure An undeclared variable prefaced with @ in an actual parameter list Either use label-name in the procedure or declare the variable. 105 A secondary entry point is missing - entry-point-name The entry point is not present in the procedure. Declare an entry-point identifier and use it in the procedure.
Error Messages 110 110 This case label (or range) overlaps a previously used case label - n The value n appears as a case label more than once in a labeled CASE statement. Specify unique case labels within a CASE statement. 111 The number of sparse case labels is limited to 63 Too many case labels appear in a labeled CASE statement. Specify no more than 63 case labels.
Error Messages 115 115 Missing FOR part The FOR count clause is missing from a move statement. Include the FOR count clause in the move statement. 116 Illegal use of period prefix An incorrect use of the period (.) prefix occurs. Use this prefix only as follows: • • • As an indirection symbol in declarations As a separator in qualified identifiers of structure items, as in MYSTRUCT.SUBSTRUCT.
Error Messages 120 120 Only type INT and INT(32) index expressions are allowed An index expression of the wrong data type appears. Specify an INT or INT(32) index expression. 121 Only STRUCT items are allowed here An incorrect argument to the $BITOFFSET function appears. Specify only a structure item as the $BITOFFSET argument.
Error Messages 125 125 MOVE or GROUP COMPARISON count-unit must be BYTES, WORDS, or ELEMENTS An incorrect count-unit appears in a move statement or in a group comparison expression. Specify the count-unit as BYTES, WORDS, or ELEMENTS only. 126 Initialization of local extended arrays is not allowed An initial value appears in a local extended array declaration. Remove the initialization from the declaration and use an assignment statement instead.
Error Messages 131 131 Procedure code space exceeds 32K words A single procedure is larger than 32K words long. Reduce the size of the procedure. 132 Compiler internal logic error detected in code generator The code generator detected an internal logic error. Report this occurrence to HP and include a copy of the complete compilation listing (and source, if possible). 133 Compiler label table overflow The code generator detected a label table overflow.
Error Messages 136 136 Compiler relative reference table overflow The compiler’s relative reference table overflowed. Report this occurrence to HP and include a copy of the complete compilation listing (and source, if possible). 137 Cannot purge error file file-name - File system error number The compiler encountered a file error when it tried to purge an error file whose name was specified in an ERRORFILE directive. The message includes the name of the file and the number of the file system error.
Error Messages 141 141 Invalid declaration for string component of string parameter An incorrect string parameter appears in a parameter pair specification of the form string:length. Declare the string parameter as a standard indirect or extended indirect STRING array. 142 String parameter pair expected A CALL statement passes an actual parameter to a procedure that expects a parameter pair.
Error Messages 147 147 Identifier for SQLMEM address must be an extended string pointer. An incorrect MAPPED address value appears in the SQLMEM directive. Specify the address value as a constant or an extended indirect identifier of type STRING. The LITERAL identifier is interpreted when an EXEC SQL statement occurs, not when the directive occurs. 148 Exceeded allocated space for SQLMEM MAPPED SQL data structures need more space than is allocated.
Error Messages 152 152 Type mismatch for SQL attribute An incorrect SQL data type attribute occurs for a TAL variable. Specify an SQL data type attribute that matches the TAL data type of the variable. 153 Length mismatch for SQL attribute The length of the data provided in the SQL attribute does not match the length of the data for the variable. Specify data having a length that conforms to the data type of the variable.
Error Messages 160 160 Only one language attribute is allowed More than one language attribute appears in a procedure declaration. Specify only one of the following language attributes following the LANGUAGE keyword (and only in a D-series EXTERNAL procedure declaration): C COBOL FORTRAN PASCAL UNSPECIFIED 161 Language attribute only allowed for external procedures A language attribute appears in a procedure declaration that is not specified as being EXTERNAL.
Error Messages 165 165 Procedure was previously declared with a public name The previous EXTERNAL procedure declaration includes a public name, and the current procedure declaration is a secondary entry point. Remove the public name from the EXTERNAL procedure heading. 166 Illegal public name encountered An incorrect public name appears.
Error Messages 176 STRING .s[0:79]; INT i:= 1; INT j:= 1; CALL p1 ($OPTIONAL (i < 9, s:i), !Parameter pair $OPTIONAL (j > 2, j) ); !Parameter END; 176 The second argument of $OPTIONAL must be a string parameter pair The called procedure declares a parameter pair, but the caller does not specify a parameter pair as the second argument to $OPTIONAL. Replace the incorrect argument with a parameter pair to match the specification in the called procedure. See the example shown for Error 175.
Error Messages Warning Messages Warning Messages The following messages indicate conditions that might affect program compilation or execution. If you get any warning messages, check your code carefully to determine whether you need to make corrections. 0 All index registers are reserved Three index registers are already reserved by USE statements. Three is the maximum number of index registers that you can reserve. The compiler assigned the last identifier to an already allocated index register.
Error Messages 5 5 PEP size estimate was too small Your PEP estimate (in the PEP directive) is not large enough to contain all the entries required. BINSERV has allocated appropriate additional space. 6 Invalid ABSLIST addresses may have been generated When the file reaches the 64K-word limit, the compiler disables ABSLIST, starts printing offsets relative to the procedure base instead of to the code area base, and emits this warning.
Error Messages 9 9 RP or S register mismatch An operation contains conflicting instructions for the RP (register pointer) or the S register that the compiler cannot resolve. An example of RP conflict is: IF alpha THEN STACK 1 ELSE STACK 1D; An example of S conflict is the following statement. The setting of the S register depends on the value of ALPHA, which the compiler cannot determine at compile time.
Error Messages 13 In either case, the compiler ignores the directive. Enter the correct option or remove the stray characters. 13 Value out of range A value exceeds the permissible range for its context (for example, a shift count is greater than the number of existing bits). If the value is important to your program, use a value that falls within the permissible range.
Error Messages 17 17 Initialization value too complex An initialization expression is too complicated to evaluate in the current context. If your program is adversely affected, simplify the expression. 19 PROC not declared FORWARD with ABSLIST option on A PEP directive or a FORWARD declaration is missing. When you use the ABSLIST directive, the compiler must know the size of the PEP table before the procedure occurs in the source program.
Error Messages 24 of the constant list. If your program is adversely affected, correct the group comparison expression as described in Section 4, Expressions. 24 A USE register has been overwritten The evaluation of an expression caused the value in a USE register to be overwritten. Multiplication of two FIXED values, for example, can cause this to occur. If this affects your program adversely, use a local variable in place of the USE register.
Error Messages 29 29 One or more illegal attributes Incorrect attributes appear in a subprocedure declaration, which can have only the VARIABLE attribute. The compiler ignores all attributes but VARIABLE. 32 RETURN not encountered in typed PROC or SUBPROC A RETURN statement is missing from a function or the RP counter of the compiler is 7 (empty register stack).
Error Messages 36 36 Expression passed as reference parameter A calling sequence passes a parameter in the form @identifier to a procedure or subprocedure that expects an extended pointer as a parameter. If the intent is to pass the address of the pointer rather than the address stored in the pointer, no error is involved. 37 Array access changed from indirect to direct An indirect array is declared inside a subprocedure or is declared as a read-only array.
Error Messages 41 41 File system DEFINEs are not enabled A TACL DEFINE name appears in place of a file name, but the system is not configured to use TACL DEFINEs. Error 39 (Open failed on file-name) follows warning 41. Issue the TACL commands that enable the TACL DEFINE. 42 Specified bit extract/deposit may be invalid for strings An incorrect bit specification occurs. To access or deposit bits in a STRING item, specify bit numbers 8 through 15 only.
Error Messages 46 46 Non-relocatable global reference A declaration that refers to a G-relative location appears when the RELOCATE directive is in effect and all primary global data is relocatable. This reference might be incorrect if BINSERV relocates the data blocks when it builds the object file. Either change the declaration of the identifier or, if NAME (and BLOCK) statements do not appear, delete the RELOCATE directive.
Error Messages 52 52 The compiler no longer generates code for NonStop 1+ systems As of release C00, the compiler no longer generates code for the NonStop 1+ system. Instructions that apply only to NonStop 1+ systems are CBDA, CBDB, CBUA, CBUB, DS, RMD, SCAL, SLRU, LWBG, MAPP, MNGS, MNSG, MNSS, UMPP, XINC, XSMS, ZZZZ. A CODE statement that specifies such an instruction causes error 44 (Illegal instruction).
Error Messages 57 57 SAVEGLOBALS and USEGLOBALS cannot appear in the same compilation Two mutually exclusive directives appear in the same compilation unit. To save global declarations in a file for use by a later compilation, retain SAVEGLOBALS and delete USEGLOBALS. To make use of the saved global declarations, retain USEGLOBALS and delete SAVEGLOBALS. 58 Code space exceeds 64k, ABSLIST has been disabled TAL compiler versions B00 and later support up to 16 * 64K words of source code.
Error Messages 62 62 Extended address of STRING p-rel. array is incorrect if reference is more than 32K words from array The STRING read-only array is declared in a procedure or subprocedure, and the compiler may generate an incorrect address when converting the address of a global STRING read-only array to an extended address for use in a move statement, a group comparison, or a procedure call. 63 A file system DEFINE name is not permitted in a LIBRARY directive.
Error Messages 67 67 SQLMAP and NOSQLMAP options are mutually exclusive. The most recently specified option is in effect SQL directives specifying the SQLMAP and NOSQLMAP options appear in the source code. The compiler applies the most recently specified option. If this is not your intent, specify only one of the two options. 68 Cannot access SSV An incorrect ASSIGN SSV (Search Subvolume) number occurs. Specify the correct SSV number.
Error Messages 75 75 There are too many ASSIGN commands More than 75 ASSIGN commands appear in the compilation. Reduce the number of ASSIGN commands to 75 or fewer. 76 Cannot use $OFFSET or $LEN until base structure is complete $LEN or $OFFSET is applied to an unfinished structure or to a substructure that is declared in an unfinished structure. The compiler does not calculate these values until the encompassing structure is complete. Complete the encompassing structure.
Error Messages 81 81 The PAGES option of the SQL directive must be on the command line An SQL directive specifying the PAGES option appears in a directive line. The compiler ignores this directive. Specify this directive only in the compilation command. 83 Too many user-defined named toggles You have exceeded the maximum number of named toggles. Use fewer named toggles. 84 Invalid parameter list An incorrect parameter list appears in a procedure or subprocedure declaration.
Error Messages • 89 You pass the content of an extended (32-bit) pointer by reference to a procedure that expects the content of a standard (16-bit) pointer. 89 CROSSREF does not work with USEGLOBALS The CROSSREF and USEGLOBALS directives both appear in a compilation unit. The compiler issues warning 89 and turns off the CROSSREF directive. If you need to collect cross-reference information, remove the USEGLOBALS directive from the compilation unit.
Error Messages SYMSERV Messages SYMSERV Messages The following message might appear during compilation: SYMSERV FATAL ERROR This error appears only when the compiler detects a logic error within its operation. If you are using versions of the TAL compiler and SYMSERV from the same release, and if no other error message appears that would explain this behavior, please report this occurrence to HP. Include a copy of the complete compilation listing and the source, if possible.
Error Messages Common Run-Time Environment Messages Appendix A—526371.
B TAL Syntax Summary (Railroad Diagrams) This appendix provides a syntax summary of railroad diagrams for specifying: • • • • • • Constants Expressions Declarations Statements Standard Functions Compiler Directives Constants The following syntax diagrams describe: • • • • • • • Character string constants (all data types) STRING numeric constants INT numeric constants INT(32) numeric constants FIXED numeric constants REAL and REAL(64) numeric constants Constant lists Character String Constants A charac
TAL Syntax Summary (Railroad Diagrams) STRING Numeric Constants STRING Numeric Constants A STRING numeric constant consists of an unsigned 8-bit integer. integer base VSTB02.vsd INT Numeric Constants An INT numeric constant is a signed or unsigned 16-bit integer. integer + base - VSTB03.vsd INT(32) Numeric Constants An INT(32) numeric constant is a signed or unsigned 32-bit integer. integer + D base D% - VSTB04.
TAL Syntax Summary (Railroad Diagrams) REAL and REAL(64) Numeric Constants REAL and REAL(64) Numeric Constants A REAL numeric constant is a signed 32-bit floating-point number that is precise to approximately 7 significant digits. A REAL(64) numeric constant is a signed 64-bit floating-point number that is precise to approximately 17 significant digits. integer . offset + D exponent + D% - VSTB06.vsd Constant Lists A constant list is a list of one or more constants.
TAL Syntax Summary (Railroad Diagrams) Expressions constant-list-seq constant repetition-constant-list , VSTB09.vsd Expressions The following syntax diagrams describe: • • • • • • • • Arithmetic expressions Conditional expressions Assignment expressions CASE expressions IF expressions Group comparison expressions Bit extractions Bit shifts Arithmetic Expressions An arithmetic expression is a sequence of operands and arithmetic operators that computes a single numeric value of a specific data type.
TAL Syntax Summary (Railroad Diagrams) Conditional Expressions Conditional Expressions A conditional expression is a sequence of conditions and Boolean or relational operators that establishes the relationship between values. condition NOT AND condition OR NOT VSTB011.vsd Assignment Expressions The assignment expression assigns the value of an expression to a variable. variable := expression VSTB012.vsd CASE Expressions The CASE expression selects one of several expressions.
TAL Syntax Summary (Railroad Diagrams) IF Expressions IF Expressions The IF expression conditionally selects one of two expressions, usually for assignment to a variable. IF condition expression THEN expression ELSE VSTB014.vsd Group Comparison Expressions The group comparison expression compares a variable with a variable or a constant. var1 relational-operator var2 count FOR count - unit next addr -> constant [ ] constant constant - list VSTB015.
TAL Syntax Summary (Railroad Diagrams) Bit Shifts Bit Shifts A bit shift operation shifts a bit field a specified number of positions to the left or to the right within a variable without altering the variable. shift-operator int-expression positions dbl-expression VSTB017.
TAL Syntax Summary (Railroad Diagrams) LITERAL DEFINEs identifier ; constant = , VSTB018.vsd DEFINEs A DEFINE associates an identifier (and parameters if any) with text. DEFINE identifier = param name ( define body # ; ) , , VSTB019.vsd Simple Variable Declarations The following syntax diagram describes simple variable declarations: Simple Variables A simple variable associates an identifier with a single-element data item of a specified data type.
TAL Syntax Summary (Railroad Diagrams) Array Declarations type STRING INT REAL ( width ) UNSIGNED ( width ) ( fpoint ) FIXED * VSTB021.vsd Array Declarations The following syntax diagrams describe array and read-only array declarations: Arrays An array associates an identifier with a one-dimensional set of elements of the same data type. type identifier [ lower bound upper bound : . .EXT ; ] := initialization , VSTB022.vsd Appendix B—526371.
TAL Syntax Summary (Railroad Diagrams) Structure Declarations Read-Only Arrays A read-only array associates an identifier with a one-dimensional and nonmodifiable set of elements of the same data type. A read-only array is located in a user code segment. type = identifier [ lower bound := 'p' upper bound : initialization ] ; , VSTB023.
TAL Syntax Summary (Railroad Diagrams) Template Structures Template Structures A template structure associates an identifier with a structure layout but allocates no storage for it. STRUCT identifier ( * ) structure - layout ; ; VSTB025.vsd Referral Structures A referral structure associates an identifier with a structure whose layout is the same as a previously declared structure and allocates storage for it. STRUCT identifier ( referral ) . .
TAL Syntax Summary (Railroad Diagrams) Arrays Declared in Structures Arrays Declared in Structures An array can be declared inside a structure. type identifier lower bound [ upper bound : ] ; , VSTB028.vsd Definition Substructures A definition substructure can be declared inside a structure. STRUCT identifier lower bound [ upper bound : ] substructure layout ; ; VSTB029.vsd Referral Substructures A referral substructure can be declared inside a structure.
TAL Syntax Summary (Railroad Diagrams) Fillers in Structures Fillers in Structures A filler is a byte or bit place holder in a structure. FILLER constant - expression ; BIT_FILLER VSTB031.vsd Simple Pointers Declared in Structures A simple pointer can be declared inside a structure. type identifier . ; .EXT , VSTB032.vsd Structure Pointers Declared in Structures A structure pointer can be declared inside a structure. STRING identifier . INT .EXT ( referral , ) ; VSTB033.
TAL Syntax Summary (Railroad Diagrams) Array Redefinitions Array Redefinitions An array redefinition associates a new array with a previous item at the same BEGINEND level of a structure. type identifier lower bound [ upper bound : = ] previous identifier ; VSTB035.vsd Definition Substructure Redefinitions A definition substructure redefinition associates a definition substructure with a previous item at the same BEGIN-END level of a structure.
TAL Syntax Summary (Railroad Diagrams) STRUCT Simple Pointer Redefinitions identifier referral ( ) previous identifier = [ lower bound upper bound : ; ] VSTB037.vsd Simple Pointer Redefinitions A simple pointer redefinition associates a new simple pointer with a previous item at the same BEGIN-END level of a structure. type identifier . previous identifier = ; .EXT VSTB038.
TAL Syntax Summary (Railroad Diagrams) Simple Pointers Simple Pointers A simple pointer is a variable you load with a memory address, usually of a simple variable or array, which you access with this simple pointer. type identifier . ; .EXT := initializatio n , VSTB040.vsd Structure Pointers A structure pointer is a variable you load with a memory address of a structure, which you access with this structure pointer. STRING INT identifier . ( referral ) .
TAL Syntax Summary (Railroad Diagrams) Equivalenced Simple Variables Equivalenced Simple Variables An equivalenced simple variable associates a new simple variable with a previously declared variable. type identifier previous identifier = ; [ index + offset ] , VSTB042.vsd Equivalenced Definition Structures An equivalenced definition structure associates a new definition structure with a previously declared variable. STRUCT identifier = previous identifier . .
TAL Syntax Summary (Railroad Diagrams) Equivalenced Referral Structures Equivalenced Referral Structures An equivalenced referral structure associates a new referral structure with a previously declared variable. STRUCT identifier ( referral ) . ENT = previous identifier ; [ index + offset ] VSTB044.vsd Equivalenced Simple Pointers An equivalenced simple pointer associates a new simple pointer with a previously declared variable. type . identifier ( previous - identifier .
TAL Syntax Summary (Railroad Diagrams) Equivalenced Structure Pointers Equivalenced Structure Pointers An equivalenced structure pointer associates a new structure pointer with a previously declared variable. STRING INT = . identifier ( referral ) .EXT previous - identifier ; [ index ] offset = - = VSTB046.
TAL Syntax Summary (Railroad Diagrams) type Base-Address Equivalenced Definition Structures identifier = base - address ; [ index + offset ] - , VSTB047.vsd Base-Address Equivalenced Definition Structures A base-addressed equivalenced definition structure associates a definition structure with a global, local, or top-of-stack base address. STRUCT identifier = base - address . .EXT ; [ index + offset structure - layout ; ] - VSTB048.vsd Appendix B—526371.
TAL Syntax Summary (Railroad Diagrams) Base-Address Equivalenced Referral Structures Base-Address Equivalenced Referral Structures A base-addressed equivalenced referral structure associates a referral structure with a global, local, or top-of-stack base address. STRUCT ( identifier referral ) . .EXT = base - address ; [ index + offset ] - VSTB049.
TAL Syntax Summary (Railroad Diagrams) Base-Address Equivalenced Structure Pointers Base-Address Equivalenced Structure Pointers A base-addressed equivalenced structure pointer associates a structure pointer with a global, local, or top-of-stack base address. STRING . ( referral ) .EXT INT = identifier base - address ; [ index + offset ] , VSTB051.vsd NAME and BLOCK Declarations The following syntax diagrams describe NAME and BLOCK declarations.
TAL Syntax Summary (Railroad Diagrams) BLOCK Procedure and Subprocedure Declarations identifier ; AT (0) PRIVATE BELOW (64) BELOW (256) END BLOCK data declaration ; ; VSTB053.vsd Procedure and Subprocedure Declarations The following syntax diagrams describe procedure, subprocedure, entry-point, and label declarations. Procedures A procedure is a program unit that is callable from anywhere in the program. Appendix B—526371.
TAL Syntax Summary (Railroad Diagrams) Procedures PROC identifier public-name-spec type parameter - list proc - attribute , ; proc - body param - spec ; EXTERNAL ; FORWARD VSTB054.vsd type STRING INT REAL ( width ) UNSIGNED ( width ) ( fpoint ) FIXED * Appendix B—526371.001 B -24 VSTB055.
TAL Syntax Summary (Railroad Diagrams) Procedures public-name-spec = " public - name " VSTB056.vsd parameter-list ( param - name ) param - pair , VSTB057.vsd param-pair string : length VSTB058.vsd Appendix B—526371.
TAL Syntax Summary (Railroad Diagrams) Procedures proc-attribute MAIN INTERRUP T RESIDENT CALLABLE PRIV VARIABLE EXTENSIBLE ( LANGUAGE count ) C COBOL FORTRAN PASCAL UNSPECIFIED Appendix B—526371.001 B -26 VSTB187.
TAL Syntax Summary (Railroad Diagrams) Procedures param - spec param - type param -name . .EXT ; ( referral ) , VSTB060.vsd param - type STRING INT REAL ( width ) UNSIGNED ( width ) FIXED ( fpoint ) * STRUCT PROC type PROC (32) VSTB061.vsd Appendix B—526371.
TAL Syntax Summary (Railroad Diagrams) Subprocedures proc - body BEGIN local-decl ; subproc-decl ; ; END statement ; VSTB062.vsd Subprocedures A subprocedure is a program unit that is callable from anywhere in the procedure. SUBPROC Identifier type parameter list VARIABLE ; subproc-body param -spec ; ; FORWARD VSTB063.vsd Appendix B—526371.
TAL Syntax Summary (Railroad Diagrams) Subprocedures type STRING INT REAL ( width ) UNSIGNED ( width ) ( fpoint ) FIXED * parameter - list ( param - name ) param - pair , VSTB065.vsd param - pair string : length VSTB066.vsd Appendix B—526371.001 B -29 VSTB064.
TAL Syntax Summary (Railroad Diagrams) Subprocedures param - spec param - type param -name . .EXT ; ( referral ) , VSTB067.vsd param - type STRING INT REAL ( width ) UNSIGNED ( width ) FIXED ( fpoint ) * STRUCT PROC type PROC (32) VSTB068.vsd Appendix B—526371.
TAL Syntax Summary (Railroad Diagrams) Entry Points subproc - body BEGIN END ; sublocal - decl ; statement ; VSTB069.vsd Entry Points The entry-point declaration associates an identifier with a secondary location from which execution can start in a procedure or subprocedure. ENTRY identifier ; , VSTB070.vsd Labels The LABEL declaration reserves an identifier for later use as a label within the encompassing procedure or subprocedure. LABEL identifier ; , VSTB071.
TAL Syntax Summary (Railroad Diagrams) ASSERT Statement BEGIN END statement ; ; VSTB072.vsd ASSERT Statement The ASSERT statement conditionally invokes the procedure specified in an ASSERTION directive. assert - level ASSERT : condition VSTB073.vsd Assignment Statement The assignment statement assigns a value to a previously declared variable. := variable expression VSTB074.vsd Bit Deposit Assignment Statement The bit-deposit assignment statement assigns a value to a bit field in a variable.
TAL Syntax Summary (Railroad Diagrams) CALL Statement CALL Statement The CALL statement invokes a procedure, subprocedure, or entry point, and optionally passes parameters to it. identifier CALL ( ) param param - pair , VSTB076.vsd param - pair string : length VSTB077.vsd Labeled CASE Statement The labeled CASE statement executes a choice of statements the selector value matches a case label associated with those statements.
TAL Syntax Summary (Railroad Diagrams) Unlabeled CASE Statement case - alternative case label -> lower case - label statement ; upper case - label .. , VSTB079.vsd Unlabeled CASE Statement The unlabeled CASE statement executes a choice of statements based on an inclusive range of implicit selector values, from 0 through n, with one statement for each value. CASE selector OF BEGIN ; statement END OTHERWISE ; statement VSTB080.
TAL Syntax Summary (Railroad Diagrams) DO Statement instruction No. Instruction Form 1 mnemonic 2 mnemonic identifier . @ 3 mnemonic constant 4 mnemonic register 5 mnemonic identifier , . register @ 6 mnemonic constant , register VSTB082.vsd DO Statement The DO statement is a posttest loop that repeatedly executes a statement until a specified condition becomes true. DO UNTIL statement Appendix B—526371.001 B -35 condition VSTB083.
TAL Syntax Summary (Railroad Diagrams) DROP Statement DROP Statement The DROP statement disassociates an identifier from an index register reserved by a USE statement or from a label. DROP identifier , VSTB084.vsd FOR Statement The FOR statement is a pretest loop that repeatedly executes a statement while incrementing or decrementing an index. FOR index := TO limit DOWNTO DO BY step statement VSTB085.
TAL Syntax Summary (Railroad Diagrams) IF Move Statement condition THEN statement ELSE statement VSTB087.vsd Move Statement The move statement copies contiguous bytes, words, or elements to a new location. destination ':=' '=:' source FOR count count unit -> next addr constant [ constant ] constant - list & VSTB088.vsd Appendix B—526371.
TAL Syntax Summary (Railroad Diagrams) RETURN Statement RETURN Statement The RETURN statement returns control to the caller. For a function, RETURN must return a result expression. The RETURN directive can also return a condition-code value. RETURN , RETURN cc - expression result - expression , cc - expression VSTB089.vsd Scan Statement The SCAN or RSCAN statement scans sequential bytes for a test character from left to right or from right to left, respectively.
TAL Syntax Summary (Railroad Diagrams) STORE Statement STORE Statement The STORE statement removes values from the register stack and stores them into variables. STORE variable , VSTB092.vsd USE Statement The USE statement reserves an index register for your use. USE identifier , VSTB093.vsd WHILE Statement The WHILE statement is a pretest loop that repeatedly executes a statement while a condition is true. WHILE condition DO statement VSTB094.
TAL Syntax Summary (Railroad Diagrams) $ALPHA Function $ALPHA Function The $ALPHA function tests the right byte of an INT value for the presence of an alphabetic character. $ALPHA ( int - expression ) VSTB096.vsd $AXADR Function See Section 15, Privileged Procedures $BITLENGTH Function The $BITLENGTH function returns the length, in bits, of a variable. $BITLENGTH ( variable ) VSTB097.
TAL Syntax Summary (Railroad Diagrams) $COMP Function $COMP Function The $COMP function obtains the one’s complement of an INT expression. $COMP ( int - expression ) VSTB100.vsd $DBL Function The $DBL function returns an INT(32) value from an INT, FIXED(0), REAL, or REAL(64) expression. $DBL ( expression ) VSTB101.vsd $DBLL Function The $DBLL function returns an INT(32) value from two INT values. $DBLL ( int - expression , int - expression ) VSTB102.
TAL Syntax Summary (Railroad Diagrams) $EFLT Function $EFLT Function The $EFLT function returns a REAL(64) value from an INT, INT(32), FIXED (fpoint), or REAL expression. $EFLT ( ) expression VSTB105.vsd $EFLTR Function The $EFLTR function returns a REAL(64) value from an INT, INT(32), FIXED (fpoint), or REAL expression and applies rounding to the result. $EFLTR ( expression ) VSTB106.
TAL Syntax Summary (Railroad Diagrams) $FIXL Function $FIXL Function The $FIXL function returns the unsigned INT equivalent of a FIXED(0) expression. $FIXL ( fixed - expression ) VSTB110.vsd $FIXR Function The $FIXR function returns a FIXED(0) value from an INT, INT(32), FIXED, REAL, or REAL(64) expression and applies rounding to the result. $FIXR ( expression ) VSTB111.vsd $FLT Function The $FLT function returns a REAL value from an INT, INT(32), FIXED (fpoint), or REAL(64) expression.
$IFIX Function TAL Syntax Summary (Railroad Diagrams) $IFIX Function The $IFIX function returns a FIXED (fpoint) value from a signed INT expression. $IFIX ( , int - expression fpoint ) VSTB115.vsd $INT Function The $INT function returns an INT value from the low-order 16 bits of an INT(32 or FIXED(0) expression. $INT returns a fully converted INT expression from a REAL or REAL(64) expression. $INT ( expression ) VSTB116.
$LEN Function TAL Syntax Summary (Railroad Diagrams) $LEN Function The $LEN function returns the length, in bytes, of one occurrence of a variable. $LEN ( variable ) VSTB119.vsd $LFIX Function The $LFIX function returns a FIXED (fpoint) expression from an unsigned INT expression. $LFIX ( int - expression , ) fpoint VSTB120.vsd $LMAX Function The $LMAX function returns the maximum of two unsigned INT expressions. $LMAX ( int - expression , ) int - expression VSTB121.
$MIN Function TAL Syntax Summary (Railroad Diagrams) $MIN Function The $MIN function returns the minimum of two INT, INT(32), FIXED (fpoint), REAL, or REAL(64) expressions. $MIN ( expression , ) expression VSTB124.vsd $NUMERIC Function The $NUMERIC function tests the right half of an INT value for the presence of an ASCII numeric character. $NUMERIC ( int - expression ) VSTB125.vsd $OCCURS Function The $OCCURS function returns the number of occurrences of a variable.
$OVERFLOW Function TAL Syntax Summary (Railroad Diagrams) $OPTIONAL cond - expression ( , param param - pair ) VSTB128.vsd $OVERFLOW Function The $OVERFLOW function checks the state of the overflow indicator and indicates whether an overflow occurred during an arithmetic operation. $OVERFLOW VSTB129.vsd $PARAM Function The $PARAM function checks for the presence or absence of an actual parameter in the call that invoked the current procedure or subprocedure.
$RP Function TAL Syntax Summary (Railroad Diagrams) $RP Function The $RP function returns the current setting of the compiler’s internal RP counter. (RP is the register stack pointer.) $RP VSTB133.vsd $SCALE Function The $SCALE function moves the position of the implied decimal point by adjusting the internal representation of a FIXED (fpoint) expression. $SCALE ( fixed - expression , scale ) VSTB134.
$UDBL Function TAL Syntax Summary (Railroad Diagrams) $UDBL Function The $UDBL function returns an INT(32) value from an unsigned INT expression. ( $UDBL ) int - expression VSTB137.vsd $USERCODE Function The $USERCODE function returns the content of the word at the specified location in the current user code segment. $USERCODE ( ) expression VSTB138.vsd $XADR Function The $XADR function converts a standard address to an extended address. $XADR ( ) variable VSTB139.
'SG'-Equivalenced Simple Variables TAL Syntax Summary (Railroad Diagrams) 'SG'-Equivalenced Simple Variables The 'SG'-equivalenced simple variable declaration associates a simple variable with a location that is relative to the base address of the system global data area. type = identifier ; 'SG' [ + index ] offset - , VSTB141.
'SG'-Equivalenced Referral Structures TAL Syntax Summary (Railroad Diagrams) 'SG'-Equivalenced Referral Structures The 'SG'-equivalenced referral structure declaration associates a referral structure with a location relative to the base address of the system global data area. STRUCT identifier ( referral ) = . .SG .EXT ; 'SG' [ index + offset - ] VSTB143.
'SG'-Equivalenced Structure Pointers TAL Syntax Summary (Railroad Diagrams) type . identifier = 'SG' .SG .EXT ; [ index + offset ] - , VSTB144.vsd 'SG'-Equivalenced Structure Pointers The 'SG'-equivalenced structure pointer declaration associates a structure pointer with a location relative to the base address of the system global data area. Appendix B—526371.
'SG'-Equivalenced Structure Pointers TAL Syntax Summary (Railroad Diagrams) STRING . INT .SG identifier ( referral ) .EXT = ; 'SG' [ index + offset ] , VSTB145.vsd $AXADR Function The $AXADR function returns an absolute extended address. $AXADR ( variable ) VSTB146.vsd $BOUNDS Function The $BOUNDS function checks the location of a parameter passed to a system procedure to prevent a pointer that contains an incorrect address from overlaying the stack (S) register with data.
TARGET Directive TAL Syntax Summary (Railroad Diagrams) $SWITCHES Function The $SWITCHES function returns the current content of the switch register. $SWITCHES VSTB148.vsd TARGET Directive The TARGET directive specifies the target system for which you have written conditional code. TARGET works in conjunction with the IF and ENDIF directives in D20 or later object files. TARGET target - system VSTB149.
ABSLIST Directive TAL Syntax Summary (Railroad Diagrams) ABSLIST Directive ABSLIST lists code addresses relative to the code area base. The default is NOABSLIST. ABSLIST NOABSLIST VSTB152.vsd ASSERTION Directive ASSERTION invokes a procedure when a condition defined in an ASSERT statement is true. assertion level ASSERTION = , procedure name VSTB153.
CODE Directive TAL Syntax Summary (Railroad Diagrams) CHECK NOCHECK PUSHCHECK POPCHECK VSTB155.vsd CODE Directive CODE lists instruction codes and constants in octal format after each procedure. The default is CODE. CODE NOCODE PUSHCODE POPCODE VSTB156.vsd COLUMNS Directive COLUMNS directs the compiler to treat any text beyond the specified column as comments. COLUMNS columns - value VSTB157.vsd Appendix B—526371.
COMPACT Directive TAL Syntax Summary (Railroad Diagrams) COMPACT Directive COMPACT moves procedures into gaps below the 32K-word boundary of the code area if they fit. The default is COMPACT. COMPACT NOCOMPACT VSTB158.vsd CPU Directive CPU specifies that the object file runs on a TNS system. (The need for this directive no longer exists. This directive has no effect on the object file and is retained only for compatibility with programs that still specify it.) CPU cpu - type VSTB159.
DECS Directive TAL Syntax Summary (Railroad Diagrams) DECS Directive DECS decrements the compiler’s internal S-register counter. DECS sdec - value VSTB162.vsd = DEFEXPAND Directive Directive DEFEXPAND lists expanded DEFINEs and SQL-TAL code in the compiler listing. The default is NODEFEXPAND. DEFEXPAND NODEFEXPAND PUSHDEFEXPAND POPDEFEXPAND VSTB163.vsd DEFINETOG Directive DEFINETOG specifies named or numeric toggles, without changing any prior settings, for use in conditional compilation.
DUMPCONS Directive TAL Syntax Summary (Railroad Diagrams) DEFINETOG toggle - name toggle - number , ( toggle - name ) toggle - number , VSTB164.vsd DUMPCONS Directive DUMPCONS inserts the contents of the compiler’s constant table into the object code. DUMPCONS VSTB165.vsd ENDIF Directive See IF and ENDIF Directives on page 16-47. ENV Directive ENV specifies the intended run-time environment of a D-series object file. The default is ENV NEUTRAL. ENV COMMON OLD NEUTRAL VSTB166.
ERRORFILE Directive TAL Syntax Summary (Railroad Diagrams) ERRORFILE Directive ERRORFILE logs compilation errors and warnings to an error file so you can use the TACL FIXERRS macro to view the diagnostic messages in one PS Text Edit window and correct the source file in another window. ERRORFILE file - name define - name assign - name VSTB167.vsd ERRORS Directive ERRORS sets the maximum number of error messages to allow before the compiler terminates the compilation.
EXTENDTALHEAP Directive TAL Syntax Summary (Railroad Diagrams) EXTENDTALHEAP Directive EXTENDTALHEAP increases the size of the compiler’s internal heap for a D-series compilation unit. num - pages EXTENDTALHEAP = VSTB170.vsd FIXUP Directive FIXUP directs BINSERV to perform its fixup step. The default is FIXUP. FIXUP NOFIXUP VSTB171.vsd FMAP Directive FMAP lists the file map. The default is NOFMAP. FMAP NOFMAP VSTB172.vsd GMAP Directive GMAP lists the global map. The default is GMAP.
HEAP Directive TAL Syntax Summary (Railroad Diagrams) HEAP Directive HEAP sets the size of the CRE user heap for a D-series compilation unit if the ENV COMMON directive is in effect. num - pages HEAP = VSTB174.vsd HIGHPIN Directive HIGHPIN sets the HIGHPIN attribute in a D-series object file. HIGHPIN VSTB175.vsd HIGHREQUESTERS Directive HIGHREQUESTERS sets the HIGHREQUESTERS attribute in a D-series object file. HIGHREQUESTERS VSTB176.
IF and ENDIF Directives TAL Syntax Summary (Railroad Diagrams) IF and ENDIF Directives IF and IFNOT control conditional compilation based on a condition. The ENDIF directive terminates the range of the matching IF or IFNOT directive. The D20 or later RVU supports named toggles and target-system toggles as well as numeric toggles. IF toggle - number IFNOT toggle - name toggle - system ENDIF toggle - number toggle - name toggle - system VSTB178.
INSPECT Directive TAL Syntax Summary (Railroad Diagrams) INNERLIST NOINNERLIST PUSHINNERLIST POPINNERLIST VSTB180.vsd INSPECT Directive INSPECT sets the Inspect product as the default debugger for the object file. The default is NOINSPECT. INSPECT NOINSPECT VSTB181.vsd INT32INDEX Directive INT32INDEX generates INT(32) indexes from INT indexes for accessing items in an extended indirect structure in a D-series program. The default is NOINT32INDEX.
LARGESTACK Directive TAL Syntax Summary (Railroad Diagrams) LARGESTACK Directive LARGESTACK sets the size of the extended stack in the automatic extended data segment. LARGESTACK num - pages VSTB183.vsd = LIBRARY Directive LIBRARY specifies the name of the TNS software user run-time library to be associated with the object file at run time. LIBRARY file - name VSTB184.vsd LINES Directive LINES sets the maximum number of output lines per page. LINES num - lines = VSTB185.
LMAP Directive TAL Syntax Summary (Railroad Diagrams) LIST NOLIST PUSHLIST POPLIST VSTB186.vsd LMAP Directive LMAP lists load-map and cross-reference information. The default is LMAP ALPHA. LMAP lmap - option NOLMAP ( lmap - option ) , * VSTB187.vsd MAP Directive MAP lists the identifier maps. The default is MAP. MAP NOMAP PUSHMAP POPMAP VSTB188.vsd Appendix B—526371.
OLDFLTSTDFUNC Directive TAL Syntax Summary (Railroad Diagrams) OLDFLTSTDFUNC Directive OLDFLTSTDFUNC treats arguments to the $FLT, $FLTR, $EFLT, and $EFLTR standard functions as if they were FIXED(0) values. OLDFLTSTDFUNC VSTB189.vsd OPTIMIZE Directive OPTIMIZE specifies the level at which the compiler optimizes the object code. OPTIMIZE level = VSTB190.vsd PAGE Directive PAGE optionally prints a heading and causes a page eject. PAGE " heading - string " VSTB191.
PRINTSYM Directive TAL Syntax Summary (Railroad Diagrams) PRINTSYM Directive PRINTSYM lists symbols. The default is PRINTSYM. PRINTSYM NOPRINTSYM VSTB193.vsd RELOCATE Directive RELOCATE lists BINSERV warnings for declarations that depend on absolute addresses in the primary global data area of the user data segment. RELOCATE VSTB194.vsd RESETTOG Directive RESETTOG creates new toggles in the off state and turns off toggles created by SETTOG.
ROUND Directive TAL Syntax Summary (Railroad Diagrams) ROUND Directive ROUND rounds FIXED values assigned to FIXED variables that have smaller fpoint values than the values you are assigning. The default is NOROUND. ROUND NOROUND VSTB196.vsd RP Directive RP sets the compiler’s internal register pointer (RP) count. RP tells the compiler how many registers are currently in use on the register stack. RP register - number = VSTB197.
SAVEGLOBALS Directive TAL Syntax Summary (Railroad Diagrams) SAVEGLOBALS Directive SAVEGLOBALS saves all global data declarations in a file for use in subsequent compilations that specify the USEGLOBALS directive. SAVEGLOBALS file - name define - name assign - name VSTB200.vsd SEARCH Directive SEARCH specifies object files from which BINSERV can resolve unsatisfied external references and validate parameter lists at the end of compilation.
SETTOG Directive TAL Syntax Summary (Railroad Diagrams) SETTOG Directive SETTOG turns the specified toggles on for use in conditional compilations. The SETTOG directive supports named toggles as well as numeric toggles. SETTOG toggle - name toggle - number , toggle - name ( ) toggle - number , VSTB203.vsd SOURCE Directive SOURCE specifies source code to include from another source file.
STACK Directive TAL Syntax Summary (Railroad Diagrams) STACK Directive STACK sets the size of the data stack in the user data segment. STACK num - pages VSTB205.vsd = SUBTYPE Directive SUBTYPE specifies that the object file is to execute as a process of a specified subtype. SUBTYPE subtype - number VSTB206.vsd = SUPPRESS Directive SUPPRESS overrides all the listing directives. The default is NOSUPPRESS. SUPPRESS NOSUPPRESS VSTB207.
SYMBOLS Directive TAL Syntax Summary (Railroad Diagrams) SYMBOLS Directive SYMBOLS saves symbols in a symbol table (for Inspect symbolic debugging) in the object file. The default is NOSYMBOLS. SYMBOLS NOSYMBOLS VSTB209.vsd SYNTAX Directive SYNTAX checks the syntax of the source text without producing an object file. SYNTAX VSTB210.vsd TARGET Directive See Section 15, Privileged Procedures.
WARN Directive TAL Syntax Summary (Railroad Diagrams) WARN Directive WARN instructs the compiler to print a selected warning or all warnings. The default is WARN. WARN NOWARN warning - number = Appendix B—526371.001 B-74 VSTB212.
C TAL Syntax Summary (Bracket-andBrace Diagrams) This appendix provides a syntax summary of bracket-and-brace diagrams for specifying: • • • • • • Constants Expressions Declarations Statements Standard Functions Compiler Directives General Syntax Notation In this appendix, the following syntax notation conventions are used in the format of bracket-and-brace diagrams. UPPERCASE LETTERS Uppercase letters indicate keywords and reserved words; enter these items exactly as shown.
TAL Syntax Summary (Bracket-and-Brace Diagrams) Braces { } [ + ] operand [-] [ + | - ] operand Braces { } A group of items enclosed in braces is a list from which you are required to choose one item. The items in the list may be arranged either vertically, with aligned braces on each side of the list, or horizontally, enclosed in a pair of braces and separated by vertical lines.
TAL Syntax Summary (Bracket-and-Brace Diagrams) Line Spacing If there is no space between two items, spaces are not permitted. In the following examples, there are no spaces permitted between the items: [NO]SUPPRESS int-expression.< left-bit[: right-bit]> Line Spacing Continuation lines are indented and separated from the preceding line by a blank line. This spacing distinguishes items in a continuation line from items in a vertical list of selections. For example: STRUCT [ .
TAL Syntax Summary (Bracket-and-Brace Diagrams) INT Numeric Constants INT Numeric Constants An INT numeric constant is a signed or unsigned 16-bit integer. [ + ] [ base ] integer [-] INT(32) Numeric Constants An INT(32) numeric constant is a signed or unsigned 32-bit integer. [ + ] [ base ] integer { D } [- ] { %D } FIXED Numeric Constants A FIXED numeric constant is a signed 64-bit fixed-point integer. [ + ] [ base ] integer [ .
TAL Syntax Summary (Bracket-and-Brace Diagrams) Expressions constant-list-seq has the form: { constant } { repetition-constant-list } } ] ...
TAL Syntax Summary (Bracket-and-Brace Diagrams) CASE Expressions CASE Expressions The CASE expression selects one of several expressions. CASE selector OF BEGIN expression ; [ expression ; ] ... [ OTHERWISE expression ; ] END IF Expressions The IF expression conditionally selects one of two expressions, usually for assignment to a variable. IF condition THEN expression ELSE expression Group Comparison Expressions The group comparison expression compares a variable with a variable or a constant.
TAL Syntax Summary (Bracket-and-Brace Diagrams) • • • • • • • • • LITERAL and DEFINE Declarations Simple variables Arrays and read-only arrays Structures—definition structures, template structures, referral structures Structure items—simple variables, arrays, substructures, filler bytes, filler bits, simple pointers, structure pointers, and redefinitions Simple pointers and structure pointers Equivalenced variables NAMEs and BLOCKs Procedures and subprocedures LITERAL and DEFINE Declarations The followi
Array Declarations TAL Syntax Summary (Bracket-and-Brace Diagrams) type identifier [ := initialization ] [ , identifier [ := initialization ] ] . . . ; type is one of: { STRING } { { INT | REAL } [ ( width ) ] } } { UNSIGNED ( width ) { FIXED [ ( fpoint | * ) ] } Array Declarations The following syntax diagrams describe array and read-only array declarations: Arrays An array associates an identifier with a one-dimensional set of elements of the same data type. type [ .
TAL Syntax Summary (Bracket-and-Brace Diagrams) Structure Declarations Structure Declarations The following syntax diagrams describe: • • Structures—definition structures, template structures, referral structures Structure items—simple variables, arrays, substructures, filler bytes, filler bits, simple pointers, structure pointers, and redefinitions Definition Structures A definition structure associates an identifier with a structure layout and allocates storage for it. STRUCT [ . ] identifier [ .
TAL Syntax Summary (Bracket-and-Brace Diagrams) type identifier " [ " lower-bound : upper-bound " ] " [., identifier " [ " lower-bound : upper-bound " ] " . . . ; Definition Substructures A definition substructure can be declared inside a structure. STRUCT identifier [ " [ " lower-bound : upper-bound " ] " ] ; substructure-layout ; Referral Substructures A referral substructure can be declared inside a structure.
TAL Syntax Summary (Bracket-and-Brace Diagrams) Simple Variable Redefinitions Simple Variable Redefinitions A simple variable redefinition associates a new simple variable with a previous item at the same BEGIN-END level of a structure. type identifier = previous-identifier ; Array Redefinitions An array redefinition associates a new array with a previous item at the same BEGINEND level of a structure.
TAL Syntax Summary (Bracket-and-Brace Diagrams) Pointer Declarations { STRING } { . } identifier ( referral ) { INT } { .EXT} = previous-identifier ; Pointer Declarations The following syntax diagrams describe simple pointer and structure pointer declarations. Simple Pointers A simple pointer is a variable you load with a memory address, usually of a simple variable or array, which you access with this simple pointer. type { . } identifier [ := initialization ] { .EXT } [,{.
TAL Syntax Summary (Bracket-and-Brace Diagrams) Equivalenced Definition Structures type identifier = previous-identifier [ " [ " index " ] " ] [ { + } offset ] {-} [ , identifier = previous-identifier [ "[" index " ] " ] ] ... ; [ { + } offset ] {-} Equivalenced Definition Structures An equivalenced definition structure associates a new definition structure with a previously declared variable. STRUCT [ . ] identifier = previous-identifier [ .
TAL Syntax Summary (Bracket-and-Brace Diagrams) Equivalenced Structure Pointers Equivalenced Structure Pointers An equivalenced structure pointer associates a new structure pointer with a previously declared variable. { STRING } { . } identifier ( referral ) { INT } { .EXT } = previous-identifier [ " [ " index " ] " ] [ { + } offset ] {-} [,{. } identifier ( referral ) { .EXT } = previous-identifier [ " [ " index " ] " ] ] ...
TAL Syntax Summary (Bracket-and-Brace Diagrams) Base-Address Equivalenced Referral Structures Base-Address Equivalenced Referral Structures A base-addressed equivalenced referral structure associates a referral structure with a global, local, or top-of-stack base address. STRUCT [ . ] identifier ( referral ) = base-address [ .
NAME and BLOCK Declarations TAL Syntax Summary (Bracket-and-Brace Diagrams) NAME and BLOCK Declarations The following syntax diagrams describe NAME and BLOCK declarations. NAMEs The NAME declaration assigns an identifier to a compilation unit and to its private global data block if it has one. NAME identifier ; BLOCKs The BLOCK declaration groups global data declarations into a named or private relocatable global data block.
Procedures TAL Syntax Summary (Bracket-and-Brace Diagrams) public-name-spec has the form: = " public-name " parameter-list has the form: ( { param-name } [ , { param-name } ] ... ) { param-pair } { param-pair } param-pair has the form: string : length proc-attrib is one of: { MAIN | INTERRUPT { RESIDENT { CALLABLE | PRIV { VARIABLE | EXTENSIBLE [ ( count ) ] { LANGUAGE { C } } { COBOL } { FORTRAN } { PASCAL } { UNSPECIFIED } } } } } param-spec has the form: param-type [ .
Subprocedures TAL Syntax Summary (Bracket-and-Brace Diagrams) Subprocedures A subprocedure is a program unit that is callable from anywhere in the procedure. [ type ] SUBPROC identifier [ parameter-list ] [ VARIABLE ] ; [ param-spec ; ] ... { subproc-body } ; { FORWARD } type is one of: { STRING { { INT | REAL } [ ( width ) ] { UNSIGNED ( width ) { FIXED [ ( fpoint | * ) ] } } } } parameter-list has the form: ( { param-name } [ , { param-name } ] . . .
TAL Syntax Summary (Bracket-and-Brace Diagrams) Statements Entry Points An entry-point declaration associates an identifier with a secondary location from which execution can start in a procedure or subprocedure. ENTRY identifier [ , identifier ] ... ; Labels The LABEL declaration reserves an identifier for later use as a label within the encompassing procedure or subprocedure. LABEL identifier [ , identifier ] ... ; Statements The following syntax diagrams describe statements in alphabetic order.
TAL Syntax Summary (Bracket-and-Brace Diagrams) Bit-Deposit Assignment Statement Bit-Deposit Assignment Statement The bit-deposit assignment statement assigns a value to a bit field in a variable. variable.< left-bit [: right-bit] > := expression CALL Statement The CALL statement invokes a procedure, subprocedure, or entry point, and optionally passes parameters to it. [ CALL ] identifier [ ( [ param ] [ , [ param ] ] ...
CODE Statement TAL Syntax Summary (Bracket-and-Brace Diagrams) CODE Statement The CODE statement specifies machine-level instructions and pseudocodes to compile into the object file. CODE ( instruction [ ; instruction ] ... ) instruction has one of the following forms: No. Instruction Form 1. 2. 3. 4. 5. 6. { mnemonic { mnemonic [ . | @ ] identifier { mnemonic constant { mnemonic register { mnemonic [ .
TAL Syntax Summary (Bracket-and-Brace Diagrams) IF Statement GOTO label-name IF Statement The IF statement conditionally selects one of two statements. IF condition THEN [ statement ] [ ELSE [ statement ] ] Move Statement The move statement copies contiguous bytes, words, or elements to a new location. destination { ':=' } { '=:' } { source FOR count [ count-unit ] } { constant } { " [ " constant " ] " } { constant-list } [ & { source FOR count [ count-unit ] } ] ...
TAL Syntax Summary (Bracket-and-Brace Diagrams) STACK Statement STACK Statement The STACK statement loads values onto the register stack. STACK expression [ , expression ] ... STORE Statement The STORE statement removes values from the register stack and stores them into variables. STORE variable [ , variable ] ... USE Statement The USE statement reserves an index register for your use. USE identifier [ , identifier ] ...
TAL Syntax Summary (Bracket-and-Brace Diagrams) $AXADR Function $AXADR Function See Section 15, Privileged Procedures $BITLENGTH Function The $BITLENGTH function returns the length, in bits, of a variable. $BITLENGTH ( variable ) $BITOFFSET Function The $BITOFFSET function returns the number of bits from the address of the zeroth structure occurrence to a structure data item.
TAL Syntax Summary (Bracket-and-Brace Diagrams) $DBLR Function $DBLL ( int-expression , int-expression ) $DBLR Function The $DBLR function returns an INT(32) value from an INT, FIXED(0), REAL, or REAL(64) expression and applies rounding to the result. $DBLR ( expression ) $DFIX Function The $DFIX function returns a FIXED (fpoint) expression from an INT(32) expression.
TAL Syntax Summary (Bracket-and-Brace Diagrams) $FIXI Function $FIXI Function The $FIXI function returns the signed INT equivalent of a FIXED(0) expression. $FIXI ( fixed-expression ) $FIXL Function The $FIXL function returns the unsigned INT equivalent of a FIXED(0) expression. $FIXL ( fixed-expression ) $FIXR Function The $FIXR function returns a FIXED(0) value from an INT, INT(32), FIXED, REAL, or REAL(64) expression and applies rounding to the result.
TAL Syntax Summary (Bracket-and-Brace Diagrams) $INT Function $IFIX ( int-expression , fpoint ) $INT Function The $INT function returns an INT value from the low-order 16 bits of an INT(32 or FIXED(0) expression. $INT returns a fully converted INT expression from a REAL or REAL(64) expression. $INT ( expression ) $INTR Function The $INTR function returns an INT value from the low-order 16 bits of an INT(32) or FIXED(0) expression.
TAL Syntax Summary (Bracket-and-Brace Diagrams) $LMIN Function $LMIN Function The $LMIN function returns the minimum of two unsigned INT expressions. $LMIN ( int-expression , int-expression ) $MAX Function The $MAX function returns the maximum of two signed INT, INT(32), FIXED (fpoint), REAL, or REAL(64) expressions. $MAX ( expression , expression ) $MIN Function The $MIN function returns the minimum of two INT, INT(32), FIXED (fpoint), REAL, or REAL(64) expressions.
TAL Syntax Summary (Bracket-and-Brace Diagrams) $OVERFLOW Function $OPTIONAL ( cond-expression , { param } ) { param-pair } $OVERFLOW Function The $OVERFLOW function checks the state of the overflow indicator and indicates whether an overflow occurred during an arithmetic operation. $OVERFLOW $PARAM Function The $PARAM function checks for the presence or absence of an actual parameter in the call that invoked the current procedure or subprocedure.
TAL Syntax Summary (Bracket-and-Brace Diagrams) $SPECIAL Function $SPECIAL Function The $SPECIAL function tests the right half of an INT value for the presence of an ASCII special (non-alphanumeric) character. $SPECIAL ( int- expression ) $SWITCHES Function See Section 15, Privileged Procedures $TYPE Function The $TYPE function returns a value that indicates the data type of a variable. $TYPE ( variable ) $UDBL Function The $UDBL function returns an INT(32) value from an unsigned INT expression.
TAL Syntax Summary (Bracket-and-Brace Diagrams) 'SG'-Equivalenced Simple Variables type .SG identifier [ := preset-address ] [ , .SG identifier [ := preset-address ] ] ... ; 'SG'-Equivalenced Simple Variables The 'SG'-equivalenced simple variable declaration associates a simple variable with a location that is relative to the base address of the system global data area. type identifier = 'SG' [ " [ " index " ] " ] [ { + } offset ] {-} [ , identifier = 'SG' [ " [ " index "]" ] ] . . .
TAL Syntax Summary (Bracket-and-Brace Diagrams) 'SG'-Equivalenced Structure Pointers type { . } identifier = 'SG' [ " [ " index " ] " ] { .SG } [ { + } offset ] { .EXT} {-} [,{. } identifier = 'SG' { .SG } { .EXT} [ " [ " index " ] " ] ] ... ; [ { + } offset ] {-} 'SG'-Equivalenced Structure Pointers The 'SG'-equivalenced structure pointer declaration associates a structure pointer with a location relative to the base address of the system global data area. { STRING } { .
TAL Syntax Summary (Bracket-and-Brace Diagrams) TARGET Directive $SWITCHES TARGET Directive The TARGET directive specifies the target system for conditional code. TARGET works in conjunction with the IF and ENDIF directives. TARGET is a D20 or later feature. TARGET target-system Compiler Directives The following syntax diagrams describe directive lines, followed by compiler directives in alphabetic order. Directive Lines A directive line in your source code contains one or more compiler directives.
TAL Syntax Summary (Bracket-and-Brace Diagrams) BEGINCOMPILATION Directive BEGINCOMPILATION Directive BEGINCOMPILATION marks the point in the source file where compilation is to begin if the USEGLOBALS directive is in effect. BEGINCOMPILATION CHECK Directive CHECK generates range-checking code for certain features. The default is NOCHECK. [ NO] [PUSH] CHECK [ POP] CODE Directive CODE lists instruction codes and constants in octal format after each procedure. The default is CODE.
CROSSREF Directive TAL Syntax Summary (Bracket-and-Brace Diagrams) CPU cpu-type CROSSREF Directive CROSSREF collects source-level declarations and cross-reference information or specifies CROSSREF classes. The default is NOCROSSREF. [NO] CROSSREF [ class ] [ ( class [ , class ] ... ) ] DATAPAGES Directive DATAPAGES sets the size of the data area in the user data segment. DATAPAGES [ = ] num-pages DECS Directive DECS decrements the compiler’s internal S-register counter.
TAL Syntax Summary (Bracket-and-Brace Diagrams) DUMPCONS Directive DUMPCONS Directive DUMPCONS inserts the contents of the compiler’s constant table into the object code. DUMPCONS ENDIF Directive See IF and ENDIF Directives on page 16-47. ENV Directive ENV specifies the intended run-time environment of a D-series object file. The default is ENV NEUTRAL.
TAL Syntax Summary (Bracket-and-Brace Diagrams) FIXUP Directive EXTENDTALHEAP [ = ] num-pages FIXUP Directive FIXUP directs BINSERV to perform its fixup step. The default is FIXUP. [NO] FIXUP FMAP Directive FMAP lists the file map. The default is NOFMAP. [NO] FMAP GMAP Directive GMAP lists the global map. The default is GMAP. [NO] GMAP HEAP Directive HEAP sets the size of the CRE user heap for a D-series compilation unit if the ENV COMMON directive is in effect.
TAL Syntax Summary (Bracket-and-Brace Diagrams) [ IF and ENDIF Directive NO] [PUSH] ICODE [ POP] IF and ENDIF Directive IF and IFNOT control conditional compilation based on a condition. The ENDIF directive terminates the range of the matching IF or IFNOT directive. The D20 or later RVU supports named toggles and target-system toggles as well as numeric toggles.
TAL Syntax Summary (Bracket-and-Brace Diagrams) INT32INDEX Directive INT32INDEX Directive INT32INDEX generates INT(32) indexes from INT indexes for accessing items in an extended indirect structure in a D-series program. The default is NOINT32INDEX. [ NO] [PUSH] INT32INDEX [ POP] LARGESTACK Directive LARGESTACK sets the size of the extended stack in the automatic extended data segment.
MAP Directive TAL Syntax Summary (Bracket-and-Brace Diagrams) [NO] LMAP [ lmap-option ] [ ( lmap-option [ , lmap-option ] ... ) ] [* ] MAP Directive MAP lists the identifier maps. The default is MAP. [ NO] [PUSH] MAP [ POP] OLDFLTSTDFUNC Directive OLDFLTSTDFUNC treats arguments to the $FLT, $FLTR, $EFLT, and $EFLTR standard functions as if they were FIXED(0) values. OLDFLTSTDFUNC OPTIMIZE Directive OPTIMIZE specifies the level at which the compiler optimizes the object code.
TAL Syntax Summary (Bracket-and-Brace Diagrams) RELOCATE Directive RELOCATE Directive RELOCATE lists BINSERV warnings for declarations that depend on absolute addresses in the primary global data area of the user data segment. RELOCATE RESETTOG Directive RESETTOG creates new toggles in the off state and turns off toggles created by SETTOG. The RESETTOG directive supports named toggles as well as numeric toggles. RESETTOG [ toggle-name ] [ toggle-number [ , toggle-number ] ...
SAVEGLOBALS Directive TAL Syntax Summary (Bracket-and-Brace Diagrams) SAVEGLOBALS Directive SAVEGLOBALS saves all global data declarations in a file for use in subsequent compilations that specify the USEGLOBALS directive. SAVEGLOBALS { file-name } { define-name } { assign-name } SEARCH Directive SEARCH specifies object files from which BINSERV can resolve unsatisfied external references and validate parameter lists at the end of compilation.
TAL Syntax Summary (Bracket-and-Brace Diagrams) SQL Directive SQL Directive For more information, see the NonStop SQL Programming Manual for TAL. SQLMEM Directive For more information, see the NonStop SQL Programming Manual for TAL. STACK Directive STACK sets the size of the data stack in the user data segment. STACK [ = ] num-pages SUBTYPE Directive SUBTYPE specifies that the object file is to execute as a process of a specified subtype.
TAL Syntax Summary (Bracket-and-Brace Diagrams) USEGLOBALS Directive SYNTAX USEGLOBALS Directive USEGLOBALS retrieves the global data declarations saved in a file by SAVEGLOBALS during a previous compilation. USEGLOBALS { file-name } { define-name } { assign-name } WARN Directive WARN instructs the compiler to print a selected warning or all warnings. The default is WARN. WARN [ [ = ] warning-number ] Appendix C—526371.
Glossary actual parameter. An argument that a calling procedure or subprocedure passes to a called procedure or subprocedure. addressing mode. The mode in which a variable is to be accessed—direct addressing, standard indirect addressing, or extended indirect addressing—as specified in the data declaration. AND. A Boolean operator that produces a true state if both adjacent conditions are true. arithmetic expression. An expression that computes a single numeric value. array.
bit shift. Glossary bit shift. The shifting of bits within an INT or INT(32) expression a specified number of positions to the left or right. An INT expression can consist of STRING, INT, or UNSIGNED(1–16) values. An INT(32) expression can consist of INT(32) or UNSIGNED(17–31) values. bit-shift operators. Unsigned ('<<', '>>') or signed (<<, >>) operators that left shift or right shift a bit field within an INT or INT(32) expression. bitwise logical operator.
CLUDECS. Glossary CLUDECS. A file, provided by the CRE, that contains external declarations for CLULIB functions. See also CLULIB CLULIB. A library file, provided by the CRE, that contains Saved Messages Utility (SMU) functions for manipulating saved startup, ASSIGN, and PARAM messages. code segment. A segment that contains program instructions to be executed, plus related information. Applications can read code segments but cannot write to them. code space.
conditional expression. Glossary Condition Code Meaning Expression Status Procedure Call Status CCG Condition-code-greater-than Positive Warning CCL Condition-code-less-than 0 Error CCE Condition-code-equal-to Negative Successful execution conditional expression. An expression that establishes the relationship between values and results in a true or false value; an expression that consists of relational or Boolean conditions and conditional operators. constant.
data space. Glossary data space. The area of virtual memory that is reserved for user data and system data. The current data space of your process consists of a user data segment, an automatic extended data segment if needed, and any user-defined extended data segments. data stack. The local and sublocal storage areas of the user data segment. data type.
environment register. Glossary environment register. A facility that contains information about the current process, such as the current RP value and whether traps are enabled. equivalenced variable. A declaration that associates an alternate identifier and description with a location in a primary storage area. expression. A sequence of operands and operators that, when evaluated, produces a single value. EXTDECS.
file system. Glossary • File ID file system. A set of operating system procedures and data structures that allows communication between a process and a file, which can be a disk file, a device, or a process. filler bit. A declaration that allocates a bit place holder for data or unused space in a structure. filler byte. A declaration that allocates a byte place holder for data or unused space in a structure. FIXED.
HP NonStop Series/RISC system Glossary HP NonStop Series/RISC system . See TNS/R Identifier. A name you declare for an object such as a variable, LITERAL, or procedure. IF expression. An expression that selects the THEN expression for a true state or the ELSE expression for a false state. IF statement. A statement that selects the THEN statement for a true state or the ELSE statement for a false state. implicit pointer.
labeled tape. Glossary labeled tape. A magnetic tape file described by standard ANSI or IBM file labels. LAND. A bitwise logical operator that performs a bitwise logical AND operation. LANGUAGE attribute. A procedure attribute that lets you specify in which language (C, COBOL, FORTRAN, or Pascal) a D-series EXTERNAL procedure is written. large-memory-model program. A C or Pascal program that uses 32-bit addressing and stores data in an extended data segment. LITERAL.
named data block Glossary named data block. A BLOCK declaration that specifies a data-block identifier. The global data declared within the BLOCK declaration is accessible to all compilation units in the program. Contrast with private data block network. Two or more nodes linked together for intersystem communication. node. A computer system connected to one or more computer systems in a network. NonStop SQL.
pointer Glossary pointer. A variable that contains the address of another variable. Pointers include: • • Simple pointers and structure pointers that you declare and manage Implicit pointers (pointers the compiler provides and manages when you declare indirect arrays and indirect structures) See also extended pointer and standard pointer precedence of operators. The order in which the compiler evaluates operators in expressions. primary storage area.
quadrupleword. Glossary include a public name. If you do not specify a public name, the procedure identifier becomes the public name. quadrupleword. A 64-bit storage unit for the REAL(64) or FIXED data type. read-only array. An array that you can read but cannot modify; an array that is located in the user code segment. REAL. A data type that requires a doubleword of storage and that can represent a 32-bit floating-point number. REAL(32). An alias for REAL. REAL(64).
RETURN statement. Glossary RETURN statement. A statement that returns control from a procedure or a subprocedure to the caller. From functions, the RETURN statement can return a value. The RETURN statement can also return a condition-code value. RISC. Reduced instruction set computing. A processor architecture based on a relatively small and simple instruction set, a large number of general-purpose registers, and an optimized instruction pipeline that supports high-performance instruction execution.
stack register. Glossary other source files by SOURCE directives, compose a compilation unit that you can compile into an object file. stack register. A register that contains the address of the last allocated word in the data stack. STACK statement. A statement that loads a value onto the register stack. standard function. A built-in function that you can use for an operation such as type transfer or address conversion. standard indirect addressing. Data access through a standard (16-bit) pointer.
system. Glossary system. The processors, memory, controllers, peripheral devices, and related components that are directly connected together by buses and interfaces to form an entity that is operated as one computer. system procedure. A procedure provided by the operating system for your use. System procedures, for example, manage files, activate and terminate programs, and monitor the operations of processes. TAL. Transaction Application Language.
USE statement. Glossary USE statement. A statement that reserves an index register for your use. user data segment. An automatically allocated segment that provides modifiable, private storage for the variables of your process. value parameter. An argument for which a procedure (or subprocedure) passes a value, rather than the address of the argument, to a called procedure (or subprocedure).
Index Numbers 16-bit (standard) pointers 9-1 32-bit (extended) pointers 9-1 A ABORT Directive 16-12 ABS fpoint > 19 (warning 27) A-45 ABSLIST Directive description 16-13 ABSLIST directive with PEP directive 16-13 Absolute value, obtaining with $ABS 14-6 ACON pseudocode, CODE statement 12-17 Actual/formal parameter count (error 61) A-19 Addition operator signed 4-5, 4-6 unsigned 4-5, 4-9 Address base symbol 2-1 Address conversions bit-shift operations 4-30 simple pointers standard-to-extended 9-1 $AXADR (re
B Index ASCII character set 2-1 ASCII character, finding $ALPHA 14-7 $NUMERIC 14-28 $SPECIAL 14-40 ASSERT statement description 12-3 with ASSERTION directive 16-14 ASSERTION directive description 16-14 with ASSERT statement 12-3 ASSERTION procedure cannot (error156) A-36 ASSIGN SSV commands 16-4 ASSIGN SSV too large (warning 75) A-53 Assignment expression 4-19 Assignment statement 12-4 AT keyword, BLOCK declaration 11-3 Attribute mismatch (warning 21) A-44 B Base address symbol 2-7 Base-address equivalen
C Index Cannot use $OFFSET or $LEN (warning 76) A-54 Carry and overflow functions summary of 14-3 $CARRY 14-10 $OVERFLOW 14-35 Carry indicator, testing 4-17, 14-11 CASE expression 4-20 Case label must be signed (error 108) A-27 Case label or range overlaps (error 110) A-28 Case label range is empty (error 109) A-27 CASE statement labeled 12-11 unlabeled 12-13 with CHECK directive 16-17 CCE (condition code equal to) 4-13 CCG (condition code greater than) 4-13 CCL (condition code less than) 4-13 Character s
D Index Compiler listing directives (continued) DEFEXPAND 16-27 FMAP 16-40 GMAP 16-41 ICODE 16-46 INNERLIST 16-52 LINES 16-59 LIST 16-59 LMAP 16-61 MAP 16-62 PAGE 16-65 PRINTSYM 16-67 SUPPRESS 16-88 Compiler messages A-1 Compiler no longer generates (warning 52) A-50 Compiler relative reference (error 136) A-33 Compound statements 12-2 CON pseudocode, CODE statement 12-17 Condition code indicator, testing 4-16 Conditional compilation directives DEFINETOG 16-29 ENDIF 16-32 IF 16-47 IFNOT 16-47 RESETTOG 16-
D Index Data declarations must precede (error 24) A-10 Data operations scan statements 12-34 Data Representation 3-1 Data sets as a TAL feature 1-2 Data stack increasing with EXTENDSTACK directive 16-37 setting size with STACK directive 16-87 Data transfer assignment statement 12-4 bit-deposit assignments 12-4 move statement 12-27 STACK statement 12-36 STORE statement 12-37 Data types descriptions 3-1 obtaining with $TYPE 14-41 of expressions 4-2 arithmetic, Boolean 4-12 arithmetic, logical 4-3 arithmetic
E Index DEFINEs (continued) passing parameters 5-7 specifying parameters 5-3 syntax summary bracket-and-brace diagrams C-1 railroad diagrams B-1 DEFINETOG directive description 16-29 with IF directive 16-29 Definition structures base-address equivalenced 10-14 declaring 8-3 Definition substructures 8-10 declaring 8-10 redefinitions 8-20 Delimiters 2-7 Dereferencing operator description 2-9 Diagnostic directives ERRORFILE 16-34 ERRORS 16-37 RELOCATE 16-67 summary of 16-8 WARN 16-95 Diagnostic messages A-1
F Index ENV directive description 16-32 with EXTENDSTACK directive 16-38 with STACK directive 16-87 Equivalenced variables 10-1 definition structures 10-5 referral structures 10-8 simple pointers 10-4 simple variables 10-3 structure pointers 10-11 syntax summary bracket-and-brace diagrams C-1 railroad diagrams B-1 Equivalences between blocks (error 97) A-25 Error file exists and (error 124) A-30 Error handling, file-system errors 4-16 Error Messages descriptions A-2 Error messages maximum allowed, specify
F Index File records (structures) 8-1 File system DEFINE name not permitted (warning 63) A-52 File system DEFINEs not enabled (warning 41) A-48 File-system errors, testing for 4-16 Filler declaration 8-12 First argument of $OPTIONAL (error 177) A-39 FIXED data type description 3-3 in assignment statements 12-6 numeric format 3-14 obtaining $DFIX 14-14 $FIX 14-16 $FIXD 14-16 $FIXR 14-18 $IFIX 14-21 $LFIX 14-25 rounding with ROUND directive 16-70 FIXED parameter type 13-12 Fixed point functions summary of 1
G Index Functions declaring 13-2 description 13-1 procedures 13-2 subprocedures 13-1 with RETURN statement 12-32 G Global data declarations in BLOCK declaration 11-1 relocatable 11-1 retrieving with USEGLOBALS directive 16-77 saving with SAVEGLOBALS directive 16-75 unblocked 11-5 Global map, listing with GMAP directive 16-41 Global or nested subprocedure (error 19) A-9 Global primary exceeds 256 words (error 5) A-4 GMAP directive 16-41 GOTO statement description 12-25 labels 13-22 Group comparison expres
I Index Illegal digit (error 6) A-5 Illegal drop of USE variable (error 63) A-19 Illegal for INT (error 47) A-16 Illegal global declarations (error 33) A-13 Illegal index register (error 38) A-14 Illegal indirection specification (error 46) A-16 Illegal instruction (error 44) A-16 Illegal move or group comparison (error 4) A-4 Illegal operand for ACON (error 102) A-26 Illegal option (warning 2) A-40 Illegal order of directives (warning 53) A-50 Illegal parameter or (error 65) A-19 Illegal public name (err
L Index Instruction trap and CHECK directive 16-17 Insufficient disk space on swap volume (error 16) A-8 INT attribute 9-6 INT data type description 3-2 numeric format 3-10 obtaining high-order word with $HIGH 14-20 low-order word with $INT 14-21 rounded low-order word with $INTR 14-22 signed value with $FIXI 14-17 unsigned value with $FIXL 14-18 INT parameter type 13-12 INT (16), alias of INT 3-4 INT (32) data type description 3-2 numeric format 3-11 INT (64), alias of FIXED (0) 3-4 INT32INDEX directive
M Index Length of structure (warning 55) A-50 Length parameters CALL statement 12-9 passing conditionally with $OPTIONAL 14-33 LIBRARY directive 16-58 LINES directive 16-59 LIST directive description 16-59 with SOURCE directive 16-86 List length used for compare (warning 23) A-44 Literal initialized with address (warning 50) A-49 LITERALs declaring 5-1 in arithmetic expressions 4-2 syntax summary bracket-and-brace diagrams C-7 railroad diagrams B-7 LMAP directive 16-61 Load map, listing with LMAP directiv
O Index NAMEs (continued) railroad diagrams B-22 Nested routine declarations (error 12) A-7 Nesting parametric-DEFINE (error 100) A-26 NEUTRAL attribute, ENV directive 16-32 Next address group comparison expression 4-25, 4-26 move statement 12-29 RSCAN statement 12-35 SCAN statement 12-35 No file system DEFINE (warning 64) A-52 No SCAN for extended (error 84) A-23 NOABORT directive 16-12 NOABSLIST directive 16-7 NOCHECK directive 16-17 NOCODE directive 16-19 NOCOMPACT directive 16-21 NOCROSSREF directive
P Index Object-file content directives (continued) SEARCH 16-9 SQL 16-9 SQLMEM 16-9 summary of 16-8 SYNTAX 16-92 Octal code, listing with CODE directive 16-18 Odd-byte references, extended (32-bit) pointers 9-3 Of keyword CASE expression 4-20 OLD attribute, ENV directive 16-33 OLDFLTSTDFUNC directive 16-63 One or more illegal attributes (warning 29) A-46 One’s complement, obtaining with $COMP 14-4 Only allowed with variable (error 40) A-14 Only arrays of simple (error 89) A-24 Only data may be indexed (er
P Index Parameter pairs (continued) conditionally with $OPTIONAL 14-32 Parameter types 13-9 Parameters actual, CALL statement 12-9 checking with $PARAM 14-36 formal specification 13-8 location, obtaining with $BOUNDS 15-12 passing conditionally with $OPTIONAL 14-4 in expressions 4-17 PASCAL (TAL procedure language attribute) 13-10 PEP directive description 16-66 with ABSLIST directive 16-13 PEP size estimate (warning 5) A-41 PEP table description 13-4 setting size with PEP directive 16-66 PIN and HIGHPIN
Q Index Procedure was previously, public name (error 165) A-38 Procedures 13-1 attributes 13-5 CALLABLE attribute 13-6 description 13-1 EXTENSIBLE attribute 13-7 formal parameter specification 13-8 FORWARD declaration 13-15 INTERRUPT attribute 13-6 LANGUAGE attribute 13-8 MAIN attribute 13-5 nonprivileged 15-2 PRIV attribute 13-6 privileged 15-1 RESIDENT attribute 13-6 standard 14-1 syntax summary bracket-and-brace diagrams C-16 railroad diagrams B-23 typed 13-1 VARIABLE attribute 13-7 with RETURN stateme
R Index Redefinitions arrays 8-19 referral substructures 8-11 rules for 8-17 simple pointers 8-23 structure pointers 8-24 Referenced subprocedure FORWARD (error 106) A-27 Referral structures declaring 8-6 Referral substructures redefinitions 8-22 Register stack loading values with STACK statement 12-36 removing values with STORE statement 12-37 Register stack not empty (warning 87) A-55 Relational expressions 4-13 Relational operators condition code indicator, testing 4-13 conditional expressions 4-13 gro
S Index S S register checking for overflow 15-12 S register underflow (warning 38) A-47 Save file, generating with SAVEABEND directive 16-73 SAVEABEND directive description 16-73 with INSPECT directive 16-74 with Inspect directive 16-73 SAVEGLOBALS and USEGLOBALS (warning 57) A-51 SAVEGLOBALS directive description 16-75 with BEGINCOMPILATION directive 16-16 Scale point must be constant (error 64) A-19 Scaling, FIXED values changing fpoint with $SCALE 14-39 in expressions 4-7 SCAN statements 12-34 Scientif
S Index Source files (continued) description 11-1 Source line truncated (warning 20) A-44 Special expressions assignment 4-19 CASE 4-19 group comparison 4-19 IF 4-19 Specified bit extract/deposit (warning 42) A-48 SQL directive 16-86 SQLMAP and NOSQLMAP (warning 67) A-53 SQLMEM directive 16-86 SQLMEM STACK cannot (error 150) A-35 SQL-TAL code, listing with DEFEXPAND directive 16-27 SSV, TACL ASSIGN commands 16-58 STACK directive description 16-87 with DATAPAGES directive 16-26 Stack overflow trap with CHE
T Index Subprocedures body of 13-17 declaring 13-17 functions 13-1 VARIABLE attribute 13-7 Subprocedures cannot be parameters (error 35) A-13 Substructures declaring 8-9 definition substructures 8-10 number of occurrence, obtaining 14-29 referral substructures 8-11 Subtraction operator signed 4-3 unsigned 4-3 SUBTYPE directive 16-87 SUPPRESS directive description 16-88 with ABORT directive 16-12 Switch register content, obtaining with $SWITCHES 15-13 Symbol table overflow (error 57) A-18 Symbol table, set
U Index Toggles specifying with DEFINETOG 16-29 turning off with RESETTOG 16-68 turning on with SETTOG 16-82 using with IF or IFNOT directive 16-47 Too many ASSIGN commands (warning 75) A-54 Too many named toggles (warning 83) A-55 Too many parameters (error 140) A-33 Type incompatibility (error 32) A-12 Type mismatch SQL (error 152) A-36 Type-transfer functions rounding by 14-5 summary of 14-5 $DBL 14-5 $DBLR 14-5 $DFIX 14-4 $EFLT 14-4 $EFLTR 14-4 $FIX 14-5 $FIXD 14-5 $FIXI 14-5 $FIXL 14-5 $FIXR 14-5 $FL
W Index Variable size error (error 23) A-10 Variables kinds of 2-6 VARIABLE-to-EXTENSIBLE procedure conversions 13-7 W WARN directive 16-95 Warning Messages general description A-1 Warning messages printing with WARN directive 16-95 specific descriptions A-40 WHENEVERLIST and NOWHENEVERLIST (warning 66) A-52 WHILE statement 12-40 Width variables 3-4 Width of UNSIGNED array (error 118) A-29 Word 3-5 Word addressable items (error 74) A-21 WORDS keyword group comparison expression 4-24 X XBNDSTEST procedur
Special Characters Index $IFIX function 14-21 $INT function 14-21 $INTR function 14-22 $LADR function 14-23 $LEN function 14-24 $LFIX function 14-25 $LMAX function 14-26 $LMIN function 14-26 $MAX function 14-27 $MIN function 14-27 $NUMERIC function 14-28 $OCCURS function 14-29 $OFFSET function and structure pointers 9-7 description 14-30 $OPTIONAL function 14-32 $OPTIONAL only allowed (error 175) A-38 $OVERFLOW function 14-35 $PARAM function 14-36 $POINT function 14-37 $READCLOCK function 14-38 $RP functi
Special Characters Index >=signed greater than or equal to 4-15 >>(signed right-shift operator) 4-30 @ operator pointers 9-4 @ prefix not allowed (error 114) A-28 ^ (circumflex) in identifiers 2-4 ^(circumflex) location of the error in source file A-2 _ (underscore), in identifiers 2-4 ‘*’ (unsigned multiplication) 4-3 ‘+’ (unsigned addition) 4-3 ‘-’ (unsigned subtraction) 4-3 ‘/’ (unsigned division) 4-3 ‘=’ (unsigned equal to) 4-4 ‘>=’ (unsigned greater than or equal to) 4-4 ‘>’ (unsigned greater than) 4