HP 3000 Manuals

HPPACCVBD [ Compiler Library/XL Reference Manual ] MPE/iX 5.0 Documentation


Compiler Library/XL Reference Manual

HPPACCVBD 

HPPACCVBD converts a binary number to packed-decimal.

Declaration 

      PROCEDURE HPPACCVBD (
                ANYVAR  target           :decimal_type;
                        targetdigs       :INTEGER;
                ANYVAR  source           :binary_type;
                        sourcewords      :INTEGER;
                VAR     comparison_code  :INTEGER;
                VAR     pacstatus        :INTEGER)
           OPTION
                DEFAULT_PARMS (
                        comparison_code  :=NIL,
                        pacstatus        :=NIL)
                UNCHECKABLE_ANYVAR;
           EXTERNAL;

Comments 

 *  The source field is converted to packed-decimal and stored in the
    target field.  The source is considered to be a two s-complement
    binary number; its length is specified in sixteen-bit "words."

 *  If the "word" count is not in the range 0<=n<=6, a trap occurs.

 *  If the target digit count is not in the range 0<=n<=28, a trap
    occurs.

 *  After the binary source is converted, leading zeros are stored until
    the target field is filled.

 *  If the number of digits generated is greater than the target digit
    count, the partial result is stored and a decimal overflow trap
    occurs.

 *  If either the target digit count or the source word count is zero, no
    conversion is performed.

Possible Traps 

Decimal overflow (1)
Invalid source word count (4)
Invalid decimal operand length (5)



MPE/iX 5.0 Documentation