pTAL Guidelines for TAL Programmers

Coding Guidelines
pTAL Guidelines for TAL Programmers527256-002
2-25
@ Operator With Procedure Names
P Register in Stack Marker on page 2-28
Extensible and Variable Procedures: Dynamic Calls on page 2-29
Reading and Altering Parameter Masks on page 2-29
$OPTIONAL Routine on page 2-30
Building Parameter Masks on page 2-31
Returning a Value From a Function on page 2-32
RETURN Statement Must Appear in Every Function on page 2-32
Returning From a Function That Does Not Specify a RETURN Statement on
page 2-32
Dynamic Procedure Calls on page 2-33
@ Operator With Procedure Names
Guideline: 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.).
In TAL, the result of applying the @ operator to a procedure name is a 16-bit value that
you can use in any expression.
In pTAL, the result of applying the @ operator to a procedure name is a 32-bit value
whose data type is PROCADDR. You can use a PROCADDR value as the target of a
procedure call by storing the value in a PROCPTR, a new kind of variable in pTAL and
also available in D40 TAL. You can also use a PROCADDR value anywhere a 32-bit
integer is valid; however, after you use the value as an integer, you cannot store it into
a PROCPTR.
@ Operator With Labels and Subprocedure Names
Guideline: Do not apply an @ operator to the name of a label or a subprocedure.
In TAL, the result of applying the @ operator to a label or a subprocedure name is a
16-bit value that you can use in any expression.
In pTAL, the result of applying the @ operator to a label or a subprocedure name is a
32-bit value that you can convert to an extended address or to an INT(32) value. You
cannot, however, use the value as an address. You might want to display its value in a
listing of your program’s status.