SPL to HP C/XL Migration Guide (30231-90001)
5-23
Sequence of Operations (Logical)
Table 5-24. Order of Evaluation of Logical Operators
---------------------------------------------------------------------------------------------
| | |
| SPL | HP C/XL Equivalent |
| | |
---------------------------------------------------------------------------------------------
| | |
| Order of evaluation: | Same as SPL, except for the following: |
| | |
| | bit operations |
| 1. logical bit operations | Implemented as function calls; same |
| logical expressions in parentheses | sequence level. |
| logical function designators | |
| logical assignment statements in | equality tests |
| parentheses | == and != evaluate below <, <=, >, >=. |
| | Parentheses may be needed. |
| 2. *, ** (logical multiply; 16- and | |
| 32-bit) | range tests |
| /, // (logical divide; 16- and | The conversion of SPL's X<=Y<=Z construct |
| 32-bit) | to HP C/XL's X<=Y & Y<=Z will probably |
| MOD, MODD (logical modulus; 16- and | need parentheses around the X, Ys, and Z. |
| 32-bit) | |
| | |
| 3. + (logical addition) | |
| - (logical subtraction) | |
| | |
| 4. <, <=, >, >=, =, <> (algebraic and | |
| logical comparisons) | |
| | |
| 5. LAND (logical bitwise AND) | |
| | |
| 6. XOR (logical bitwise exclusive OR) | |
| | |
| 7. LOR (logical bitwise inclusive OR) | |
|
lower
<=
test
<=
upper
(range test)| |
| | |
---------------------------------------------------------------------------------------------
Type Mixing (Logical)
The mixing of data types across operands is not allowed in SPL. Type
transfer functions (see "Expression Types" above) are used to convert
data types. See "Type Mixing (Arithmetic)" above for more detail.
Comparing Byte Strings
Table 5-25. Comparing Byte Strings
---------------------------------------------------------------------------------------------
|| |
| SPL | HP C/XL Equivalent |
|| |
---------------------------------------------------------------------------------------------
|| |
|
byte-comparison
:|
byte-comparison
:|
|| |
|1.
byte-ref rel-op byte-ref
,(
count
) | 1. strncmp (
byte-ref
,
byte-ref
,
count
)|
|| |
|[,
stack-decr
]|
rel-op
0|
|| |
|2.
byte-ref rel-op
*PB,(
count
)|2.
(No direct equivalent;
|
|
||
| [, stack-decr
]|
convert to format
1
)
|
|| |
|3.
byte-ref rel-op string-const
| 3. strcmp (
byte-ref
,
string-const
)|
|| |
|[,
stack-decr
]|
rel-op
0|