HP 3000 Manuals

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


Compiler Library/XL Reference Manual

HPPACCVDB 

HPPACCVDB converts a packed-decimal number to binary.

Declaration 

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

Comments 

The number of decimal digits specified in the source digit count are
converted to a twos-complement binary number and stored in the target
field.  The length of the target in sixteen-bit "words" is based on the
length of the source, as follows.

---------------------------------------------------------------------------------------------
|                                             |                                             |
|             Source Digit Count              |               Target "Words"                |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
|                   1 to 4                    |                      1                      |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
|                   5 to 9                    |                      2                      |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
|                  10 to 18                   |                      4                      |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
|                  19 to 28                   |                      6                      |
|                                             |                                             |
---------------------------------------------------------------------------------------------

If the source digit count is zero, no conversion is performed.

Possible Traps 

Invalid packed-decimal digit (3)
Invalid decimal operand length (5)



MPE/iX 5.0 Documentation