hp.com home products and services support and drivers solutions how to buy
cd-rom home
End of Jump to page title
HP OpenVMS systems
documentation

Jump to content


HP OpenVMS RTL Library (LIB$) Manual

HP OpenVMS RTL Library (LIB$) Manual


Previous Contents Index


LIB$EMODH

On OpenVMS VAX systems, the Extended Multiply and Integerize routine (H-Floating-Point Values) allows higher-level language users to perform accurate range reduction of H-floating arguments.

This routine is not available to native OpenVMS Alpha programs but is available to translated VAX images.


Format

LIB$EMODH floating-point-multiplier ,multiplier-extension ,floating-point-multiplicand ,integer-portion ,fractional-portion


RETURNS


OpenVMS usage: cond_value
type: longword (unsigned)
access: write only
mechanism: by value


Arguments

floating-point-multiplier


OpenVMS usage: floating_point
type: H_floating
access: read only
mechanism: by reference

The multiplier. The floating-point-multiplier argument is an H-floating number.

multiplier-extension


OpenVMS usage: word_unsigned
type: word (unsigned)
access: read only
mechanism: by reference

The left-justified multiplier-extension bits. The multiplier-extension argument is an unsigned word.

floating-point-multiplicand


OpenVMS usage: floating_point
type: H_floating
access: read only
mechanism: by reference

The multiplicand. The floating-point-multiplicand argument is an H-floating number.

integer-portion


OpenVMS usage: longword_signed
type: longword integer (signed)
access: write only
mechanism: by reference

The integer portion of the result. The integer-portion argument is the address of a signed longword integer containing the integer portion of the result.

fractional-portion


OpenVMS usage: floating_point
type: H_floating
access: write only
mechanism: by reference

The fractional portion of the result. The fractional-portion argument is an H-floating number.

Description

The floating-point multiplier extension operand (second operand) is concatenated with the floating-point multiplier (first operand) to gain x additional low-order fraction bits. The multiplicand is multiplied by the extended multiplier. After multiplication, the integer portion is extracted and a y-bit floating-point number is formed from the fractional part of the product by truncating extra bits.

The multiplication yields a result equivalent to the exact product truncated to a fraction field of y bits. With respect to the result as the sum of an integer and fraction of the same sign, the integer operand is replaced by the integer part of the result and the fraction operand is replaced by the rounded fractional part of the result.

The values of x and y are as follows:
Routine x Bits y
LIB$EMODH 15 15:1 128


Condition Values Returned

SS$_NORMAL Routine successfully completed.
SS$_FLTUND Floating underflow. The integer and fraction operands are replaced by zero.
SS$_INTOVF Integer overflow. The integer operand is replaced by the low-order bits of the true result. Floating overflow is indicated by SS$_INTOVF also.
SS$_ROPRAND Reserved operand. The integer and fraction operands are unaffected.

LIB$EMODS (Alpha and I64 Only)

The Extended Multiply and Integerize routine (IEEE S-Floating-Point Values) allows higher-level language users to perform accurate range reduction of IEEE S-floating arguments.

Format

LIB$EMODS floating-point-multiplier ,multiplier-extension ,floating-point-multiplicand ,integer-portion ,fractional-portion


RETURNS


OpenVMS usage: cond_value
type: longword (unsigned)
access: write only
mechanism: by value


Arguments

floating-point-multiplier


OpenVMS usage: floating_point
type: IEEE S_floating
access: read only
mechanism: by reference

The multiplier. The floating-point-multiplier argument is the address of an IEEE S-floating number containing the number.

multiplier-extension


OpenVMS usage: byte_unsigned
type: byte (unsigned)
access: read only
mechanism: by reference

The left-justified multiplier-extension bits. The multiplier-extension argument is the address of an unsigned byte containing these multiplier extension bits.

floating-point-multiplicand


OpenVMS usage: floating_point
type: IEEE S_floating
access: read only
mechanism: by reference

The multiplicand. The floating-point-multiplicand argument is an IEEE S-floating number.

integer-portion


OpenVMS usage: longword_signed
type: longword (signed)
access: write only
mechanism: by reference

The integer portion of the result. The integer-portion argument is the address of a signed longword integer containing the integer portion of the result.

fractional-portion


OpenVMS usage: floating_point
type: IEEE S_floating
access: write only
mechanism: by reference

The fractional portion of the result. The fractional-portion argument is the address of an IEEE S-floating number containing the fractional portion of the result.

Description

LIB$EMODS allows higher-level language users to perform accurate range reduction of IEEE S-floating arguments.

The floating-point multiplier-extension operand (second operand) is concatenated with the floating-point-multiplier (first operand) to gain x additional low-order fraction bits. The multiplicand is multiplied by the extended multiplier. After multiplication, the integer portion is extracted and a y-bit floating-point number is formed from the fractional part of the product by truncating extra bits.

