pTAL Guidelines for TAL Programmers
Coding Guidelines
pTAL Guidelines for TAL Programmers—527256-002
2-3
Guidelines Summary
Dynamic Procedure Calls on page 2-33 Use procedure pointers instead of
CODE(DPCL) statements.
Equivalenced Variables and Indirect Pointers
on page 2-23
Do not equivalence an integer to the implicit
pointer of an indirect array or indirect
structure.
Equivalenced Variables and Memory
on
page 2-8
Equivalenced variables can reference only
the memory contained within the previous
variable.
Extensible and Variable Procedures:
Dynamic Calls on page 2-29
To call an extensible or variable procedure
dynamically, use procedure pointer variables
or formal parameters. Use PROC
parameters only for procedures with simple,
fixed calling sequences.
Formal Value Parameters of Data Type
STRING on page 2-36
Do not declare formal value parameters of
data type STRING.
Hardware Indicator: Must Be First Operand
on page 2-43
Reference hardware indicators only as the
first operand in the conditional expression of
an IF statement.
Hardware Indicators: Accessing Across
Procedure Calls on page 2-48
Do not set a hardware indicator and test it
upon resuming execution after calling
another procedure.
Hardware Indicators: Test Only in an IF
Statement on page 2-42
Reference hardware indicators only in the
conditional expression of an IF statement.
Hardware Indicators: Test Only in Next
Statement on page 2-42
Test hardware indicators only in the
statement that immediately follows the
statement that sets the indicator.
Hardware Indicators: Test Only the Condition
Code in a Nest of IF Statements on
page 2-45
Use nested IF statements to test the value
only of the condition code, not of
$OVERFLOW or $CARRY.
Hardware Indicators: Testing in a Called
Procedure on page 2-46
Do not set a hardware indicator and test the
indicator in a subsequently called procedure.
Hardware Indicators: Where to Test
on
page 2-44
Test a hardware indicator only after a
statement that sets or resets it.
Overflow Bit in ENV in Stack Marker
on
page 2-27
Do not cause exceptions by setting the
overflow bit in the stack-marker copy of the
ENV register.
Overflow Traps
on page 2-10 Do not assume that overflow causes a trap
on intermediate operators within an
expression.
Overflow Traps Must Be Disabled to Test
$OVERFLOW on page 2-51
Do not test $OVERFLOW in portions of your
code in which you have enabled overflow
traps.
Topic Guideline (page 3 of 5)