User Tools

Site Tools


cdc:nos2.source:nam5871:inip

Table of Contents

INIP

Table Of Contents

  • [00014] PRGM INIP
  • [00094] PROC IKDIS
  • [00095] PROC ISCP
  • [00096] PROC ITABS
  • [00097] PROC OMSG
  • [00098] PROC OTIME
  • [00099] PROC NXDCB
  • [00100] PROC OVLCALL
  • [00101] PROC XTRACE

Source Code

INIP.txt
  1. *DECK INIP
  2. USETEXT NIPDEF
  3. USETEXT BPIPBUF
  4. USETEXT FREETAB
  5. USETEXT INPARUT
  6. USETEXT MEM
  7. USETEXT MSGIDX
  8. USETEXT STATTAB
  9. USETEXT STATTB2
  10. USETEXT SYSCOMD
  11. USETEXT SYSTIME
  12. USETEXT OVERLAY
  13. USETEXT DBGBUF
  14. PRGM INIP; # NIP INITIALIZATION PROCEDURE #
  15. *CALL NAMLEV
  16. STARTIMS;
  17. #
  18. *1DC INIP
  19. *
  20. * 1. PROC NAME AUTHOR DATE
  21. * INIP S. WATANABE 80/03/25
  22. *
  23. * 2. FUNCTIONAL DESCRIPTION.
  24. * THIS ROUTINE IS RESPONSIBLE FOR SETTING UP NIP-S TABLES, POTS
  25. * AND BUFFERS PLUS WHATEVER INITIALIZATION IS NEEDED.
  26. *
  27. * 3. METHOD USED.
  28. * INITIALIZE TABLES AND FREETAB
  29. * INITIALIZE NIP AS A SYSTEM-CONTROL-POINT
  30. * INITIALIZE K DISPLAY
  31. * DISPLAY INITIALIZED MESSAGE
  32. *
  33. * 4. ENTRY PARAMETERS. NONE
  34. *
  35. * 5. EXIT PARAMETERS. NONE
  36. *
  37. * 6. COMDECKS CALLED AND SYMPL TEXTS USED.
  38. * NIPDEF BPIPBUF FREETAB
  39. * OSIZE STATTB2 SYSCOMD
  40. * SYSTIME
  41. *
  42. * 7. ROUTINES AND OVERLAYS CALLED.
  43. * IKDIS INITIALIZE K DISPLAY
  44. * ILOFS INITIALIZE LIST OF FILES
  45. * ISCP INITIALIZE NIP AS SCP
  46. * ITABS INITIALIZE TABLES AND FREETAB
  47. * ITRACE INITIALIZE TRACE BUFFER
  48. * OMSG ISSUE DAYFILE MESSAGE
  49. * OTIME GET SYSTEM TIME
  50. * XTRACE TRACES CALLS
  51. *
  52. * 8. DAYFILE MESSAGES.
  53. * *NAM VER 1.2- NNN* AND
  54. * *NAM REG LEVEL 0*
  55. * THESE MESSAGES DISPLAYED WHEN INITIALIZATION PROCEDURES
  56. * HAVE BEEN COMPLETED.
  57. *
  58. * THIS PROGRAM IS A PRIMARY OVERLAY LOADED BY SUBROUTINE OVLCALL.
  59. * WHEN EXECUTION HAS COMPLETED, A JUMP IS MADE TO LOCATION RJMAIN
  60. * TO RETURN TO THE CALLING PROGRAM.
  61. *
  62. * W A R N I N G - THIS PROGRAM IS LOADED WITH IKDIS,
  63. * ISCP, ITABS, AND ITRACE. THE SUM
  64. * OF THEIR SIZES MUST NOT EXCEED THE
  65. *CALL OSIZE
  66. *
  67. * THIS OVERLAY IS CALLED BY NIP.
  68. *
  69.  #
  70. STOPIMS;
  71. #
  72.  
  73. PARAMETERS
  74.   INPUT NONE
  75.   OUTPUT NONE
  76. #
  77. #
  78.   EXTERNAL VARIABLES
  79. #
  80. XREF
  81. BEGIN # RA COMMUNICATION AREA #
  82. ARRAY ARG[1:22] S(1);
  83. BEGIN
  84. ITEM ARGSYM C(00,00,07); # ARGUMENT VALUE #
  85. ITEM ARGSEP U(00,NL,AL); # ARGUMENT SEPERATOR #
  86. ITEM ARGWORD U(00,00,60); # WHOLE WORD #
  87. END
  88. ARRAY ACT[0:0] S(1);
  89. BEGIN
  90. ITEM ACTCOUNT U(00,NL,AL); # ARGUMENT COUNT #
  91. END
  92. END
  93. XREF BEGIN
  94. PROC IKDIS; # INITIALIZE K DISPLAY #
  95. PROC ISCP; # INITIALIZE NIP AS A SYSTEM CP #
  96. PROC ITABS; # INITIALIZE NBT,POA,CET,AT,TNT,FREETAB #
  97. PROC OMSG; # DAYFILE MESSAGE IN NIP"S DAYFILE #
  98. PROC OTIME; # GET SYSTEM TIME #
  99. PROC NXDCB; # CONVERT DISPLAY CODE TO BINARY #
  100. PROC OVLCALL; # LOAD AND EXECUTE OVERLAY #
  101. PROC XTRACE; # TRACE CALLS #
  102. LABEL RJMAIN; # RETURN ADDRESS IN OVLCALL #
  103. END
  104. #
  105.   LOCAL VARIABLES
  106. #
  107. ITEM I U=0; # COUNTER FOR CARD-PARAMETERS #
  108. ITEM J U=0; # INDEX INTO THE TABLE OF VALID PARAMETERS #
  109. ITEM PARRC U=0; # REASON CODE FOR CARD ERROR #
  110. ITEM LEN U=0; # MAXIMUM LENGTH ALLOWED FOR PARAMETER VALUE #
  111. ITEM NUM U; #DISPLAY CODE DIGIT#
  112. ITEM DIGIT U; #EITHER 10 OR 8#
  113. ITEM DONE B; #DONE FLAG#
  114. ITEM N U; #INDEX#
  115. ITEM PARV U=0; # PARAMETER VALUE #
  116. ITEM PARCHAR C(1);
  117. ITEM ERROR B; # ERROR FLAG RETURNED FROM CONV. RTN. #
  118. #
  119.   MISC DEFS
  120. #
  121. DEF EQUAL #O"54"#;
  122. DEF YES #O"31052300000000"#;
  123. DEF YY #O"31000000000000"#;
  124. DEF NO #O"16170000000000"#;
  125. DEF NN #O"16000000000000"#;
  126. DEF MAXPARAM #12#; #NUMBER OF VALID PARAMETERS#
  127. DEF MAXERRS #08# ; # MAXIMUM ERROR MESSAGES ACTIVE #
  128. # #
  129. SWITCH PARLAB PARNIN,IFSTP,IFSTP,PRUU,PRUU,PRUU,
  130. PARMC,PARACT,PARFL,PRUU,PRUU,PRUU,PARERR;
  131. #
  132.   ARRAY AND MESSAGE ARRAYS
  133. #
  134. ARRAY PARS [0:MAXPARAM] S(1);
  135. BEGIN
  136. ITEM PARVAL U(0,00,42) = [
  137. O"16111600000000", # NIN #
  138. O"11232420000000", # ISTP #
  139. O"06232420000000", # FSTP #
  140. O"16342022250200", # N1PRUB #
  141. O"16352022250200", # N2PRUB #
  142. O"16362022250200", # N3PRUB #
  143. O"15030000000000", # MC #
  144. O"11160103240000", # INACT #
  145. O"15013006140000", # MAXFL #
  146. O"16340000000000", # N1 #
  147. O"16350000000000", # N2 #
  148. O"16360000000000", # N3 #
  149. 0];
  150. ITEM PARLEN U(0,42,18) = [3,3,3,2,2,2,7,7,7,2,2,2,7];
  151. END
  152. # #
  153. ARRAY PARMSGR [1:MAXERRS] S(3);
  154. BEGIN
  155. ITEM PARMSG C(0,0,30);
  156. ITEM PARMSGE U(3,48,12) = [ 0, 0, 0, 0, 0, 0]; #TERMINATE MSG#
  157. ITEM PARNUM U(0,6,6) ;
  158. ITEM PARMSGT C(0,0,28) = [
  159. "CONTROL-CARD FORMAT ERROR ",
  160. "PARAMETER EXCEEDS MAX LENGTH",
  161. "ILLEGAL PARAMETER VALUE",
  162. "ONLY YES OR NO ALLOWED ",
  163. "UNRECOGNIZED PARAMETER ",
  164. "NIN MUST BE SPECIFIED ",
  165. "LOWER PRU-STATE IS ZERO ",
  166. "NXPRUB IS BELOW MINIMUM "] ;
  167. END
  168.  
  169. ARRAY MERPRUA [1:MAXPRU] P(1); # MININUM VALUE FOR PRU BUFFERS #
  170. BEGIN
  171. ITEM MERPRU = [2,4,2];
  172. END
  173. ITEM TEMPLWA;
  174.  
  175. CONTROL IFEQ DEBUG,1 ;
  176. # DEBUG NAM DAYFILE MESSAGE #
  177.  
  178. ARRAY DBGNAM [0:0] S(3);
  179. BEGIN
  180. ITEM DBGMSG C(0,0,20) = ["NAM BUILT WITH DEBUG"];
  181. ITEM DBGZRO U(2,0,60) = [0];
  182. END
  183. CONTROL FI;
  184. CONTROL IFEQ STAT,1 ;
  185. # STAT NAM DAYFILE MESSAGE #
  186.  
  187. ARRAY STNAM [0:0] S(3);
  188. BEGIN
  189. ITEM STMSG C(0,0,20) = ["NAM BUILT WITH STAT"];
  190. ITEM STZRO U(2,0,60) = [0];
  191. END
  192. CONTROL FI;
  193.  
  194. # NAM REGULATION LEVEL DAYFILE MESSAGE #
  195.  
  196. ARRAY NAMREG [0:0] S(2);
  197. BEGIN
  198. ITEM NAMREGM C(0,0,13) = ["NAM REG LEVEL"];
  199. ITEM NAMREGN C(1,18,5) = [" 0"]; # LEVEL NUMBER IN DECIMAL #
  200. ITEM NAMREGZ U(2,48,12) = [0];
  201. END
  202.  
  203. #**********************************************************************#
  204. BEGIN
  205. CONTROL IFEQ DEBUG,1 ;
  206. XTRACE("INIP ") ;
  207. CONTROL FI;
  208. #
  209.   INITIALIZE MAXFL TO MAXNIP (60000B)
  210.  #
  211. MAXFL = MAXNIP;
  212. #
  213.   STEP 0 - GET PARAMETERS FROM CONTROL CARD
  214. #
  215. BEGIN
  216. FOR I=1 STEP 2 WHILE(I LS ACTCOUNT[0] AND PARRC EQ 0) DO
  217. BEGIN
  218. IF ARGSEP[I] NQ EQUAL
  219. OR ARGSEP[I+1] NQ 0
  220. THEN
  221. BEGIN
  222. PARRC=1;
  223. END
  224. ELSE
  225. BEGIN
  226. PARVAL[MAXPARAM] = ARGSYM[I];
  227. FOR J=0 STEP 1 UNTIL MAXPARAM DO
  228. BEGIN
  229. IF ARGSYM[I] EQ PARVAL[J] THEN
  230. BEGIN
  231. LEN = PARLEN[J];
  232. IF LEN EQ NC OR C<LEN,NC-LEN>ARGSYM[I+1] EQ 0
  233. THEN
  234. GOTO PARLAB[J];
  235. ELSE
  236. BEGIN
  237. PARRC = 2;
  238. END
  239. END
  240. END
  241. END
  242. GOTO PAREXIT;
  243. PARNIN:
  244. NXDCB(ARGSYM[I+1],PARV,ERROR);
  245. IF ERROR
  246. THEN
  247. PARRC = 3; # ILLEGAL PARAMETER VALUE #
  248. ELSE
  249. INPNIN[1] = C<0,LEN>ARGSYM[I+1];
  250. GOTO PAREXIT;
  251.  
  252. PARMC:
  253. NXDCB(ARGSYM[I+1],MC,ERROR);
  254. IF ERROR
  255. THEN
  256. PARRC = 3; # ILLEGAL PARAMETER VALUE #
  257. GOTO PAREXIT;
  258. PARFL:
  259. DIGIT = 10;
  260. DONE = FALSE;
  261. #
  262.   CHECK IF THERE IS A B IN THE PARAMETER.
  263.   IF THERE IS B, THEN DIGIT IS 8.
  264.  #
  265. FOR N=0 STEP 1 WHILE N LS WC AND NOT DONE
  266. DO
  267. BEGIN
  268. NUM = C<N,1>ARGSYM[I+1];
  269. IF (NUM EQ O"02")
  270. THEN
  271. BEGIN
  272. DIGIT = 8;
  273. DONE = TRUE;
  274. END
  275. END
  276. #
  277.   CONVERT DISPLAY CODE TO BINARY, DEPENDING ON DECIMAL
  278.   OR OCTAL.
  279.  #
  280. ERROR = FALSE;
  281. DONE = FALSE;
  282. MAXFL = 0;
  283. FOR N=0 STEP 1 WHILE N LS WC AND NOT ERROR AND NOT DONE
  284. DO
  285. BEGIN
  286. NUM = C<N,1>ARGSYM[I+1];
  287. IF (NUM EQ O"02" OR NUM EQ O"04" OR NUM EQ O"00")
  288. THEN
  289. DONE = TRUE;
  290. ELSE
  291. IF (NUM GQ O"33" AND NUM LQ O"44")
  292. THEN
  293. MAXFL = (MAXFL * DIGIT) + (NUM - O"33");
  294. ELSE
  295. ERROR = TRUE;
  296. END
  297. IF ERROR
  298. THEN
  299. PARRC = 3; #ILLEGAL PARAMETER VALUE#
  300. #
  301.   IF MAXFL IS GREATER THAN MAXXFL, THEN SET IT TO MAXXFL
  302.  #
  303. IF MAXFL GR MAXXFL
  304. THEN
  305. MAXFL =MAXXFL;
  306. # LOOP #
  307. GOTO PAREXIT;
  308. IFSTP:
  309. BEGIN
  310. IF ARGSYM[I+1] EQ YES OR ARGSYM[I+1] EQ YY
  311. THEN
  312. BEGIN
  313. INPSTP[J] = TRUE;
  314. END
  315. ELSE
  316. BEGIN
  317. IF ARGSYM[I+1] EQ NO OR ARGSYM[I+1] EQ NN
  318. THEN
  319. BEGIN
  320. INPSTP[J] = FALSE;
  321. END
  322. ELSE
  323. BEGIN
  324. PARRC = 4;
  325. END
  326. END
  327. GOTO PAREXIT;
  328. END
  329.  
  330. PRUU: # PRU BUFFER COUNT PARAMETER #
  331. NXDCB(ARGSYM[I+1],PARV,ERROR); # CONVERT TO BINARY VALUE #
  332. IF ERROR
  333. THEN # ILLEGAL PARAMETER VALUE #
  334. PARRC = 3;
  335. ELSE
  336. BEGIN
  337. IF J GQ 9
  338. THEN J = J-6; #MAKE J THE SAME AS NNPRU#
  339. IF PARV LS MERPRU[J-2]
  340. THEN
  341. BEGIN
  342. PARNUM[8] = J - 2 + O"33";
  343. OMSG(PARMSG[8],0) ; # DAYFILE A MESSAGE #
  344. PARV = MERPRU[J-2]; # LESS THAN MINIMUM, USE MINIMUM VALUE #
  345. END
  346.  
  347. INPPRU[J-2] = PARV ; # SET PRU BUFFER COUNT #
  348.  
  349. END
  350.  
  351. GOTO PAREXIT;
  352. PARACT:
  353. NXDCB(ARGSYM[I+1],PARV,ERROR) ;
  354. IF ERROR
  355. THEN
  356. PARRC = 3 ;
  357. ELSE
  358. IF PARV GR 0
  359. THEN
  360. INACTVAL = PARV * 60 ; # SET INACT TIME TO INPUT VALU#
  361.  
  362. GOTO PAREXIT ;
  363. PARERR: BEGIN
  364. PARRC = 5;
  365. GOTO PAREXIT;
  366. END
  367. PAREXIT:
  368. END # LOOP ON PARAMETERS #
  369. IF INPNIN[1] EQ O"333333"
  370. THEN
  371. BEGIN # NIN VALUE MUST BE SPECIFIED #
  372. PARRC = 6 ;
  373. END
  374. # #
  375. IF PARRC NQ 0
  376. THEN
  377. OMSG(PARMSG[PARRC],0);
  378. # #
  379. END # PARAMETER PROCESSING #
  380. # #
  381. #
  382.  STEP 1 INITIALIZE NBT, POA, CET, AT, TNT AND FREETAB
  383. #
  384. CONTROL IFEQ STAT,1; # STATISTICS ON #
  385. #
  386.   INITIALIZE STATISTICS VARIABLES FOR DETERMINING AVG FL, AVG NO
  387.   OF EMPTY BUFS, AND AVG NO OF EMPTY WORDS
  388. #
  389. OTIME(THETIME); # GET CURRENT SYSTEM TIME #
  390. TIMESTR = RTSECS[0]; # TIME NIP BEGIN EXECUTION #
  391. TIMECFL = TIMESTR; # TIME FOR MEASURING OCFL CALLS #
  392. TIMEGBG = TIMESTR; # TIME FOR MEASURING MGBGCLT CALLS #
  393. CONTROL FI;
  394.  
  395. ITABS; # SET UP TABLES #
  396.  
  397. #
  398.  STEP 2 INITIALIZE NIP AS A SCP
  399. #
  400. SSCVF[0] = TRUE;
  401. SSCLP[0] = 66;
  402. SSCLK[0] = FALSE;
  403. ISCP; # INITIALIZE NIP AS A SYSTEM CP, READ CHAR#
  404. #
  405.   INITIALIZE THE K DISKPLAY
  406. #
  407. IKDIS;
  408. #
  409.   ISSUE DAYFILE MESSAGES
  410. #
  411. OMSG(NAMLEV,0); # NIP INITIALIZED, NAM VERSION MSG #
  412.  
  413. CONTROL IFEQ DEBUG,1 ;
  414. OMSG(DBGNAM,0); # ISSUE DEBUG NAM MESSAGE #
  415. CONTROL FI;
  416.  
  417. CONTROL IFEQ STAT,1 ;
  418. OMSG(STNAM,0); # ISSUE STAT NAM MESSAGE #
  419. CONTROL FI;
  420.  
  421. OMSG(NAMREG,0); # NAM REGULATION LEVEL = 0 #
  422.  
  423. GOTO RJMAIN; # RETURN TO CALLING PROGRAM #
  424.  
  425. END
  426. TERM
cdc/nos2.source/nam5871/inip.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator