pTAL Guidelines for TAL Programmers
Coding Guidelines
pTAL Guidelines for TAL Programmers—527256-002
2-2
Guidelines Summary
@ Operator With Procedure Names on
page 2-25
Do not apply the @ operator to a procedure
name and treat the resultant value as a 16-
bit integer. (This does not apply to
subprocedure names or to labels.)
Address Arithmetic
on page 2-16 Use arithmetic operations on pointers only if
the result of the operation yields another
address or if the result is the number of
elements between two pointers.
Address Conversions
on page 2-15 Restrict address conversions to the rules
described in this guideline.
Address Variables
on page 2-14 Declare variables that hold addresses to be
an address type.
Addresses and Integer Expressions
on
page 2-15
Include only constant operands in an integer
expression whose value is assigned to a 16-
bit pointer.
Addresses and Integer Variables
on
page 2-14
Do not store addresses and data in the same
variable.
Addresses Are Indivisible
on page 2-20 Treat addresses as indivisible entities.
Comparing Addresses to Addresses
on
page 2-19
Use only those relational operators that are
defined for pTAL, as described in this
guideline.
Comparing Addresses to Constants
on
page 2-19
Compare addresses to constants only as
described in this guideline.
Addresses Are Absolute
on page 2-20 Do not make program behavior depend on
the absolute location of data in memory as
determined by the values of addresses.
Base-Address Equivalencing
on page 2-51 Avoid base-address equivalenced
declarations—declarations that equate an
identifier to an address at a relative offset
from the G, L, or S register.
Carry Bit in ENV in Stack Marker
on
page 2-28
Do not set the carry bit in the stack marker
copy of the ENV register.
CODE Statements
on page 2-55 Avoid using CODE statements.
Condition Code: Saving the Value in a
Variable on page 2-50
Do not save the value of a condition code by
assigning its value to a variable.
Condition Code: Testing Multiple Conditions
on page 2-44
Use nested IF statements to test the
condition code for more than one value.
Conditional Compilation
on page 2-5 Use the IF PTAL directive to control program
compilation.
DO_PTAL Directive
on page 2-6 Use the DO_PTAL directive to enable
additional TAL features.
Topic Guideline (page 2 of 5)