The multiplication yields a result equivalent to the exact product truncated to a fraction field of y bits. With respect to the result as the sum of an integer and fraction of the same sign, the integer operand is replaced by the integer part of the result and the fraction operand is replaced by the rounded fractional part of the result.

The values of x and y are as follows:
Routine x Bits y
LIB$EMODS 8 7:0 32


Condition Values Returned

SS$_NORMAL Routine successfully completed.
SS$_FLTUND Floating underflow. The integer and fraction operands are replaced by zero.
SS$_INTOVF Integer overflow. The integer operand is replaced by the low-order bits of the true result. Floating overflow is indicated by SS$_INTOVF also.
SS$_ROPRAND Reserved operand. The integer and fraction operands are unaffected.

LIB$EMODT (Alpha and I64 Only)

The Extended Multiply and Integerize routine (IEEE T-Floating-Point Values) allows higher-level language users to perform accurate range reduction of IEEE T-floating arguments.

Format

LIB$EMODT floating-point-multiplier ,multiplier-extension ,floating-point-multiplicand ,integer-portion ,fractional-portion


RETURNS


OpenVMS usage: cond_value
type: longword (unsigned)
access: write only
mechanism: by value


Arguments

floating-point-multiplier


OpenVMS usage: floating_point
type: IEEE T_floating
access: read only
mechanism: by reference

The multiplier. The floating-point-multiplier argument is the address of an IEEE T-floating number containing the number.

multiplier-extension


OpenVMS usage: byte_unsigned
type: byte (unsigned)
access: read only
mechanism: by reference

The left-justified multiplier-extension bits. The multiplier-extension argument is the address of an unsigned byte containing these multiplier extension bits.

floating-point-multiplicand


OpenVMS usage: floating_point
type: IEEE T_floating
access: read only
mechanism: by reference

The multiplicand. The floating-point-multiplicand argument is an IEEE T-floating number.

integer-portion


OpenVMS usage: longword_signed
type: longword (signed)
access: write only
mechanism: by reference

The integer portion of the result. The integer-portion argument is the address of a signed longword integer containing the integer portion of the result.

fractional-portion


OpenVMS usage: floating_point
type: IEEE T_floating
access: write only
mechanism: by reference

The fractional portion of the result. The fractional-portion argument is the address of an IEEE T-floating number containing the fractional portion of the result.

Description

LIB$EMODT allows higher-level language users to perform accurate range reduction of IEEE T-floating arguments.

The floating-point multiplier-extension operand (second operand) is concatenated with the floating-point-multiplier (first operand) to gain x additional low-order fraction bits. The multiplicand is multiplied by the extended multiplier. After multiplication, the integer portion is extracted and a y-bit floating-point number is formed from the fractional part of the product by truncating extra bits.

The multiplication yields a result equivalent to the exact product truncated to a fraction field of y bits. With respect to the result as the sum of an integer and fraction of the same sign, the integer operand is replaced by the integer part of the result and the fraction operand is replaced by the rounded fractional part of the result.

The values of x and y are as follows:
Routine x Bits y
LIB$EMODT 11 11:0 64


Condition Values Returned

SS$_NORMAL Routine successfully completed.
SS$_FLTUND Floating underflow. The integer and fraction operands are replaced by zero.
SS$_INTOVF Integer overflow. The integer operand is replaced by the low-order bits of the true result. Floating overflow is indicated by SS$_INTOVF also.
SS$_ROPRAND Reserved operand. The integer and fraction operands are unaffected.

LIB$EMUL

The Extended-Precision Multiply routine performs extended-precision multiplication. LIB$EMUL makes the VAX EMUL instruction available as a callable routine.

Note

On Alpha and I64 systems, OpenVMS Alpha and I64 instructions perform the equivalent operation.

Format

LIB$EMUL longword-integer-multiplier ,longword-integer-multiplicand ,addend ,product


RETURNS


OpenVMS usage: cond_value
type: longword (unsigned)
access: write only
mechanism: by value


Arguments

longword-integer-multiplier


OpenVMS usage: longword_signed
type: longword integer (signed)
access: read only
mechanism: by reference

Multiplier used by LIB$EMUL in the extended-precision multiplication. The longword-integer-multiplier argument is the address of a signed longword integer containing the multiplier.

longword-integer-multiplicand


OpenVMS usage: longword_signed
type: longword integer (signed)
access: read only
mechanism: by reference

Multiplicand used by LIB$EMUL in the extended-precision multiplication. The longword-integer-multiplicand argument is the address of a signed longword integer containing the multiplicand.

addend


OpenVMS usage: longword_signed
type: longword integer (signed)
access: read only
mechanism: by reference

Addend used by LIB$EMUL in the extended-precision multiplication. The addend argument is the address of a signed longword integer containing the addend.

product


