*DECK NVFIIVT
USETEXT TXVCBNV
PROC NVFIIVT;
# TITLE NVFIIVT - INITIALIZES THE VOT AND VDT TABLES #
BEGIN # NVFIIVT #
#
** NVFIIVT - INITIALIZES THE VOT AND VDT TABLES
*
* A. LIM 81/08/07
*
* THIS PROCEDURE INITIALIZES THE VCB-ORDINAL-TABLE(VOT) AND
* THE VCB-DATA-VALID-INDICATOR-TABLE(VDT).
*
* PROC NVFIIVT
*
* ENTRY NONE
*
* EXIT VOT IS INITIALIZED TO FREE STATE, WHILE
* VDT IS INITIALIZED TO INVALID STATE.
*
* NOTES NONE
*
* METHOD PHYSICAL FEATURES OF THE FILES SUCH AS THE
* MAXIMUM-SECTOR-PER-TRACK(MST), MAXIMUM-
* ENTRIES-PER-SECTOR(MES), ACTUAL-ENTRIES-
* PER-SECTOR(AES), BITS-USED-IN-WORD, AND
* WORDS-PER-TABLE, ARE DEFINED IN TXVCBNV.
* FIRST, A BIT PATTERN OF MES BITS WITH AES
* BITS SET IS BUILT. FOR EXAMPLE, MES = 8,
* AND AES = 7, THEN THE BIT PATTERN WOULD
* LOOK LIKE THIS: 11111110.
* FINALLY THE VOT AND THE VDT TABLES WOULD BE
* SET TO THE BIT PATTERN A BYTE AT A TIME
* UNTIL MST TIMES IS EXHAUSTED.
*
#
# ITEMS #
ITEM BITPTN U; # BIT PATTERN #
ITEM I,J,K,L I; # INDUCTION VARIABLES #
ITEM SECWORD U; # SECTORS/WORD #
ITEM WRDS U; # VOT AND VDT TABLE SIZE #
ITEM WD U; # THE NTH WORD IN THE TABLE #
CONTROL EJECT;
SECWORD = BITSWORD$/MAXENSEC$; # CAL SECTORS/WORD #
WRDS = (MAXSEC$ + SECWORD - 1)/SECWORD; # CAL TBL SIZ(VTSIZE$) #
# SET BIT PATTERN #
FOR I = 0 STEP 1 UNTIL MAXENSEC$ - 1 DO
BEGIN
IF I LQ ACTENSEC$ - 1 THEN
BEGIN
B<I,1>BITPTN = 1;
END
ELSE
BEGIN
B<I,1>BITPTN = 0;
END
END # FOR LOOP #
#
* INITIALIZES VOT AND VDT A BYTE AT A TIME WITH THE
* AFORE-DEFINED BIT PATTERN
#
FOR J = 1 STEP SECWORD UNTIL MAXSEC$ DO
BEGIN
WD = J/SECWORD;
K = MAXSEC$ - WD * SECWORD;
IF K GR SECWORD THEN
BEGIN
K = SECWORD;
END
FOR L = 0 STEP 1 UNTIL K - 1 DO
BEGIN
B<12+L*MAXENSEC$, MAXENSEC$>VOT$WORD[WD] =
B<0, MAXENSEC$>BITPTN;
B<12+L*MAXENSEC$, MAXENSEC$>VDT$WORD[WD] =
B<0, MAXENSEC$>BITPTN;
END # FOR L LOOP #
END # FOR J LOOP #
RETURN;
END # NVFIIVT #
TERM