pTAL Conversion Guide

Statements
pTAL Conversion Guide527302-002
15-18
Destination Shorter Than Source
Destination Shorter Than Source
Unlike the TAL compiler, the native compiler reports a warning if it detects more bytes
in the source of a move than in the destination of the move. For example, if the number
of bytes to move is a constant or constant expression whose value is larger than the
number of bytes in the destination. The compiler does not report a warning if the
destination is:
A global variable
A reference parameter
An array or an element of an array
If the number of bytes to move is a dynamic expression, the compiler reports a warning
only if the number of bytes in the source is greater than the number of bytes in the
destination. It cannot detect whether the number of bytes to move is too large.
Smear Operation
A smear operation fills a data area with repetitions of the same value.
TAL
This move statement fills a data area:
a ':=' 0 & a[0] FOR (a_size - 1) WORDS;
pTAL
The built-in routines $FILL8, $FILL16, and $FILL32 fill a data area with repetitions of
the same 8-bit, 16-bit, or 32-bit value, respectively. For more information, see $FILL8,
$FILL16 and $FILL32 on page 18-24.
Example 15-24. Move Statement With Destination Shorter Than Source
INT g;
INT(32) m;
PROC p( r );
INT .r;
BEGIN
FIXED f;
INT n[0:9];
INT i;
g ':=' f FOR 8 BYTES; ! OK: g is global
n ':=' m FOR 8 BYTES; ! OK: n is an array
n[3] ':=' m FOR 8 BYTES; ! OK: n is an array element
r ':=' m FOR 8 BYTES; ! OK: r is a reference parameter
i ':=' m FOR 8 BYTES; ! WARNING
END;