BackbuttonString Arrays

 

A Multi Dimension String Array occupies 3 Stack Cells.

At the lowest address is a Tag 4 String Marker, followed by an Untouched_DD MOM Descriptor for the EBCDIC Arrays which contain the String Data, and lastly an Untouched_DD MOM Descriptor for the Integer Arrays which contain the current logical Length of the String Data.

The Stack Cells are created by calling the MCP ArrayDec Intrinsic, which also adds the information for the other dimensions of each of the arrays into the MCP's Array Index Table (AIT). 

0032 (02,001C) 5 000000 400029 Desc: Untouched, Length=4 (AIT index=41) 
0031 (02,001B) 5 000000 400022 HEXSTRINGARRAY (Hex array) Untouched,
                          Length=4 (AIT index=34) 
0030 (02,001A) 4 000FFF EC0000 String marker 
002F (02,0019) 5 000000 600000 Desc: Untouched, Length=6 (Unreferenced olay space)
002E (02,0018) 5 000000 600019 EBCDICSTRINGARRAY(EBCDIC array) Untouched,
                         Length=6 (AIT index=25) 
002D (02,0017) 4 000FFF EC0000 String marker 

The declaration of ArrayDec is in the MCP at 4709950, 

PROCEDURE ARRAYDEC (SIRW_TO_MOM,NO_OF_DIMS,TYPE_INFO); 
 VALUE SIRW_TO_MOM, NO_OF_DIMS, TYPE_INFO; 
 REAL NO_OF_DIMS; 
 WORD SIRW_TO_MOM, TYPE_INFO; 

ArrayDec is declared as a PROCEDURE and behaves as one for String Arrays. It stores the String Marker at the Stack Cell below the SIRW_TO_MOM, the Ebcdic String Array Untouched_DD at the SIRW_TO_MOM, and the Integer Array Untouched_DD at the Stack Cell above the SIRW_TO_MOM.

ArrayDec deletes the Top 2 Stack Items passed under it's MSCW, which are the Maximum String Length and the Initial String Length hidden dimension.

The Compiler is responsible for deleting the Declared Dimension Words.

 

   For string arrays, the compilers do their own cleanup, all
   except for two cells.  Odd.
    
  MOVE_THIS_AR_DOWN (2);
  EXIT;    must EXIT after moving my AR.
  END;

 

The three parameters declared for ArrayDec are,

  1. An SIRW to the Untouched MOM Descriptor of the Ebcdic Arrays (SIRW_TO_MOM).
  2. The Number of  Dimensions (declared and hidden) (NO_OF_DIMS).
  3. Information about the type of array being declared (See the layout of TYPE_INFO).

The number of elements in each Declared Dimension is passed beneath the MSCW of the ArrayDec call, one word for each Dimension, along with the initial size of the Hidden Dimension, and the Maximum String Size

Hex String Array HexStringArray[0:3,0:2];
 (02,001A) = STRING MARKER
 (02,001B) = HEXSTRINGARRAY
 (02,001C) = HEXSTRINGARRAY.LENGTH
 0003:001D:1  LT48               BE
 0003:001E                       000000000004 (3"0000000000000004")
 0003:001F:0  LT48               BE
 0003:0020                       000000000003 (3"0000000000000003")
 0003:0021:0  LT8   132          B284
 0003:0021:2  LT16  65534        B3FFFE
 0003:0021:5  MKSN               DF
 0003:0022:0  NAMC  (01,0004)    6004  ARRAYDEC
 0003:0022:2  NAMC  (02,001B)    501B 
 0003:0022:4  STFF               AF
 0003:0022:5  LT8   3            B203
 0003:0023:1  LT8   18           B212
 0003:0023:3  BSET  41           9629
 0003:0023:5  ENTR               AB
 0003:0024:0  DLET               B5
 0003:0024:1  DLET               B5    

The maximum number of Dimensions is 16 (See ArrayDec at 4714296).

The compiler stacks the Declared Dimension words, the Hidden Dimension and the Maximum String Length and then calls ArrayDec. ArrayDec deletes the Hidden Dimension and the Maximum String Length and the Compiler issues a DLET for each Declared Dimension.

This is an example of a call to ArrayDec,

  Dimensions.SetToBeginning;
  While Dimensions.Next(Elements) Do
    CodeSegment.LT48(Elements);
  CodeSegment.LT8(StringInitLengthV);   % Hidden Dimension
  CodeSegment.LT16(StringPoolStringMaxV);
  CodeSegment.MKSN;
  CodeSegment.NMC1(D1_Stack.MCPIntrinsicSDI(ArrayDecV));
  CodeSegment.LNMC(LL,Displacement);
  CodeSegment.STFF;
  CodeSegment.LT48(Dimensions.Count+1);
  CodeSegment.LT48(TypeInfo &           1 StringF
                            & ElementSize ChrSzF
                            &   ItemCount NoOfItemsF);
  CodeSegment.ENTR;
  Thru Dimensions.Count Do
    CodeSegment.DLET;

ArrayDec Integerizes the Dimensions.