[an error occurred while processing this directive]

HP OpenVMS Systems Documentation

Content starts here

HP OpenVMS Calling Standard


Previous Contents Index

The effective address, E, of A(I):


   E = A0 + S1*I
     = POINTER + S1*[I - L1]

The effective address, E, of A(I1,I2):


   E = A0 + S1*I1 + S2*I2
     = POINTER + S1*[I1 - L1] + S2*[I2 - L2]

The effective address, E, of A(I1, . . . ,In):


   E = A0 + S1*I1 + . . . + Sn*In
     = POINTER + S1*[I1 - L1] + . . . + Sn*[In - Ln]

7.8 Varying String Descriptor (CLASS_VS)

A class VS descriptor is used for varying string data types (see Section 6.5).

As an input parameter, this format is not interchangeable with class 1 (CLASS_S) or with class 2 (CLASS_D). When a called procedure modifies a varying string passed by reference or by descriptor, it writes the new length, n, into CURLEN and can modify all bytes of BODY. Figure 7-8 shows the format of a varying string descriptor. Table 7-10 describes the fields of the descriptor.

Figure 7-8 Varying String Descriptor Format



Table 7-10 Contents of the CLASS_VS Descriptor
Symbol Description
DSC$W_MAXSTRLEN
DSC64$Q_MAXSTRLEN
Maximum length of the BODY field of the varying string in bytes in the range 0 to 2 16 - 1.
DSC64$W_MBO Must be 1. See Section 7.1.
DSC$B_DTYPE
DSC64$B_DTYPE
A data type code that has the value 37, which specifies the varying character string data type (see Sections 6.2 and 6.5). The use of other data types is reserved to Hewlett-Packard.
DSC$B_CLASS
DSC64$B_CLASS
Defines the descriptor class code that must be equal to 11 for CLASS_VS.
DSC$A_POINTER
DSC64$PQ_POINTER
Address of the first field (CURLEN) of the varying string.
DSC64$L_MBMO Must be -1. See Section 7.1.

Figure 7-9 illustrates the use of a 32-bit varying string descriptor to present a variable that is capable of holding a string value of up to five characters in length and that is currently holding the string value ABCD. As shown in the figure, MAXSTRLEN contains five, CURLEN contains four, string is currently ABCD, and the remaining byte is currently undefined.

Figure 7-9 Varying String Descriptor with Character String Data Type


7.9 Varying String Array Descriptor (CLASS_VSA)

A variant of the noncontiguous array descriptor is used to specify an array of varying strings where each varying string has the same maximum length. Each array element is of the varying string data type (see Section 6.5).

When a called procedure modifies a varying string in an array of varying strings passed to it by reference or by descriptor, it writes the new length, n, into CURLEN and can modify all bytes of BODY. The format of this descriptor is the same as the noncontiguous array descriptor except for the first two longwords. Figure 7-10 shows the format of a varying string array descriptor. Table 7-11 describes the fields of the descriptor.

Figure 7-10 Varying String Array Descriptor Format



Table 7-11 Contents of the CLASS_VSA Descriptor
Symbol Description
DSC$W_MAXSTRLEN
DSC64$Q_MAXSTRLEN
Maximum length of the BODY field of an array element in bytes in the range 0 to 2 16 - 1.
DSC64$W_MBO Must be 1. See Section 7.1.
DSC$B_DTYPE
DSC64$B_DTYPE
A data-type code that has the value 37, which specifies the varying character string data type (see Sections 6.2 and 6.5). The use of other data types is reserved to Hewlett-Packard.
DSC$B_CLASS
DSC64$B_CLASS
Defines the descriptor class code that must be equal to 12 for CLASS_VSA.
DSC$A_POINTER
DSC64$PQ_POINTER
Address of the first actual byte of data storage.
DSC64$L_MBMO Must be -1. See Section 7.1.

The remaining fields in the descriptor are identical to those in the noncontiguous array descriptor (NCA). The effective address computation of an array element produces the address of CURLEN of the desired element.

7.10 Unaligned Bit String Descriptor (CLASS_UBS)

A descriptor is used to pass an unaligned bit string (DSC$K_DTYPE_VU) that starts and ends on an arbitrary bit boundary. The descriptor provides two components: a base address and a signed relative bit position. Figure 7-11 shows the format of an unaligned bit string descriptor. Table 7-12 describes the fields of the descriptor.

Figure 7-11 Unaligned Bit String Descriptor Format



