APPENDIX B : FORMAT OF WORK BANKS
The structure of work bank is as follows:-
Word (Integer) Contents Description
IND-3 NAME Bank Name (4 ASCII Characters)
IND-2 NT Total number of words of the bank
IND-1 IND Pointer to index of bank
IND ND Number of data words
IND+1 Data word 1
IND+2 Data word 2
... ...
IND+ND Data word ND
N.B.
(a) All work banks are Integer oriented. Thus their
total length is always an integral number of Integer
words. The internal representation of the user's
data within the data area of the bank need not be
Integer, being at the choice of the Application
Programmer.
(b) As previously noted the name for a work bank has no
function other than as a debugging aid. If required
the name should be setup explicitly by setting
IW(IND-3) to the desired Hollerith string.
(c) The total number of words of the bank NT allows the
possibility of decreasing (and in some cases
increasing) the number of data words in the bank
without moving other work banks.
(d) The Pointer to index of bank is used to update the
index IND automatically during garbage collections,
etc.
(e) The number of data words ND may be less than or equal
to NT-4.
FORMAT OF WORK BANKS Page B-2
Each work bank contains a pointer to the index of the
bank. This pointer enables the bank to be automatically
tracked if it is moved during garbage collections. Consider
the following code fragment:-
C
C Create a Work Bank with ND Data words
C
C Arguments to WBANK are:-
C
C JW YBOS Array Name
C IND Returned Index to the Bank....STATIC variable
C ND No. of Datawords in Bank
C
STATUS = WBANK(JW,IND,ND)
JND = IND
C
C Perform Garbage Collection on Workbanks
C
STATUS = WGARB(JW)
.....
This code fragment will create a work bank such that variable
IND points to the bank - i.e. JW(IND) contains the no. of
datawords, JW(IND+1) is the first dataword etc. If the
workbank is moved through the action of the garbage
collection, the contents of the variable IND will be modified
such that JW(IND) still contains the no. of datawords etc.
However, JND will not be updated in this manner, and an
attempt to access the contents of the workbank via JW(JND)
etc. may cause unpredictable results. YBOS allows work banks
to be locked temporarily such that movement of them is
inhibited (see WLOCK and WUNLK).
next page