|
HP OpenVMS systems documentation |
Previous | Contents | Index |
A descriptor for a procedure argument identifies a procedure and its result data type, if any.
On OpenVMS VAX systems, the descriptor for a procedure argument specifies its entry address and function value data type. On OpenVMS Alpha systems, the procedure argument descriptor is a pointer to the procedure descriptor, which is described in Section 3.4. On OpenVMS I64 systems, the procedure argument descriptor is a pointer to the function descriptor, which is described in Section 4.7.7. Figure 7-5 shows the format of a procedure argument descriptor. Table 7-6 describes the fields of the descriptor.
Figure 7-5 Procedure Argument Descriptor Format
Symbol | Description |
---|---|
DSC$W_LENGTH
DSC64$Q_LENGTH |
Length associated with the function value, or 0 if no function value is returned. |
DSC64$W_MBO | Must be 1. See Section 7.1. |
DSC$B_DTYPE
DSC64$B_DTYPE |
Function value data-type code. Data-type codes are listed in Sections 6.1 and 6.2. |
DSC$B_CLASS
DSC64$B_CLASS |
Defines the descriptor class code that must be equal to 5 for CLASS_P. |
DSC$A_POINTER
DSC64$PQ_POINTER |
Address of entry mask to the procedure for VAX environments.
Address of the procedure descriptor of the procedure for Alpha environments. Address of the function descriptor of the procedure for I64 environments. |
DSC64$L_MBMO | Must be -1. See Section 7.1. |
Procedures return a function value as described in Section 2.5 for
VAX systems, Section 3.7.7 for Alpha systems, or Section 4.7.6 for I64
systems.
7.6 Decimal String Descriptor (CLASS_SD)
Figure 7-6 shows the format of a decimal string descriptor. Decimal size and scaling information for both scalar data and simple strings is given in this descriptor form. Table 7-7 describes the fields of the descriptor.
Figure 7-6 Decimal String Descriptor Format
Symbol | Description | ||||||
---|---|---|---|---|---|---|---|
DSC$W_LENGTH
DSC64$Q_LENGTH |
Length of the data item in bytes, unless the DTYPE field contains the value 1 (aligned bit string) or 21 (packed-decimal string). Length of the data item is in bits for the bit string. Length of the data item is the number of 4-bit digits (not including the sign) for packed-decimal string. | ||||||
DSC64$W_MBO | Must be 1. See Section 7.1. | ||||||
DSC$B_DTYPE
DSC64$B_DTYPE |
A data-type code. Data-type codes are listed in Sections 6.1 and 6.2. | ||||||
DSC$B_CLASS
DSC64$B_CLASS |
Defines the descriptor class code that must be equal to 9 for CLASS_SD. | ||||||
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$B_SCALE
DSC64$B_SCALE |
Signed power-of-two or power-of-ten multiplier, as specified by FL_BINSCALE, to convert the internal form to external form. (See examples in Table 7-8.) | ||||||
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_SFLAGS
DSC64$B_SFLAGS |
Scalar flag bits <23:16>:
|
Examples of SCALE and FL_BINSCALE interpretation are presented in Table 7-8.
Internal Value | SCALE | FL_BINSCALE | External Value |
---|---|---|---|
123 | +1 | 0 | 1230 |
123 | +1 | 1 | 246 |
200 | --2 | 0 | 2 |
200 | --2 | 1 | 50 |
The noncontiguous array descriptor describes an array in which the storage of the array elements can be allocated with a fixed, nonzero number of bytes separating logically adjacent elements. Two elements are said to be logically adjacent if their subscripts differ by 1 in the most rapidly varying dimension only. The difference between the addresses of two adjacent elements is termed the stride. You can align elements by row or column, because the accessing algorithm in the called procedure handles both alignments.
This array descriptor is to be used where the calling program, at its option, can pass a slice of an array that contains noncontiguous allocations. This standard indicates no preference between the noncontiguous array descriptor (NCA) and the contiguous array descriptor (A), as described in Section 7.4, for language processors that always allocate contiguous arrays. Figure 7-7 shows the format of a noncontiguous array descriptor, which consists of three contiguous blocks. Table 7-9 describes the fields of the descriptor.
Figure 7-7 Noncontiguous Array Descriptor Format
Symbol | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
DSC$W_LENGTH
DSC64$Q_LENGTH |
Length of an array element in bytes, unless the DTYPE field contains the value 1 (aligned bit string) or 21 (packed-decimal string). Length of an array element is in bits for the bit string. Length of an array element is the number of 4-bit digits (not including the sign) for a packed-decimal string. | ||||||||||||
DSC64$W_MBO | Must be 1. See Section 7.1. | ||||||||||||
DSC$B_DTYPE
DSC64$B_DTYPE |
A data-type code. Data-type codes are listed in Sections 6.1 and 6.2. | ||||||||||||
DSC$B_CLASS | Defines the descriptor class code that must be equal to 10 for CLASS_NCA. | ||||||||||||
DSC$A_POINTER
DSC64$PQ_POINTER |
Address of first actual byte of data storage. | ||||||||||||
DSC64$L_MBMO | Must be -1. See Section 7.1. | ||||||||||||
DSC$B_SCALE
DSC64$B_SCALE |
Signed power-of-two or power-of-ten multiplier, as specified by FL_BINSCALE, to convert the internal form to external form. (See Section 7.6.) | ||||||||||||
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>:
|
||||||||||||
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 bytes, unless the DTYPE field contains the value 21; see the
description of LENGTH). 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.
For data type 1 (aligned bit string), LENGTH is in bits while ARSIZE is in bytes because the unit of length is in bits while the unit of allocation is in bytes. |
||||||||||||
DSC$A_A0
DSC64$PQ_A0 |
Address of element A(0,0,...,0). This need not be within the actual
array. It is the same as POINTER for zero-origin arrays.
A0 = POINTER - ( S 1*L 1 + S 2*L 2 + ...+ S n *L n ) |
||||||||||||
DSC$L_Si
DSC64$Q_Si |
Stride of the ith dimension. The difference between the 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. |
The following formulas specify the effective address, E, of an array element.
Modification of the following formulas is required if DTYPE equals 1 or 21 because LENGTH is given in bits or 4-bit digits rather than bytes. |
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] |
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
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
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
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
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. |
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
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>:
|
||||||||
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 ). |
Previous | Next | Contents | Index |