OpenVMS usage: quadword_signed
type: quadword integer (signed)
access: write only
mechanism: by reference

Product of the extended-precision multiplication. The product argument is the address of a signed quadword integer into which LIB$EMUL writes the product.

Description

The multiplicand argument is multiplied by the multiplier argument giving a double-length result. The addend argument is sign-extended to double-length and added to the result. LIB$EMUL then writes the result into the product argument.

Condition Values Returned

SS$_NORMAL Routine successfully completed.
   

Example


      INTEGER MULT1,MULT2,ADDEND,PRODUCT(2) 
C+ 
C Find the extended precision multiplication of 268435456 times 4096. 
C That is, find the extended precision product of 2**28 times 2**12. 
C Since 268435456 times 4096 is 2**40, a quadword value is needed for 
C the calculation: use LIB$EMUL. 
C- 
      MULT1 = 4096 
      MULT2 = 268435456 
      APPEND = 0 
C+ 
C Compute 268435456*4096. 
C Note that product will be stored as a quadword. This value will be stored 
C in the 2 dimensional vector PRODUCT. The first element of PRODUCT will 
C contain the low order bits, while the second element will contain the high 
C order bits. 
C- 
      RETURN = LIB$EMUL(MULT1,MULT2,APPEND,PRODUCT) 
      TYPE *,'PRODUCT(2) =',PRODUCT(2),' and PRODUCT(1) = ',PRODUCT(1) 
      TYPE *,' ' 
      TYPE *,'Note that 256 and 0 represent the hexadecimal value' 
      type *,14H'10000000000'x,', which in turn, represents 2**40.' 
      END 
 
      

This Fortran program demonstrates how to use LIB$EMUL. The output generated by this program is as follows:


 PRODUCT(2) =         256 and PRODUCT(1) =            0 

Note that 256 and 0 represent the hexadecimal value '10000000000'x, which in turn represents 240.


LIB$ENABLE_CTRL

The Enable CLI Interception of Control Characters routine requests the calling process's command language interpreter (CLI) to resume interception of the selected control characters when they are typed during an interactive terminal session. LIB$ENABLE_CTRL provides the same function as the DCL command SET CONTROL.

Format

LIB$ENABLE_CTRL enable-mask [,old-mask]


RETURNS


OpenVMS usage: cond_value
type: longword (unsigned)
access: write only
mechanism: by value


Arguments

enable-mask


OpenVMS usage: mask_longword
type: longword (unsigned)
access: read only
mechanism: by reference

Bit mask indicating for which control characters LIB$ENABLE_CTRL is to enable interception. The enable-mask argument is the address of an unsigned longword containing this bit mask. Each of the 32 bits corresponds to one of the 32 possible control characters. If a bit is set, the corresponding control character is intercepted by the CLI. Currently, only bits 20 and 25, corresponding to Ctrl/T and Ctrl/Y, are recognized.

The following mask is defined in symbol libraries supplied by HP to specify the value of enable-mask:
Symbol Hex Value Function
LIB$M_CLI_CTRLT %X'00100000' Enables Ctrl/T
LIB$M_CLI_CTRLY %X'02000000' Enables Ctrl/Y

If a set bit does not correspond to a character that the CLI can intercept, an error is returned.

old-mask


OpenVMS usage: mask_longword
type: longword (unsigned)
access: write only
mechanism: by reference

Previous bit mask. The old-mask argument is the address of an unsigned longword containing the old bit mask. The old bit mask is of the same form as enable-mask.

Description

LIB$ENABLE_CTRL provides the functions of the DCL command SET CONTROL. Normally, Ctrl/Y interrupts the current command, command procedure, or image. After a call to LIB$DISABLE_CTRL, Ctrl/Y is treated like Ctrl/U followed by a carriage return. LIB$ENABLE_CTRL restores the normal operation of Ctrl/Y or Ctrl/T.

Both the DCL and MCR CLIs can intercept control characters. See the HP OpenVMS DCL Dictionary for information on how the CLI processes control characters.

LIB$ENABLE_CTRL is supported for use with the DCL or MCR CLIs.

If an image is run directly as a subprocess or as a detached process, there is no CLI present to perform this function. In those cases, the error status LIB$_NOCLI is returned.


Condition Values Returned

SS$_NORMAL Routine successfully completed.
LIB$_INVARG Invalid argument. A bit in enable-mask was set which did not correspond to a control character supported by the CLI.
LIB$_NOCLI No CLI present. The calling process did not have a CLI to perform the function, or the CLI did not support the request type. Note that an image run as a subprocess or detached process does not have a CLI.
LIB$_UNECLIERR Unexpected CLI error. The CLI returned an error status which was not recognized. This error may be caused by use of a nonstandard CLI. If this error occurs while using the DCL or MCR CLIs, please report the problem to your HP support representative.


Previous Next Contents Index