pTAL Reference Manual (G06.24+, H06.09+, J06.03+)
BEGIN
d.s_sub ':=' s.s_sub FOR copies ELEMENTS; !Byte move of three
END; ! substructure
! occurrences
Destination Shorter Than Source
The compiler reports a warning when it can detect that there are 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.
Example 170 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 param
i ':=' m FOR 8 BYTES; ! Warning
END;
$FILL8, $FILL16, and $FILL32 Statements
pTAL provides the built-in routines $FILL8, $FILL16, and $FILL32, which fill a data area with
repetitions of the same 8-bit, 16-bit, or 32-bit value, respectively. This operation is sometimes
referred to as a “smear.”
Example 171 FILL16 Statement
$FILL16(a, a_size, 0);
For more information, see $FILL8, $FILL16 and, $FILL32 in Chapter 15 (page 274).
222 Statements