next up previous contents index
Next: ZSHUNT - change Up: Data structure utilities Previous: MZFLAG et al.

LZHEAD - find the first bank of a linear structure

This routine will try to find the first bank of the linear structure of which the bank at LGO is a member. It does this by following the path indicated by the "origin" link of the bank at LGO, and using its "up" link.

LZHEAD!LF = LZHEAD (IXSTOR,!LGO)

It returns the address of the first bank of the linear structure as the function value; or zero if there is trouble.

If the linear structure is not a top-level structure, ie. if the up-link LUP is non-zero, the path of origin-links should end in the link region of the bank at LUP, at a word whose off-set JBIAS can then be calculated. This is returned:

      IQUEST(1) negative:  = JBIAS
ie. LQ(LUP+JBIAS) contains the address of the first bank of the linear structure.

If LUP is zero, the origin-path should end at a word outside the bank space of the store IXSTOR, which word should contain the address of the first bank of the linear structure. In this case LZHEAD returns:

      IQUEST(1) = 1: top-level structure
      IQUEST(2) = LS, relative adr of the supporting link-area link,
                      ie. LQ(LS) contains LF

If LUP is zero, and if the origin-link in the last bank in the path is zero, this is a stand-alone structure, in which case LZHEAD returns:

      IQUEST(1) = 2: stand-alone structure

If there is trouble, LZHEAD will return the function value zero, and set:

      IQUEST(3) = 1   if LGO is zero

                  2   if LUP non-zero and the last origin-link
                      points outside bank-space

                  3   if LUP non-zero and LQ(LUP+JBIAS) does not
                      point to the last bank in the origin-path

                  4   if LUP zero, and LQ(LS) does not point to
                      the last bank in the origin-path.


Janne Saarela
Mon May 15 08:34:47 METDST 1995