SPL to HP C/XL Migration Guide (30231-90001)

5- 32
MOVE Statement
Table 5-29. MOVE Statement
---------------------------------------------------------------------------------------------
| | |
| SPL | HP C/XL Equivalent |
| | |
---------------------------------------------------------------------------------------------
| | |
|
move-statement
: | No direct equivalents. |
| 1. MOVE
target
:=
source
, (
count
) | 1.
(See the
MOVEB
and
MOVEW |
| [,
stack-decr
] |
functions below.)
|
| 2. MOVE
target
:= *[PB] , (
count
) | 2.
(Convert to format
1
.)
|
| [,
stack-decr
] | 3.
(See the
MOVEB
,
MOVEW
, and
MOVESB |
| 3. MOVE
target
:=
string-const
|
functions below.)
|
| [,
stack-decr
] | 4.
(Convert to format
3
.)
|
| 4. MOVE
target
:= (
value-group
[,...] ) | 5.
(See the
MOVEBW
function below.)
|
| [,
stack-decr
] | 6.
(Convert to format
5
.)
|
| 5. MOVE
target
:=
source
WHILE
cond
| |
| [,
stack-decr
] | |
| 6. MOVE
target
:= * WHILE
cond
| |
| [,
stack-decr
] | |
| | |
---------------------------------------------------------------------------------------------
| | |
|
target
: | |
|
array/pointer-ref
| |
| * | |
| | |
|
source
: | |
|
array/pointer-ref
| |
| | |
---------------------------------------------------------------------------------------------
| | |
| May be used (without
stack-decr
) | |
| as an integer expression. | |
| Its value is the number of words | |
| or bytes moved. | |
| | |
---------------------------------------------------------------------------------------------
MOVE statements in SPL are designed to utilize several sophisticated
hardware move instructions. There are byte and word moves which can be
performed unconditionally or dependent upon a test condition. The
destination of the move must be an array or pointer, and the source may
be an array, a pointer, a string constant, or a group of values. Two of
the SPL moves are not directly translatable, for example:
MOVE arrayname := *PB,(count)
MOVE array name := (10(" "),"string",5(""))
The first is non-translatable because there is no register-relative
addressing in HP C/XL; the second, because repeat factors and grouping
of constants into a list are not available. The second case may be
handled by multiple move operations or manual expansion of the repeti-
tions into a string constant.
NOTE The str... amd mem... series of HP C/XL standard library
functions may also be useful here. The str... functions expect
the string to be terminated with NUL ('\0', numeric value 0). The