*DECK INIP USETEXT NIPDEF USETEXT BPIPBUF USETEXT FREETAB USETEXT INPARUT USETEXT MEM USETEXT MSGIDX USETEXT STATTAB USETEXT STATTB2 USETEXT SYSCOMD USETEXT SYSTIME USETEXT OVERLAY USETEXT DBGBUF PRGM INIP; # NIP INITIALIZATION PROCEDURE # *CALL NAMLEV STARTIMS; # *1DC INIP * * 1. PROC NAME AUTHOR DATE * INIP S. WATANABE 80/03/25 * * 2. FUNCTIONAL DESCRIPTION. * THIS ROUTINE IS RESPONSIBLE FOR SETTING UP NIP-S TABLES, POTS * AND BUFFERS PLUS WHATEVER INITIALIZATION IS NEEDED. * * 3. METHOD USED. * INITIALIZE TABLES AND FREETAB * INITIALIZE NIP AS A SYSTEM-CONTROL-POINT * INITIALIZE K DISPLAY * DISPLAY INITIALIZED MESSAGE * * 4. ENTRY PARAMETERS. NONE * * 5. EXIT PARAMETERS. NONE * * 6. COMDECKS CALLED AND SYMPL TEXTS USED. * NIPDEF BPIPBUF FREETAB * OSIZE STATTB2 SYSCOMD * SYSTIME * * 7. ROUTINES AND OVERLAYS CALLED. * IKDIS INITIALIZE K DISPLAY * ILOFS INITIALIZE LIST OF FILES * ISCP INITIALIZE NIP AS SCP * ITABS INITIALIZE TABLES AND FREETAB * ITRACE INITIALIZE TRACE BUFFER * OMSG ISSUE DAYFILE MESSAGE * OTIME GET SYSTEM TIME * XTRACE TRACES CALLS * * 8. DAYFILE MESSAGES. * *NAM VER 1.2- NNN* AND * *NAM REG LEVEL 0* * THESE MESSAGES DISPLAYED WHEN INITIALIZATION PROCEDURES * HAVE BEEN COMPLETED. * * THIS PROGRAM IS A PRIMARY OVERLAY LOADED BY SUBROUTINE OVLCALL. * WHEN EXECUTION HAS COMPLETED, A JUMP IS MADE TO LOCATION RJMAIN * TO RETURN TO THE CALLING PROGRAM. * * W A R N I N G - THIS PROGRAM IS LOADED WITH IKDIS, * ISCP, ITABS, AND ITRACE. THE SUM * OF THEIR SIZES MUST NOT EXCEED THE *CALL OSIZE * * THIS OVERLAY IS CALLED BY NIP. * # STOPIMS; # PARAMETERS INPUT NONE OUTPUT NONE # # EXTERNAL VARIABLES # XREF BEGIN # RA COMMUNICATION AREA # ARRAY ARG[1:22] S(1); BEGIN ITEM ARGSYM C(00,00,07); # ARGUMENT VALUE # ITEM ARGSEP U(00,NL,AL); # ARGUMENT SEPERATOR # ITEM ARGWORD U(00,00,60); # WHOLE WORD # END ARRAY ACT[0:0] S(1); BEGIN ITEM ACTCOUNT U(00,NL,AL); # ARGUMENT COUNT # END END XREF BEGIN PROC IKDIS; # INITIALIZE K DISPLAY # PROC ISCP; # INITIALIZE NIP AS A SYSTEM CP # PROC ITABS; # INITIALIZE NBT,POA,CET,AT,TNT,FREETAB # PROC OMSG; # DAYFILE MESSAGE IN NIP"S DAYFILE # PROC OTIME; # GET SYSTEM TIME # PROC NXDCB; # CONVERT DISPLAY CODE TO BINARY # PROC OVLCALL; # LOAD AND EXECUTE OVERLAY # PROC XTRACE; # TRACE CALLS # LABEL RJMAIN; # RETURN ADDRESS IN OVLCALL # END # LOCAL VARIABLES # ITEM I U=0; # COUNTER FOR CARD-PARAMETERS # ITEM J U=0; # INDEX INTO THE TABLE OF VALID PARAMETERS # ITEM PARRC U=0; # REASON CODE FOR CARD ERROR # ITEM LEN U=0; # MAXIMUM LENGTH ALLOWED FOR PARAMETER VALUE # ITEM NUM U; #DISPLAY CODE DIGIT# ITEM DIGIT U; #EITHER 10 OR 8# ITEM DONE B; #DONE FLAG# ITEM N U; #INDEX# ITEM PARV U=0; # PARAMETER VALUE # ITEM PARCHAR C(1); ITEM ERROR B; # ERROR FLAG RETURNED FROM CONV. RTN. # # MISC DEFS # DEF EQUAL #O"54"#; DEF YES #O"31052300000000"#; DEF YY #O"31000000000000"#; DEF NO #O"16170000000000"#; DEF NN #O"16000000000000"#; DEF MAXPARAM #12#; #NUMBER OF VALID PARAMETERS# DEF MAXERRS #08# ; # MAXIMUM ERROR MESSAGES ACTIVE # # # SWITCH PARLAB PARNIN,IFSTP,IFSTP,PRUU,PRUU,PRUU, PARMC,PARACT,PARFL,PRUU,PRUU,PRUU,PARERR; # ARRAY AND MESSAGE ARRAYS # ARRAY PARS [0:MAXPARAM] S(1); BEGIN ITEM PARVAL U(0,00,42) = [ O"16111600000000", # NIN # O"11232420000000", # ISTP # O"06232420000000", # FSTP # O"16342022250200", # N1PRUB # O"16352022250200", # N2PRUB # O"16362022250200", # N3PRUB # O"15030000000000", # MC # O"11160103240000", # INACT # O"15013006140000", # MAXFL # O"16340000000000", # N1 # O"16350000000000", # N2 # O"16360000000000", # N3 # 0]; ITEM PARLEN U(0,42,18) = [3,3,3,2,2,2,7,7,7,2,2,2,7]; END # # ARRAY PARMSGR [1:MAXERRS] S(3); BEGIN ITEM PARMSG C(0,0,30); ITEM PARMSGE U(3,48,12) = [ 0, 0, 0, 0, 0, 0]; #TERMINATE MSG# ITEM PARNUM U(0,6,6) ; ITEM PARMSGT C(0,0,28) = [ "CONTROL-CARD FORMAT ERROR ", "PARAMETER EXCEEDS MAX LENGTH", "ILLEGAL PARAMETER VALUE", "ONLY YES OR NO ALLOWED ", "UNRECOGNIZED PARAMETER ", "NIN MUST BE SPECIFIED ", "LOWER PRU-STATE IS ZERO ", "NXPRUB IS BELOW MINIMUM "] ; END ARRAY MERPRUA [1:MAXPRU] P(1); # MININUM VALUE FOR PRU BUFFERS # BEGIN ITEM MERPRU = [2,4,2]; END ITEM TEMPLWA; CONTROL IFEQ DEBUG,1 ; # DEBUG NAM DAYFILE MESSAGE # ARRAY DBGNAM [0:0] S(3); BEGIN ITEM DBGMSG C(0,0,20) = ["NAM BUILT WITH DEBUG"]; ITEM DBGZRO U(2,0,60) = [0]; END CONTROL FI; CONTROL IFEQ STAT,1 ; # STAT NAM DAYFILE MESSAGE # ARRAY STNAM [0:0] S(3); BEGIN ITEM STMSG C(0,0,20) = ["NAM BUILT WITH STAT"]; ITEM STZRO U(2,0,60) = [0]; END CONTROL FI; # NAM REGULATION LEVEL DAYFILE MESSAGE # ARRAY NAMREG [0:0] S(2); BEGIN ITEM NAMREGM C(0,0,13) = ["NAM REG LEVEL"]; ITEM NAMREGN C(1,18,5) = [" 0"]; # LEVEL NUMBER IN DECIMAL # ITEM NAMREGZ U(2,48,12) = [0]; END #**********************************************************************# BEGIN CONTROL IFEQ DEBUG,1 ; XTRACE("INIP ") ; CONTROL FI; # INITIALIZE MAXFL TO MAXNIP (60000B) # MAXFL = MAXNIP; # STEP 0 - GET PARAMETERS FROM CONTROL CARD # BEGIN FOR I=1 STEP 2 WHILE(I LS ACTCOUNT[0] AND PARRC EQ 0) DO BEGIN IF ARGSEP[I] NQ EQUAL OR ARGSEP[I+1] NQ 0 THEN BEGIN PARRC=1; END ELSE BEGIN PARVAL[MAXPARAM] = ARGSYM[I]; FOR J=0 STEP 1 UNTIL MAXPARAM DO BEGIN IF ARGSYM[I] EQ PARVAL[J] THEN BEGIN LEN = PARLEN[J]; IF LEN EQ NC OR CARGSYM[I+1] EQ 0 THEN GOTO PARLAB[J]; ELSE BEGIN PARRC = 2; END END END END GOTO PAREXIT; PARNIN: NXDCB(ARGSYM[I+1],PARV,ERROR); IF ERROR THEN PARRC = 3; # ILLEGAL PARAMETER VALUE # ELSE INPNIN[1] = C<0,LEN>ARGSYM[I+1]; GOTO PAREXIT; PARMC: NXDCB(ARGSYM[I+1],MC,ERROR); IF ERROR THEN PARRC = 3; # ILLEGAL PARAMETER VALUE # GOTO PAREXIT; PARFL: DIGIT = 10; DONE = FALSE; # CHECK IF THERE IS A B IN THE PARAMETER. IF THERE IS B, THEN DIGIT IS 8. # FOR N=0 STEP 1 WHILE N LS WC AND NOT DONE DO BEGIN NUM = CARGSYM[I+1]; IF (NUM EQ O"02") THEN BEGIN DIGIT = 8; DONE = TRUE; END END # CONVERT DISPLAY CODE TO BINARY, DEPENDING ON DECIMAL OR OCTAL. # ERROR = FALSE; DONE = FALSE; MAXFL = 0; FOR N=0 STEP 1 WHILE N LS WC AND NOT ERROR AND NOT DONE DO BEGIN NUM = CARGSYM[I+1]; IF (NUM EQ O"02" OR NUM EQ O"04" OR NUM EQ O"00") THEN DONE = TRUE; ELSE IF (NUM GQ O"33" AND NUM LQ O"44") THEN MAXFL = (MAXFL * DIGIT) + (NUM - O"33"); ELSE ERROR = TRUE; END IF ERROR THEN PARRC = 3; #ILLEGAL PARAMETER VALUE# # IF MAXFL IS GREATER THAN MAXXFL, THEN SET IT TO MAXXFL # IF MAXFL GR MAXXFL THEN MAXFL =MAXXFL; # LOOP # GOTO PAREXIT; IFSTP: BEGIN IF ARGSYM[I+1] EQ YES OR ARGSYM[I+1] EQ YY THEN BEGIN INPSTP[J] = TRUE; END ELSE BEGIN IF ARGSYM[I+1] EQ NO OR ARGSYM[I+1] EQ NN THEN BEGIN INPSTP[J] = FALSE; END ELSE BEGIN PARRC = 4; END END GOTO PAREXIT; END PRUU: # PRU BUFFER COUNT PARAMETER # NXDCB(ARGSYM[I+1],PARV,ERROR); # CONVERT TO BINARY VALUE # IF ERROR THEN # ILLEGAL PARAMETER VALUE # PARRC = 3; ELSE BEGIN IF J GQ 9 THEN J = J-6; #MAKE J THE SAME AS NNPRU# IF PARV LS MERPRU[J-2] THEN BEGIN PARNUM[8] = J - 2 + O"33"; OMSG(PARMSG[8],0) ; # DAYFILE A MESSAGE # PARV = MERPRU[J-2]; # LESS THAN MINIMUM, USE MINIMUM VALUE # END INPPRU[J-2] = PARV ; # SET PRU BUFFER COUNT # END GOTO PAREXIT; PARACT: NXDCB(ARGSYM[I+1],PARV,ERROR) ; IF ERROR THEN PARRC = 3 ; ELSE IF PARV GR 0 THEN INACTVAL = PARV * 60 ; # SET INACT TIME TO INPUT VALU# GOTO PAREXIT ; PARERR: BEGIN PARRC = 5; GOTO PAREXIT; END PAREXIT: END # LOOP ON PARAMETERS # IF INPNIN[1] EQ O"333333" THEN BEGIN # NIN VALUE MUST BE SPECIFIED # PARRC = 6 ; END # # IF PARRC NQ 0 THEN OMSG(PARMSG[PARRC],0); # # END # PARAMETER PROCESSING # # # # STEP 1 INITIALIZE NBT, POA, CET, AT, TNT AND FREETAB # CONTROL IFEQ STAT,1; # STATISTICS ON # # INITIALIZE STATISTICS VARIABLES FOR DETERMINING AVG FL, AVG NO OF EMPTY BUFS, AND AVG NO OF EMPTY WORDS # OTIME(THETIME); # GET CURRENT SYSTEM TIME # TIMESTR = RTSECS[0]; # TIME NIP BEGIN EXECUTION # TIMECFL = TIMESTR; # TIME FOR MEASURING OCFL CALLS # TIMEGBG = TIMESTR; # TIME FOR MEASURING MGBGCLT CALLS # CONTROL FI; ITABS; # SET UP TABLES # # STEP 2 INITIALIZE NIP AS A SCP # SSCVF[0] = TRUE; SSCLP[0] = 66; SSCLK[0] = FALSE; ISCP; # INITIALIZE NIP AS A SYSTEM CP, READ CHAR# # INITIALIZE THE K DISKPLAY # IKDIS; # ISSUE DAYFILE MESSAGES # OMSG(NAMLEV,0); # NIP INITIALIZED, NAM VERSION MSG # CONTROL IFEQ DEBUG,1 ; OMSG(DBGNAM,0); # ISSUE DEBUG NAM MESSAGE # CONTROL FI; CONTROL IFEQ STAT,1 ; OMSG(STNAM,0); # ISSUE STAT NAM MESSAGE # CONTROL FI; OMSG(NAMREG,0); # NAM REGULATION LEVEL = 0 # GOTO RJMAIN; # RETURN TO CALLING PROGRAM # END TERM