SPL to HP C/XL Migration Guide (30231-90001)
3- 4
BYTE Format
Table 3-6. BYTE Format
---------------------------------------------------------------------------------------------
| | |
| SPL | HP C/XL Equivalent |
| | |
---------------------------------------------------------------------------------------------
| | |
| Type: BYTE | Type: unsigned char OR unsigned short int |
| | (depends on usage) |
| | |
---------------------------------------------------------------------------------------------
| | |
| 8-bit character stored in high-order byte | 8-bit character OR 16-bit unsigned integer |
| of 16-bit word. | |
| | |
---------------------------------------------------------------------------------------------
In SPL BYTE format, characters are stored as 8-bit bytes,two to a 16-bit
word.A single or odd character occupies the high-order byte of the word.
Normally, the HP C/XL unsigned char data type is the correct choice for
conversion of both simple BYTE variables and BYTE arrays.
However, a simple BYTE variable may also be used as a 16-bit quantity in
many places where an INTEGER or LOGICAL data type is accepted. In that
usage, the value is more like an HP C/XL unsigned short int with the
character value in the high-order byte.
In the conversion, such uses need to be clearly identified. If the
variable is used for both 8-bit and 16-bit operations, it would be wise
to divide the uses into separate variables.
LOGICAL Format
Table 3-7. LOGICAL Format
---------------------------------------------------------------------------------------------
| | |
| SPL | HP C/XL Equivalent |
| | |
---------------------------------------------------------------------------------------------
| | |
| Type: LOGICAL | Type: unsigned short int |
| | |
---------------------------------------------------------------------------------------------
| | |
| 16-bit unsigned integer, ranging from 0 to | Same as SPL. |
| 65535. | |
| | |
---------------------------------------------------------------------------------------------
| | |
| In a conditional test, a LOGICAL, BYTE, or | In a conditional test, a numeric value of |
| INTEGER value is true if it is odd, that | any type is true if it is nonzero. It is |
| is, if bit 15 is on. It is false if it is | false if it is zero. |
| even, that is, if bit 15 is off. | |
| | |
---------------------------------------------------------------------------------------------
| | |
| The logical constant TRUE equals 65535 (all | HP C/XL has no identifiers for true and |
| 16 bits on); FALSE equals 0 (all 16 bits | false. The result of a relational |
| off). | expression is 1 if true, 0 if false. |
| | |
---------------------------------------------------------------------------------------------