pTAL Conversion Guide

Statements
pTAL Conversion Guide527302-002
15-17
Move Statement
Move Statement
A move statement copies a block of data from one location in memory to another. You
specify the number of bytes, words, or elements to copy in the move statement.
Topics:
WORDS Keyword on page 15-17
Value Parameters on page 15-17
Destination Shorter Than Source on page 15-18
Smear Operation on page 15-18
WORDS Keyword
The keyword WORDS in a move statement has the same meaning as in TAL and
pTAL; that is, two contiguous bytes, not four contiguous bytes. The following statement
moves 200 bytes of data from location b to location a in both TAL and pTAL:
a ':=' b FOR 100 WORDS; ! Copies 200 bytes of data
Value Parameters
In TAL, a move statement can move data into a value parameter.
In pTAL, a move statement cannot move data into a value parameter.
Example 15-23
on page 15-17 is valid in TAL, but not in pTAL.
Example 15-22. Testing an INT(32) Variable Without a Not-Equal Operator (pTAL)
INT(32) i;
...
IF i THEN ... ! OK: same as "IF i <> 0D THEN ..."
Example 15-23. Value Parameter in Move Statement (TAL)
PROC p(param);
INT(32) param; ! param is passed by value
BEGIN
INT(32) i;
param ':=' i FOR 4 BYTES; ! ERROR: param is a value parameter
END;