Document revision date: 19 July 1999
[Compaq] [Go to the documentation home page] [How to order documentation] [Help on this site] [How to contact us]
[OpenVMS documentation]
OpenVMS RTL General Purpose (OTS$) Manual

OpenVMS RTL General Purpose (OTS$) Manual

Order Number: AA--PV6HC--TK

January 1999

This manual documents the general-purpose routines contained in the OTS$ facility of the OpenVMS Run-Time Library.

Revision/Update Information: This manual supersedes the OpenVMS RTL General Purpose (OTS$) Manual, OpenVMS Alpha Version 7.0 and OpenVMS VAX Version 7.0.

Software Version: OpenVMS Alpha Version 7.1 OpenVMS VAX Version 7.1 The content of this document has not changed since OpenVMS Version 7.1.

Compaq Computer Corporation
Houston, Texas

Reprinted January 1999

Compaq Computer Corporation makes no representations that the use of its products in the manner described in this publication will not infringe on existing or future patent rights, nor do the descriptions contained in this publication imply the granting of licenses to make, use, or sell equipment or software in accordance with the description.

Possession, use, or copying of the software described in this publication is authorized only pursuant to a valid written license from Compaq or an authorized sublicensor.

Compaq conducts its business in a manner that conserves the environment and protects the safety and health of its employees, customers, and the community.

© Compaq Computer Corporation 1999. All rights reserved.

The following are trademarks of Digital Equipment Corporation: AXP, Bookreader, DEC, DECdirect, DECtalk, DECthreads, DECwindows, Digital, OpenVMS, OpenVMS Cluster, VAX, VAX DOCUMENT, VAXcluster, VMS, VMScluster, and the DIGITAL logo.

The following are third-party trademarks:

Motif, OSF, OSF/1, OSF/Motif, and Open Software Foundation are registered trademarks of the Open Software Foundation, Inc.

All other trademarks and registered trademarks are the property of their respective holders.


The OpenVMS documentation set is available on CD-ROM.

This document was prepared using VAX DOCUMENT, Version V3.2n.

Contents Index


This manual provides users of the OpenVMS operating system with detailed usage and reference information on general-purpose routines supplied in the OTS$ facility of the Run-Time Library.

Intended Audience

This manual is intended for system and application programmers who write programs that call OTS$ Run-Time Library routines.

Document Structure

This manual is organized into two parts as follows:

Related Documents

The Run-Time Library routines are documented in a series of reference manuals. A description of how the Run-Time Library routines are accessed is presented in OpenVMS Programming Interfaces: Calling a System Routine. A description of OpenVMS features and functionality available through calls to the OTS$ Run-Time Library appears in the OpenVMS Programming Concepts Manual. Descriptions of other RTL facilities and their corresponding routines and usages are discussed in the following books:

The Guide to DECthreads contains guidelines and reference information for DECthreads, the Digital Multithreading Run-Time Library.

Application programmers using any programming language can refer to the Guide to Creating OpenVMS Modular Procedures for writing modular and reentrant code.

High-level language programmers will find additional information on calling Run-Time Library routines in their language reference manual. Additional information may also be found in the language user's guide provided with your OpenVMS language software.

For a complete list and description of the manuals in the OpenVMS documentation set, see the Overview of OpenVMS Documentation.

For additional information on the Open Systems Software Group (OSSG) products and services, access the following OpenVMS World Wide Web address: 

Reader's Comments

Compaq welcomes your comments on this manual.

Print or edit the online form SYS$HELP:OPENVMSDOC_COMMENTS.TXT and send us your comments by:
Fax 603 884-0120, Attention: OSSG Documentation, ZKO3-4/U08
Mail Compaq Computer Corporation
OSSG Documentation Group, ZKO3-4/U08
110 Spit Brook Rd.
Nashua, NH 03062-2698

How To Order Additional Documentation

Use the following World Wide Web address to order additional documentation: 

If you need help deciding which documentation best meets your needs, call 800-344-4825.


The following conventions are used in this manual: \Monospace type indicates code examples and interactive screen displays.