Table 7-12 Contents of the CLASS_UBS Descriptor
Symbol Description
DSC$W_LENGTH
DSC64$Q_LENGTH
Length of data item in bits.
DSC64$W_MBO Must be 1. See Section 7.1.
DSC$B_DTYPE
DSC64$B_DTYPE
A data-type code that has the value 34, which specifies the unaligned bit string data type (see Sections 6.1 and 6.2). The use of other data types is reserved to Hewlett-Packard.
DSC$B_CLASS
DSC64$B_CLASS
Defines the descriptor class code that must be equal to 13 for CLASS_UBS.
DSC$A_BASE
DSC64$PQ_BASE
Base of the address relative to which the signed relative bit position, POS, is used to locate the bit string. The base address need not be the first actual byte of data storage.
DSC64$L_MBMO Must be -1. See Section 7.1.
DSC$L_POS
DSC64$Q_POS
Relative bit position with respect to BASE of the first bit of unaligned bit string.

7.11 Unaligned Bit Array Descriptor (CLASS_UBA)

A variant of the noncontiguous array descriptor is used to specify an array of unaligned bit strings. Each array element is an unaligned bit string data type (DSC$K_DTYPE_VU) that starts and ends on an arbitrary bit boundary. The length of each element is the same and is 0 to 216 - 1 bits. You can access elements of the array directly by using the VAX variable bit field instructions. Therefore, the descriptor provides two components: a byte address, BASE, and a means to compute the signed bit offset, EB, with respect to BASE of an array element.

The unaligned bit array descriptor consists of four contiguous blocks that are always present. The first block contains the descriptor prototype information. Figure 7-12 shows the format of an unaligned bit array descriptor. Table 7-13 describes the fields of the descriptor.

Figure 7-12 Unaligned Bit Array Descriptor Format



Table 7-13 Contents of the CLASS_UBA Descriptor
Symbol Description
DSC$W_LENGTH
DSC64$Q_LENGTH
Length of an array element in bits.
DSC64$W_MBO Must be 1. See Section 7.1.
DSC$B_DTYPE
DSC64$B_DTYPE
A data-type code that must have the value 34, which specifies the unaligned bit string data type (see Sections 6.1 and 6.2). The use of other data types is reserved to Hewlett-Packard.
DSC$B_CLASS
DSC64$B_CLASS
Defines the descriptor class code that must be equal to 14 for CLASS_UBA.
DSC$A_BASE
DSC64$PQ_BASE
Base address relative to the effective bit offset, EB, that is used to locate elements of the array. The base address need not be the first actual byte of data storage.
DSC64$L_MBMO Must be -1. See Section 7.1.
DSC$B_SCALE
DSC64$B_SCALE
Reserved to Hewlett-Packard. Must be 0.
DSC$B_DIGITS
DSC64$B_DIGITS
If nonzero, the unsigned number of decimal digits in the internal representation. If 0, the number of digits can be computed based on LENGTH. This field should be 0 unless the TYPE field specifies a string data type that could contain numeric values.
DSC$B_AFLAGS
DSC64$B_AFLAGS
Array flag bits <23:16>:
Bits <18:16> Reserved to Hewlett-Packard. Must be 0.
DSC$V_FL_BINSCALE
DSC64$V_FL_BINSCALE
Must be 0.
DSC$V_FL_REDIM
DSC64$V_FL_REDIM
Must be 0.
Bits <23:21> Reserved to Hewlett-Packard. Must be 0.
DSC$B_DIMCT
DSC64$B_DIMCT
Number of dimensions, n.
DSC$L_ARSIZE
DSC64$Q_ARSIZE
If the elements are contiguous, ARSIZE is the total size of the array in bits. If the elements are not allocated contiguously or if the program unit allocating the descriptor is uncertain whether the array is actually contiguous, the value placed in ARSIZE might be meaningless.
DSC$L_V0
DSC64$Q_V0
Signed bit offset of element A(0,...,0) with respect to BASE. V 0 = POS - [S 1*L 1 + ... + S n *L n ].
DSC$L_Si
DSC64$Q_Si
Stride of the ith dimension. The difference between the bit (not byte) addresses of successive elements of the ith dimension.
DSC$L_L i
DSC64$Q_L i
Lower bound (signed) of the ith dimension.
DSC$L_U i
DSC64$Q_U i
Upper bound (signed) of the ith dimension.
DSC$L_POS
DSC64$Q_POS
Relative bit position with respect to BASE of the first actual bit of the array, that is, element A(L 1,...,L n ).

The following formulas specify the signed effective bit offset, EB, of an array element:

The signed effective bit offset, EB, of A(I1):


   EB = V0 + S1*I1
      = POS + S1*[I1 - L1]

The signed effective bit offset, EB, of A(I1,I2):


   EB = V0 + S1*I1 + S2*I2
      = POS + S1*[I1 - L1] + S2*[I2 - L2]

The signed effective bit offset, EB, of A(I1, ... , In):


   EB = V0 + S1*I1 + ... + Sn*In
      = POS + S1*[I1 - L1] + ... + Sn*[In - Ln]

Note that EB is computed ignoring integer overflow.

