Array Class

<array class>

──┬─<word type>──────┬─────────────────────────────────────────────────┤
  └─<character type>─┘

<word type>

──┬─ BOOLEAN ──┬───────────────────────────────────────────────────────┤
  ├─ COMPLEX ──┤
  ├─ DINTEGER ─┤
  ├─ DOUBLE ───┤
  ├─ INTEGER ──┤
  └─ REAL ─────┘

<character type>

──┬─ ASCII ──┬─────────────────────────────────────────────────────────┤
  ├─ EBCDIC ─┤
  └─ HEX ────┘

Arrays declared in the same ARRAY declaration are of the same array class. If the array class is omitted, a REAL array is assumed. Arrays not declared with a character type are called word arrays. Arrays declared with a character type are called character arrays. Word and character arrays can be passed as parameters and used as array rows. Character arrays can be used as simple pointer expressions.

For character arrays, the actual storage area allocated is the number of whole words sufficient to contain the specified number of characters. The last portion of the last word in the storage area can be referenced by using pointer operations, even if this portion is beyond the valid subscript range. For example, if array A is declared EBCDIC ARRAY A[0:3], the characters corresponding to A[4] and A[5] can be referenced by using a pointer operation.

Element Width

The element width of an array is the number of bits used to contain each element of the array. The element width is determined by the array class, as follows:

Array Class

Element Width

DINTEGER, DOUBLE, COMPLEX

96 bits (double word)

INTEGER, REAL, BOOLEAN

48 bits (single word)

EBCDIC, ASCII

8 bits (6 characters per word)

HEX

4 bits (12 characters per word)

Within the operating system, arrays are manipulated by means of descriptors; each descriptor specifies an element width appropriate to the array class. Single-word and double-word descriptors are used for word arrays; 4-bit and 8-bit descriptors are used for character arrays.

Because complex, dinteger, and double array elements are composed of two 48-bit words, the words are allocated contiguously. The layout of a complex array is as follows: the real part of the first element, the imaginary part of the first element, the real part of the second element, the imaginary part of the second element, and so on. Similarly, the layout of a dinteger and double array is as follows: the first word of the first element, the second word of the first element, the first word of the second element, the second word of the second element, and so on.

For information on the internal representation of complex, dinteger and double operands, refer to Two-Word Operands.