Previous Topic Next topic Print topic


COMP

Makes the compiler produce very compact and efficient code for some statements involving COMP data items, by treating COMP items as COMP-X or sets the representation meant by COMP usage in a data description entry.

Syntax:

>>-.---.--.--------COMP"opt"--.--------><
   +-/-+  +-.----.-COMP-------+
            +-NO-+

Parameters:

opt can be one of:

BINARY
COMP usage in a data description entry specifies binary two's complement representation of the numeric value.
DISPLAY
COMP usage in a data description entry specifies display representation of the numeric value.
PACKED
COMP usage in a data description entry specifies packed-decimal representation of the numeric value, that is, two decimal digits per byte with a trailing sign nibble if the data item is signed.
UNPACKED
COMP usage in a data description entry specifies display representation of the numeric value, that is, one decimal digit per byte with a trailing sign byte if the data item is signed.

Properties:

Default: NOCOMP and COMP"BINARY"
Phase: Syntax check
$SET: Initial

Dependencies:

DIALECT"RM" sets COMP"UNPACKED" immediately.

Comments:

When the COMP directive, without a parameter, is in effect, the code for COMP usage data items represented in binary two's complement produced by the compiler behaves in a way that is not the ANSI standard in cases of numeric overflow for such items. You should use this directive only if you know that your program does not lead to numeric overflow, or if you want to use the defined (but nonstandard) behavior on overflow.

The COMP directive with a parameter causes the interpretation of COMP usage in a data description entry to be as described for the parameter above. COMP and COMP"BINARY" may be used together. COMP has no effect if COMP"DISPLAY", COMP"PACKED" or COMP"UNPACKED" is in effect.

Previous Topic Next topic Print topic