In the C programming language, monospace type in text identifies the following elements: keywords, the names of independently compiled external functions and files, syntax summaries, and references to variables or identifiers introduced in an example.)
Ctrl/ x A sequence such as Ctrl/ x indicates that you must hold down the key labeled Ctrl while you press another key or a pointing device button.
PF1 x A sequence such as PF1 x indicates that you must first press and release the key labeled PF1 and then press and release another key or a pointing device button.
[Return] In examples, a key name enclosed in a box indicates that you press a key on the keyboard. (In text, a key name is not enclosed in a box.)
... A horizontal ellipsis in examples indicates one of the following possibilities:
  • Additional optional arguments in a statement have been omitted.
  • The preceding item or items can be repeated one or more times.
  • Additional parameters, values, or other information can be entered.
A vertical ellipsis indicates the omission of items from a code example or command format; the items are omitted because they are not important to the topic being discussed.
( ) In command format descriptions, parentheses indicate that, if you choose more than one option, you must enclose the choices in parentheses.
[ ] In command format descriptions, brackets indicate optional elements. You can choose one, none, or all of the options. (Brackets are not optional, however, in the syntax of a directory name in an OpenVMS file specification or in the syntax of a substring specification in an assignment statement.)
{ } In command format descriptions, braces indicate a required choice of options; you must choose one of the options listed.
bold text This text style represents the introduction of a new term or the name of an argument, an attribute, or a reason.
italic text Italic text indicates important information, complete titles of manuals, or variables. Variables include information that varies in system output (Internal error number), in command lines (/PRODUCER= name), and in command parameters in text (where device-name contains up to five alphanumeric characters).
UPPERCASE TEXT Uppercase text indicates a command, the name of a routine, the name of a file, or the abbreviation for a system privilege.
- A hyphen at the end of a command format description, command line, or code line indicates that the command or statement continues on the following line.
numbers All numbers in text are assumed to be decimal unless otherwise noted. Nondecimal radixes---binary, octal, or hexadecimal---are explicitly indicated.

Part 1
OTS$ Overview

This part of the OpenVMS RTL General Purpose (OTS$) Manual contains a general overview of the routines provided by the OpenVMS RTL General Purpose (OTS$) Facility, and lists them by function.

Chapter 1
Run-Time Library General Purpose (OTS$) Facility

This chapter describes the OpenVMS Run-Time Library General Purpose (OTS$) facility. See the OTS$ Reference Section for a detailed description of each routine within the OTS$ facility.

Most of the OTS$ routines were originally designed to support language compilers. Because they perform general-purpose functions, the routines were moved into the language-independent facility, OTS$.

1.1 Overview

The Run-Time Library General Purpose (OTS$) facility provides routines to perform general-purpose functions. These functions include data type conversions as part of a compiler's generated code, and some mathematical functions.

The OTS$ facility contains routines to perform the following main tasks:

Some restrictions apply if you link certain OTS$ routines on an Alpha system. See Section 1.2 for more information about these restrictions.

Table 1-1 OTS$ Conversion Routines
Routine Name Function
OTS$CNVOUT Convert a D-floating, G-floating, or H-floating value to a character string.
OTS$CVT_L_TB Convert an unsigned integer to binary text.
OTS$CVT_L_TI Convert a signed integer to signed integer text.
OTS$CVT_L_TL Convert an integer to logical text.
OTS$CVT_L_TO Convert an unsigned integer to octal text.
OTS$CVT_L_TU Convert an unsigned integer to decimal text.
OTS$CVT_L_TZ Convert an integer to hexadecimal text.
OTS$CVT_TB_L Convert binary text to an unsigned integer value.
OTS$CVT_TI_L Convert signed integer text to an integer value.
OTS$CVT_TL_L Convert logical text to an integer value.
OTS$CVT_TO_L Convert octal text to an unsigned integer value.
OTS$CVT_TU_L Convert unsigned decimal text to an integer value.
OTS$CVT_T_ x Convert numeric text to a D-, F-, G-, or H-floating value.
OTS$CVT_TZ_L Convert hexadecimal text to an unsigned integer value.

For more information on Run-Time Library conversion routines, see the CVT$ reference section in the OpenVMS RTL Library (LIB$) Manual.

