TAL Reference Manual

Standard Functions
TAL Reference Manual526371-001
14-24
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; !Declare variables
STRING .EXT array[0:99];
STRING .EXT xptr := @array[0];
@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.
variable
is the identifier of a simple variable, array element, pointer, structure, or structure
data item.
Usage Considerations
$LEN returns the number of bytes contained in a single occurrence of a simple
variable, array element, structure, structure data item, or item pointed to by a pointer.
To compute the total number of bytes in an entire array or substructure, multiply the
value returned by $LEN by the value returned by $OCCURS. To compute the total
number of bytes in an entire structure, first round up the value returned by $LEN to a
word boundary and then multiply the rounded value by the value returned by
$OCCURS.
If you apply $LEN to an unfinished structure or to a substructure in an unfinished
structure, the compiler emits warning 76 (cannot use $OFFSET or $LEN until base
structure is complete).
You can use $LEN in LITERAL expressions and global initializations, because it
always returns a constant value.
$LEN ( variable
)
VST1425.vsd