On VAX systems, EB is used as the position operand, and the content of BASE is used as the base address operand in the VAX variable-length bit field instructions. Therefore, BASE must specify a byte within 228 bytes of all bytes of storage in the bit array.

For example, consider a single-origin, one-dimensional, five-element array consisting of 3-bit elements allocated adjacently (therefore, S1 = 3). Assume BASE is byte 1000 and the first actual element, A(1), starts at bit <4> of byte 1001.


The following dependent field values occur in the descriptor:


   POS = 12
   V0  = 12 - 3*1 = 9

7.12 String with Bounds Descriptor (CLASS_SB)

A variant of the fixed-length string descriptor is used to specify strings where the string is viewed as a one-dimensional array with user-specified bounds. Figure 7-13 shows the format of a string with bounds descriptor. Table 7-14 describes the fields of the descriptor.

Figure 7-13 String with Bounds Descriptor Format



Table 7-14 Contents of the CLASS_SB Descriptor
Symbol Description
DSC$W_LENGTH
DSC64$Q_LENGTH
Length of the string in bytes.
DSC64$W_MBO Must be 1. See Section 7.1.
DSC$B_DTYPE
DSC64$B_DTYPE
A data-type code that must have the value 14, which specifies the character string data type (see Sections 6.1 and 6.2). The use of other data types is reserved to Hewlett-Packard.
DSC$B_CLASS
DSC64$B_CLASS
Defines the descriptor class code that must be equal to 15 for CLASS_SB.
DSC$A_POINTER
DSC64$PQ_POINTER
Address of the first byte of data storage.
DSC64$L_MBMO Must be -1. See Section 7.1.
DSC$L_SB_L1
DSC64$Q_SB_L1
Lower bound (signed) of the first (and only) dimension.
DSC$L_SB_U1
DSC64$Q_SB_U1
Upper bound (signed) of the first (and only) dimension.

The following formula specifies the effective address, E, of a string element A(I):


   E = POINTER + [I - SB_L1]

If the string must be extended in a string comparison or assignment, the space character (hexadecimal 20 if ASCII) is used as the fill character.

7.13 Unaligned Bit String with Bounds Descriptor (CLASS_UBSB)

A variant of the unaligned bit string descriptor is used to specify bit strings where the string is viewed as a one-dimensional bit array with user-specified bounds. Figure 7-14 shows the format of an unaligned bit string with bounds descriptor. Table 7-15 describes the fields of the descriptor.

Figure 7-14 Unaligned Bit String with Bounds Descriptor Format



Table 7-15 Contents of the CLASS_UBSB Descriptor
Symbol Description
DSC$W_LENGTH
DSC64$Q_LENGTH
Length of the data item in bits.
DSC64$W_MBO Must be 1. See Section 7.1.
DSC$B_DTYPE
DSC64$B_DTYPE
A data-type code that must have the value 34, which specifies the unaligned bit string data type (see Sections 6.1 and 6.2). The use of other data types is reserved to Hewlett-Packard.
DSC$B_CLASS
DSC64$B_CLASS
Defines the descriptor class code that must be equal to 16 for CLASS_UBSB.
DSC$A_BASE
DSC64$PQ_BASE
Base address relative to the signed relative bit position, POS, used to locate the bit string. The base address need not be the first actual byte of data storage.
DSC64$L_MBMO Must be -1. See Section 7.1.
DSC$L_POS
DSC64$Q_POS
Signed longword that defines the relative bit position of the first bit of the unaligned bit string to the BASE address.
DSC$L_UBSB_L1
DSC64$Q_UBSB_L1
Lower bound (signed) of the first (and only) dimension.
DSC$L_UBSB_U1
DSC64$Q_UBSB_U1
Upper bound (signed) of the first (and only) dimension.

The following formula specifies the effective bit offset, EB, of a bit element A(I):


   EB = POS + [I - UBSB_L1]

7.14 Reserved Descriptor Class Codes

All descriptor class codes from 0 through 191 not otherwise defined in this standard are reserved to Hewlett-Packard. Classes 192 through 255 are reserved for Hewlett-Packard custom systems and for customers for their own use.

Table 7-16 lists some specific descriptor classes and codes that are obsolete or reserved to Hewlett-Packard.

Table 7-16 Specific OpenVMS VAX Descriptors Reserved to Hewlett-Packard
Descriptor Code Class
DSC$K_CLASS_V 3 Obsolete (variable buffer)
DSC$K_CLASS_PI 6 Obsolete (procedure incarnation)
DSC$K_CLASS_J 7 Reserved to DEBUG (label)
DSC$K_CLASS_JI 8 Obsolete (label incarnation)
DSC$K_CLASS_CT 17 Reserved to ACMS (compressed text)
DSC$K_CLASS_BFA 191 Reserved to BASIC (file array)


Previous Next Contents Index