Table 1-2 OTS$ Division Routines
Routine Name Function
OTS$DIVC x Perform complex division.
OTS$DIV_PK_LONG Perform packed decimal division with a long divisor.
OTS$DIV_PK_SHORT Perform packed decimal division with a short divisor.

Table 1-3 OTS$ Move Data Routines
Routine Name Function
OTS$MOVE3 Move data without fill.
OTS$MOVE5 Move data with fill.

Table 1-4 OTS$ Multiplication Routine
Routine Name Function
OTS$MULC x Perform complex multiplication.

Table 1-5 OTS$ Exponentiation Routines
Routine Name Function
OTS$POWC xC x Raise a complex base to a complex floating-point exponent.
OTS$POWC xJ Raise a complex base to a signed longword exponent.
OTS$POWDD Raise a D-floating base to a D-floating exponent.
OTS$POWDR Raise a D-floating base to an F-floating exponent.
OTS$POWDJ Raise a D-floating base to a longword integer exponent.
OTS$POWGG Raise a G-floating base to a G-floating or longword integer exponent.
OTS$POWGJ Raise a G-floating base to a longword integer exponent.
+OTS$POWHH_R3 Raise an H-floating base to an H-floating exponent.
+OTS$POWHJ_R3 Raise an H-floating base to a longword integer exponent.
OTS$POWII Raise a word integer base to a word integer exponent.
OTS$POWJJ Raise a longword integer base to a longword integer exponent.
OTS$POWLULU Raise an unsigned longword integer base to an unsigned longword integer exponent.
OTS$POW xLU Raise a floating-point base to an unsigned longword integer exponent.
OTS$POWRD Raise an F-floating base to a D-floating exponent.
OTS$POWRJ Raise an F-floating base to a longword integer exponent.
OTS$POWRR Raise an F-floating base to an F-floating exponent.

+VAX specific.

Table 1-6 OTS$ Copy Source String Routines
Routine Name Function
OTS$SCOPY_DXDX Copy a source string passed by descriptor to a destination string.
OTS$SCOPY_R_DX Copy a source string passed by reference to a destination string.

Table 1-7 OTS$ Return String Area Routines
Routine Name Function
OTS$SFREE1_DD Free one dynamic string.
OTS$SFREEN_DD Free n dynamic strings.
OTS$SGET1_DD Get one dynamic string.

1.2 Linking OTS$ Routines on an Alpha System

On Alpha systems, if you use the OTS$ entry points for certain mathematics routines, you must link against the DPML$SHR.EXE library. Alternately, you can use the equivalent math$ entry point for the routine and link against either STARLET.OBJ or the DPML$SHR.EXE library. Math$ entry points are available only on Alpha systems.

Table 1-8 lists the affected OTS$ entry points with their equivalent math$ entry points. Refer to the Digital Portable Mathematics Library for information about the math$ entry points.

Table 1-8 OTS$ and Equivalent Math$ Entry Points
OTS$ Entry Point Math$ Entry Point
OTS$DIVC math$cdiv_f
OTS$DIVCG_R3 math$cdiv_g
OTS$MULCG_R3 math$cmul_g
OTS$POWCC math$cpow_f
OTS$POWCGCG_R3 math$cpow_g
OTS$POWCJ math$cpow_fq
OTS$POWGG math$pow_gg
OTS$POWGJ math$pow_gq
OTS$POWGLU math$pow_gq
OTS$POWII math$pow_qq
OTS$POWJJ math$pow_qq
OTS$POWLULU math$pow_qq
OTS$POWRJ math$pow_fq
OTS$POWRLU math$pow_fq
OTS$POWRR math$pow_ff

1.2.1 64-Bit Addressing Support (Alpha Only)

On Alpha systems, the General Purpose (OTS$) routines provide 64-bit virtual addressing capabilities as follows:

See the OpenVMS Alpha Guide to 64-Bit Addressing and VLM Features for more information about 64-bit virtual addressing capabilities.

Next Contents Index

  [Go to the documentation home page] [How to order documentation] [Help on this site] [How to contact us]  
  privacy and legal statement