Patent GB-1420163-A (GB)
Title: Allocation of storage addresses to data elements
IPC: G06F7/76
Filed: 1973-03-21
Abstract: 1420163 Allocating storage addresses INTERNATIONAL BUSINESS MACHINES CORP 21 March 1973 [19 April 1972] 13535/73 Heading G4A The Specification describes processing data relating to a string of data elements of varying lengths so as to generate for each data element a storage address such that the data may be stored in an optimum manner. General.-Generally data stores comprise a plurality of byte storage cells which are accessible only in predetermined groups, e.g. half words (two bytes), words, or double words. To ensure the minimum number of storage accesses to retrieve a given number of data elements the beginning of each element must occur at a corresponding address division. For example in Fig. 4 a store is represented at 40 with successive byte locations 28-60. A data string A-E may be stored as follows: the last element E is loaded at half-word boundary 34, byte D is loaded at byte boundary 35, double word C is loaded at double word boundary 48 since otherwise it would straddle double word boundary 40 and require two accesses to retrieve, &c. It is now possible, beginning with the first element A to compress the data to minimize the gaps as shown in Fig. 5A-5C. As described the data are never loaded in the store but a series of "characteristic sets" each including data relating to a particular one, or group of data elements are processed to establish optimum storage addresses. The data is hierarchical consisting of a structure which consists of several sub-structures each of which may be a single element or further lower level substructures. A "characteristic set" is provided for each structure, sub-structure, and element and specifies in a field Y the type (structure, sub-structure, element); in a field R the level in the hierarchy; in a field V the position within the structure, substructure; in a field Z the storage boundary type (the type being that of the largest constituent element); in a field L the length of the structure, substructure, element; in a field W an overhang (see below); in a field EA a storage address relative to the beginning of the structure or substructure of which it is a part; in a field PL a pointer to the set of the last element or substructure within the relevant substructure; and in a field PV a pointer to the set of the preceding substructure or element on the same level. Operation.-The characteristic sets are loaded in a working store in chronological order. The structure is then "listed". For a structure S where the set for structure S is accessed and its address PS in the store loaded in a push down stack. The sets are then examined in sequence, A, U1, B, U2 &c. and fields Y tested to determine whether the set relates to a substructure. In this case the set for U1 has its address transferred to push down store. When the set for U2 is tested its field V indicates that it is the last substructure within substructure U1 which leads to the address of set U1 being read from the push down store and used to access the set for U1. A pointer to the set for U2, viz. its address PU2 in store 48, is inserted in the field PL of set U1 which is replaced, the address PU2 of the set for U2 being subsequently loaded in the push down store. The operation proceeds until the set for U3 is reached when a comparison of the level field R of set U3 with the current status of the push down store indicates that the latter already contains an entry of the same level, viz. Ul. The entry for U1 in the push down store, viz. PU1, is replaced by an entry for U3, viz. PU3 and the U1 entry, viz. PU1, is entered in field PV of the set for U3. PU3 is also entered into the field PL of the set for S as U3 is the last substructure of its level within S. The set for U4 is then scanned and since it is of level 3 and push down store already contains an entry of the same level, viz. PU2, the above procedure is repeated with U4 and U2. When the set for U5 is scanned the procedure is again repeated with U4 and U5 since the push down stack already contains a level 3 entry, originally U2, now U4. When the set for the last element is scanned push down store contains the addresses in store of the sets for the last substructure in each level, viz. PS, PU3, and PU5 and all the sets contain in their fields PL and PV the appropriate chaining addresses and the addresses of the last element in their associated sub-structure. A length indicating the amount of storage required to load the data elements at appropriate address boundaries is then accumulated by accessing the lowest level entry in the push down store, accessing the corresponding set and using the appropriate chaining field to access the last element in the corresponding substructure. All the sets associated with this last substructure are accessed in reverse order using the chaining addresses to calculate a total length and an overhang, i.e. the distance between the last considered element and the next boundary address corresponding to the largest element in the sub-structure. The sets are then accessed is sequence, beginning with the first, in order to compress the data by developing, for each element, an address relative to the first element and loading the address in field EA of the appropriate set, the sub-structure length being updated as appropriate. The procedure is then repeated using the chaining addresses and the entries in the push down store so as to process the characteristic sets of successive, earlier, sub-structures on successive higher levels and, finally, the characteristic set of the structure. From the relative addresses thus developed real storage addresses may be derived to load the structure in storage in an optimum manner. Apparatus.-The Specification describes suitable apparatus, Fig. 2 (not shown), referring to Specification 1,091,937.