![](../img/s.gif) |
HP OpenVMS RTL General Purpose (OTS$) Manual
HP OpenVMS RTL General Purpose (OTS$) Manual
1.2.1 64-Bit Addressing Support (Alpha and I64 Only)
On Alpha and I64 systems, the General Purpose (OTS$) routines provide
64-bit virtual addressing capabilities as follows:
- All OTS$ RTL routines accept 64-bit addresses for arguments passed
by reference.
- All OTS$ RTL routines also accept either 32-bit or 64-bit
descriptors for arguments passed by descriptor.
Note
The OTS$ routines declared in ots$routines.h do not include prototypes
for 64-bit data. You must provide your own generic prototypes for any
OTS$ functions you use.
|
See the OpenVMS Programming Concepts Manual for more information about 64-bit virtual
addressing capabilities.
Part 2
OTS$ Reference Section
This section provides detailed descriptions of the routines provided by
the OpenVMS RTL General Purpose (OTS$) Facility.
OTS$CALL_PROC (Alpha and I64 Only)
The Call Special Procedure routine performs a call to a procedure that
may be either in native code or in a translated image.
Format
OTS$CALL_PROC target-func-value ,target-sig-info ,standard-args ,...
RETURNS
None.
Arguments
target-func-value
OpenVMS usage: |
function value |
type: |
quadword address |
access: |
read only |
mechanism: |
by value in register R23 (Alpha). by value in register R17
(I64). |
Function value for the procedure to be called.
target-sig-info
OpenVMS usage: |
TIE signature information |
type: |
TIE signature block |
access: |
read only |
mechanism: |
by reference in register R24 (Alpha). by value in register
R17 (I64). |
Signature information is used to transform the standard arguments into
the form required by a translated image (if needed). The representation
of signature information is described in the OpenVMS Calling Standard.
standard-args
Zero or more arguments to be passed to the called routine, passed using
standard conventions (including the AI register).
Description
When translated code support is requested, the compiled code must call
the special service routine, OTS$CALL_PROC. The actual parameters to
the target function are passed to OTS$CALL_PROC as though the target
routine is native code that is being invoked directly.
OTS$CALL_PROC first determines whether the target routine is part of a
translated image.
If the target is in native code, then OTS$CALL_PROC completes the call
in a way that makes its mediation transparent (that is, control need
not pass back through it for the return). The native parameters are
used without modification.
If the target is in translated code, then OTS$CALL_PROC passes control
to the Translated Image Environment (TIE). For additional information,
see the HP OpenVMS Calling Standard.
Condition Values Returned
OTS$CNVOUT
The Convert Floating to Character String routines convert a D-floating,
G-floating, H-floating, IEEE S-floating, or IEEE T-floating number to a
character string in the Fortran E format.
Format
OTS$CNVOUT D-G-H-S-or-T-float-pt-input-val
,fixed-length-resultant-string ,digits-in-fraction
OTS$CNVOUT_G D-G-H-S-or-T-float-pt-input-val
,fixed-length-resultant-string ,digits-in-fraction
OTS$CNVOUT_H D-G-H-S-or-T-float-pt-input-val
,fixed-length-resultant-string ,digits-in-fraction (VAX only)
OTS$CNVOUT_S D-G-H-S-or-T-float-pt-input-val
,fixed-length-resultant-string ,digits-in-fraction (VAX only)
OTS$CNVOUT_T D-G-H-S-or-T-float-pt-input-val
,fixed-length-resultant-string ,digits-in-fraction (VAX only)
RETURNS
OpenVMS usage: |
cond_value |
type: |
longword (unsigned) |
access: |
write only |
mechanism: |
by value |
Arguments
D-G-H-S-or-T-float-pt-input-val
OpenVMS usage: |
floating_point |
type: |
D_floating, G_floating, H_floating, IEEE S_floating, IEEE
T_floating |
access: |
read only |
mechanism: |
by reference |
Value that OTS$CNVOUT converts to a character string. For OTS$CNVOUT,
the D-G-H-S-or-T-float-pt-input-val argument is the
address of a D-floating number containing the value. For OTS$CNVOUT_G,
the D-G-H-S-or-T-float-pt-input-val argument is the
address of a G-floating number containing the value. For OTS$CNVOUT_S,
the D-G-H-S-or-T-float-pt-input-val argument is the
address of an IEEE S-floating number containing the value. For
OTS$CNVOUT_T, the D-G-H-S-or-T-float-pt-input-val
argument is the address of an IEEE T-floating number containing the
value.
fixed-length-resultant-string
OpenVMS usage: |
char_string |
type: |
character string |
access: |
write only |
mechanism: |
by descriptor, fixed length |
Output string into which OTS$CNVOUT writes the character string result
of the conversion. The fixed-length-resultant-string
argument is the address of a descriptor pointing to the output string.
digits-in-fraction
OpenVMS usage: |
longword_unsigned |
type: |
longword (unsigned) |
access: |
read only |
mechanism: |
by value |
Number of digits in the fractional portion of the result. The
digits-in-fraction argument is an unsigned longword
containing the number of digits to be written to the fractional portion
of the result.
Condition Values Returned
SS$_NORMAL
|
Normal successful completion.
|
SS$_ROPRAND
|
Floating reserved operand detected.
|
OTS$_OUTCONERR
|
Output conversion error. The result would have exceeded the
fixed-length string; the output string is filled with asterisks (*).
|
OTS$CVT_L_TB
The Convert an Unsigned Integer to Binary Text routine converts an
unsigned integer value of arbitrary length to binary representation in
an ASCII text string. By default, a longword is converted.
Format
OTS$CVT_L_TB varying-input-value,fixed-length-resultant-string
[,number-of-digits] [,input-value-size]
RETURNS
OpenVMS usage: |
cond_value |
type: |
longword (unsigned) |
access: |
write only |
mechanism: |
by value |
Arguments
varying-input-value
OpenVMS usage: |
varying_arg |
type: |
unspecified |
access: |
read only |
mechanism: |
by reference |
Unsigned byte, word, or longword that OTS$CVT_L_TB converts to an
unsigned decimal representation in an ASCII text string. (The value of
the input-value-size argument determines whether
varying-input-value is a byte, word, or longword.) The
varying-input-value argument is the address of the
unsigned integer.
fixed-length-resultant-string
OpenVMS usage: |
char_string |
type: |
character string |
access: |
write only |
mechanism: |
by descriptor, fixed length |
ASCII text string that OTS$CVT_L_TB creates when it converts the
integer value. The fixed-length-resultant-string
argument is the address of a descriptor pointing to this ASCII text
string. The string is assumed to be of fixed length (CLASS_S
descriptor).
number-of-digits
OpenVMS usage: |
longword_signed |
type: |
longword (signed) |
access: |
read only |
mechanism: |
by value |
Minimum number of digits in the binary representation to be generated.
The number-of-digits argument is a signed longword
containing this minimum number. If the minimum number of digits is
omitted, the default is 1. If the actual number of significant digits
is less than the minimum number of digits, leading zeros are produced.
If the minimum number of digits is zero and the value of the integer to
be converted is also zero, OTS$CVT_L_TB creates a blank string.
input-value-size
OpenVMS usage: |
longword_signed |
type: |
longword (signed) |
access: |
read only |
mechanism: |
by value |
Size of the integer to be converted, in bytes. The
input-value-size argument is a signed longword
containing the byte size. This is an optional argument. If the size is
omitted, the default is 4 (longword).
Condition Values Returned
SS$_NORMAL
|
Normal successful completion.
|
OTS$_OUTCONERR
|
Output conversion error. The result would have exceeded the
fixed-length string; the output string is filled with asterisks (*).
|
OTS$CVT_L_TI
The Convert Signed Integer to Decimal Text routine converts a signed
integer to its decimal representation in an ASCII text string. This
routine supports Fortran Iw and Iw.m output and BASIC output conversion.
Format
OTS$CVT_L_TI varying-input-value ,fixed-length-resultant-string
[,number-of-digits] [,input-value-size] [,flags-value]
RETURNS
OpenVMS usage: |
cond_value |
type: |
longword (unsigned) |
access: |
write only |
mechanism: |
by value |
Arguments
varying-input-value
OpenVMS usage: |
varying_arg |
type: |
unspecified |
access: |
read only |
mechanism: |
by reference, fixed length |
A signed integer that OTS$CVT_L_TI converts to a signed decimal
representation in an ASCII text string. The
varying-input-value argument is the address of the
signed integer.
On VAX systems, the integer can be a signed byte, word, or longword.
The value of the input-value-size argument determines
whether varying-input-value is a byte, word, or
longword.
On Alpha and I64 systems, the integer can be a signed byte, word,
longword, or quadword. The value of the
input-value-size argument determines whether
varying-input-value is a byte, word, longword, or
quadword.
fixed-length-resultant-string
OpenVMS usage: |
char_string |
type: |
character string |
access: |
write only |
mechanism: |
by descriptor |
Decimal ASCII text string that OTS$CVT_L_TI creates when it converts
the signed integer. The fixed-length-resultant-string
argument is the address of a CLASS_S descriptor pointing to this text
string. The string is assumed to be of fixed length.
number-of-digits
OpenVMS usage: |
longword_signed |
type: |
longword (signed) |
access: |
read only |
mechanism: |
by value |
Minimum number of digits to be generated when OTS$CVT_L_TI converts the
signed integer to a decimal ASCII text string. The
number-of-digits argument is a signed longword
containing this number. If the minimum number of digits is omitted, the
default value is 1. If the actual number of significant digits is
smaller, OTS$CVT_L_TI inserts leading zeros into the output string. If
number-of-digits is zero and
varying-input-value is zero, OTS$CVT_L_TI writes a
blank string to the output string.
input-value-size
OpenVMS usage: |
longword_signed |
type: |
longword (signed) |
access: |
read only |
mechanism: |
by value |
Size of the integer to be converted, in bytes. The
input-value-size argument is a signed longword
containing this value size. If the size is omitted, the default is 4
(longword).
On VAX systems, the value size must be 1, 2, or 4. If value size is 1
or 2, the value is sign-extended to a longword before conversion.
On Alpha and I64 systems, the value size must be 1, 2, 4, or 8. If the
value is 1, 2, or 4, the value is sign-extended to a quadword before
conversion.
flags-value
OpenVMS usage: |
mask_longword |
type: |
longword (unsigned) |
access: |
read only |
mechanism: |
by value |
Caller-supplied flags that you can use if you want OTS$CVT_L_TI to
insert a plus sign before the converted number. The
flags-value argument is an unsigned longword
containing the flags.
The caller flags are described in the following table:
Bit |
Action if Set |
Action if Clear |
0
|
Insert a plus sign (+) before the first nonblank character in the
output string.
|
Omit the plus sign.
|
If flags-value is omitted, all bits are clear and the
plus sign is not inserted.
Condition Values Returned
SS$_NORMAL
|
Normal successful completion.
|
OTS$_OUTCONERR
|
Output conversion error. Either the result would have exceeded the
fixed-length string or the
input-value-size is not a valid value. The output
string is filled with asterisks (*).
|
OTS$CVT_L_TL
The Convert Integer to Logical Text routine converts an integer to an
ASCII text string representation using Fortran L (logical) format.
Format
OTS$CVT_L_TL longword-integer-value ,fixed-length-resultant-string
RETURNS
OpenVMS usage: |
cond_value |
type: |
longword (unsigned) |
access: |
write only |
mechanism: |
by value |
Arguments
longword-integer-value
OpenVMS usage: |
longword_signed |
type: |
longword (signed) |
access: |
read only |
mechanism: |
by reference |
Value that OTS$CVT_L_TL converts to an ASCII text string. The
longword-integer-value argument is the address of a
signed longword containing this integer value.
fixed-length-resultant-string
OpenVMS usage: |
char_string |
type: |
character string |
access: |
write only |
mechanism: |
by descriptor, fixed length |
Output string that OTS$CVT_L_TL creates when it converts the integer
value to an ASCII text string. The
fixed-length-resultant-string argument is the address
of a descriptor pointing to this ASCII text string.
The output string is assumed to be of fixed length (CLASS_S descriptor).
If bit 0 of longword-integer-value is set,
OTS$CVT_L_TL stores the character T in the rightmost character of
fixed-length-resultant-string. If bit 0 is clear, it
stores the character F. In either case, it fills the remaining
characters of fixed-length-resultant-string with
blanks.
Condition Values Returned
SS$_NORMAL
|
Normal successful completion.
|
OTS$_OUTCONERR
|
Output conversion error. The result would have exceeded the
fixed-length string; the output string is of zero length (descriptor
LENGTH field contains 0).
|
Example
|
5 !+
! This is an example program
! showing the use of OTS$CVT_L_TL.
!-
VALUE% = 10
OUTSTR$ = ' '
CALL OTS$CVT_L_TL(VALUE%, OUTSTR$)
PRINT OUTSTR$
9 END
|
This BASIC example illustrates the use of OTS$CVT_L_TL. The output
generated by this program is 'F'.
OTS$CVT_L_TO
The Convert Unsigned Integer to Octal Text routine converts an unsigned
integer to an octal ASCII text string. OTS$CVT_L_TO supports Fortran Ow
and Ow.m output conversion formats.
Format
OTS$CVT_L_TO varying-input-value ,fixed-length-resultant-string
[,number-of-digits] [,input-value-size]
RETURNS
OpenVMS usage: |
cond_value |
type: |
longword (unsigned) |
access: |
write only |
mechanism: |
by value |
Arguments
varying-input-value
OpenVMS usage: |
varying_arg |
type: |
unspecified |
access: |
read only |
mechanism: |
by reference |
Unsigned byte, word, or longword that OTS$CVT_L_TO converts to an
unsigned decimal representation in an ASCII text string. (The value of
the input-value-size argument determines whether
varying-input-value is a byte, word, or longword.) The
varying-input-value argument is the address of the
unsigned integer.
fixed-length-resultant-string
OpenVMS usage: |
char_string |
type: |
character string |
access: |
write only |
mechanism: |
by descriptor, fixed length |
Output string that OTS$CVT_L_TO creates when it converts the integer
value to an octal ASCII text string. The
fixed-length-resultant-string argument is the address
of a descriptor pointing to the octal ASCII text string. The string is
assumed to be of fixed length (CLASS_S descriptor).
number-of-digits
OpenVMS usage: |
longword_signed |
type: |
longword (signed) |
access: |
read only |
mechanism: |
by value |
Minimum number of digits that OTS$CVT_L_TO generates when it converts
the integer value to an octal ASCII text string. The
number-of-digits argument is a signed longword
containing the minimum number of digits. If it is omitted, the default
is 1. If the actual number of significant digits in the octal ASCII
text string is less than the minimum number of digits, OTS$CVT_L_TO
inserts leading zeros into the output string. If
number-of-digits is 0 and
varying-input-value is 0, OTS$CVT_L_TO writes a blank
string to the output string.
input-value-size
OpenVMS usage: |
longword_signed |
type: |
longword (signed) |
access: |
read only |
mechanism: |
by value |
Size of the integer to be converted, in bytes. The
input-value-size argument is a signed longword
containing the number of bytes in the integer to be converted by
OTS$CVT_L_TO. If it is omitted, the default is 4 (longword).
Condition Values Returned
SS$_NORMAL
|
Normal successful completion.
|
OTS$_OUTCONERR
|
Output conversion error. The result would have exceeded the
fixed-length string; the output string is filled with asterisks (*).
|