User Tools

Site Tools


cdc:nos2.source:nam5871:ndlinit

NDLINIT

Table Of Contents

  • [00005] PROC NDLINIT
  • [00009] INITIALIZES NDLP.
  • [00043] PROC ABORT
  • [00044] PROC SSTATS
  • [00045] PROC SSTITM
  • [00046] PROC MEMORY
  • [00047] PROC MESSAGE
  • [00048] PROC READ
  • [00049] PROC RECALL
  • [00070] PROC CRACKER(ERROR)
  • [00074] CRACKER - INTERPRETS CONTROL CARD OPTIONS
  • [00111] PROC NDLZFIL

Source Code

NDLINIT.txt
  1. *DECK NDLINIT
  2. USETEXT NDLDATT
  3. USETEXT NDLFETT
  4. USETEXT NDLTBLT
  5. PROC NDLINIT;
  6. BEGIN
  7. *IF,DEF,IMS
  8. #
  9. ** NDLINIT - INITIALIZES NDLP.
  10. *
  11. * D.K. ENDO 81/10/09
  12. *
  13. * THIS PROGRAM CAUSES INITIALIZATION OF NDLP-S FLAGS, VALUES
  14. * AND TABLES.
  15. *
  16. * PROC NDLINIT
  17. *
  18. * ENTRY NONE.
  19. *
  20. * EXIT APPROPRIATE INITIALIZING OF FLAGS, VALUES,
  21. * AND ARRAYS.
  22. *
  23. * MESSAGES INVALID CONTROL CARD OPTION.
  24. *
  25. * METHOD
  26. *
  27. * INITIALIZE VARIOUS FLAGS.
  28. * CALL THE TABLE MANAGER TO INITIALIZE TABLE POINTERS.
  29. * CALL THE CONTROL CARD CRACKER.
  30. * INITIALIZE OUTPUT FET.
  31. * IF THIS IS A CREATION RUN.
  32. * INITIALIZE INPUT FET AND READ INTO CIO BUFFER.
  33. * INITIALIZE OTHER FETS.
  34. * ALLOCATE TABLE SPACE TO DEFINE AND LABEL TABLES.
  35. *
  36. #
  37. *ENDIF
  38. #
  39. **** PROC NDLINIT - XREF LIST BEGINS.
  40. #
  41. XREF
  42. BEGIN
  43. PROC ABORT;
  44. PROC SSTATS; # ALLOCATES SPACE TO A GIVEN TABLE #
  45. PROC SSTITM; # CALLS MANAGER TO DO ITS INITIALIZATION #
  46. PROC MEMORY; # UTILITY FOR REQUESTING MORE MEMORY #
  47. PROC MESSAGE; # SENDS MESSAGE TO DAYFILE #
  48. PROC READ; # READS INTO BUFFER FROM FILE #
  49. PROC RECALL;
  50. END
  51. #
  52. ****
  53. #
  54. ITEM
  55. CC$ERROR B, # CONTROL CARD ERROR STATUS #
  56. EXTRA U, # CONTAINS AMOUNT OF BUFFER SPACE FOR TBLS#
  57. INFILE C(10), # NAME OF INPUT FILE #
  58. MEMSTAT U, # CONTAINS AMOUNT OF MEMORY REQUESTED #
  59. OUTFILE C(10), # NAME OF OUTPUT FILE #
  60. RQTYPE C(10); # CONTAINS REQUEST TYPE FOR MEMORY #
  61. BASED ARRAY RA104[0:0] S(1);
  62. ITEM # POINTED TO RANDOM ADDRESS 104(OCTAL) #
  63. HHA U(0,42,18); # CONTAINS HIGHEST HIGH ADDRESS FOR NDLP #
  64. ARRAY INVCCRD[0:0] S(4);
  65. ITEM
  66. ICCMESS C(0,0,30) = [" INVALID CONTROL CARD OPTION. "],
  67. ICCZBYT U(3,0,60) = [0]; # ZERO FILL MESSAGE #
  68. DEF TFL #10000#; # MINIMUM BUFFER SPACE #
  69. CONTROL EJECT;
  70. PROC CRACKER(ERROR);
  71. BEGIN
  72. *IF,DEF,IMS
  73. #
  74. ** CRACKER - INTERPRETS CONTROL CARD OPTIONS
  75. *
  76. * D.K. ENDO 81/10/09
  77. *
  78. * THIS PROCEDURE VALIDATES THE NDLP CONTROL CARD PARAMETERS AND
  79. * SETS FLAG AND VALUES ACCORDINGLY.
  80. *
  81. * PROC CRACK(ERROR)
  82. *
  83. * ENTRY NONE.
  84. *
  85. * EXIT ERROR = FLAG SET IF ERROR DETECTED ON CONTROL CARD.
  86. *
  87. * MESSAGES NONE.
  88. *
  89. * METHOD
  90. *
  91. * IF THERE ARE PARAMETERS ON CONTROL CARD
  92. * FOR EACH PARAMETER WHILE NOT DONE,
  93. * SEARCH TABLE FOR PARAMETER.
  94. * IF NOT FOUND,
  95. * THEN,
  96. * FLAG ERROR.
  97. * OTHERWISE,
  98. * GOTO TO APPROPRIATE PARAGRAPH TO CHECK PARAMETER.
  99. * CHECK IF LEGAL COMBINATION OF PARAMETERS WAS SPECIFIED.
  100. * IF NOT SPECIFIED CORRECTLY,
  101. * FLAG ERROR.
  102. *
  103. #
  104. *ENDIF
  105. ITEM ERROR B; # ERROR STATUS RETURNED TO CALLER #
  106. #
  107. **** PROC CRACKER - XREF LIST BEGINS.
  108. #
  109. XREF
  110. BEGIN
  111. PROC NDLZFIL; # ZERO FILLS GIVEN NAME #
  112. END
  113. #
  114. ****
  115. #
  116. DEF COMMA # O"1" #; # NUMBER REPRESENTING COMMA FOR PARAM LIST#
  117. DEF EQUAL # O"2" #; # NUMBER REPRESENTING EQUAL #
  118. DEF TRMNAT # O"17" #; # NUMBER INDICATING TERMINATING OF LIST #
  119. DEF ZERO # O"33000000000000" #; # ZERO FILLED VALUE FOR ZERO #
  120. # #
  121. ITEM DONE B; # COMPLETION FLAG #
  122. ITEM FOUND B; # FOUND INDICATOR #
  123. ITEM I; # SCRATCH ITEM #
  124. ITEM J; # SCRATCH ITEM #
  125. ITEM SWTCHVCTR; # SWITCH VECTOR FOR PARAMETER CHECKING #
  126. # #
  127. BASED ARRAY PARAMS [0:0] S(1); # PARAMETER LIST #
  128. BEGIN
  129. ITEM PARAM U(00,00,42); # PARAMETER NAME #
  130. ITEM PVALUE C(00,00,07); # PARAMETER VALUE #
  131. ITEM PCODE U(00,54,06); # DELIMITER CODE #
  132. END
  133. BASED ARRAY NUM$PRM [0:0] S(1);
  134. BEGIN
  135. ITEM NUM$PARAM U(00,42,18);
  136. END
  137. DEF MXPRMS # 5 #;
  138. ARRAY PARAM$TABLE [1:MXPRMS] S(1);
  139. BEGIN
  140. ITEM PRMNAME U(00,00,42) = [O"11000000000000", # I -- NAME #
  141. O"14000000000000", # L #
  142. O"14060000000000", # LF #
  143. O"14170000000000", # LO #
  144. O"16060000000000", # NF #
  145. ];
  146. ITEM PRMSVCTR U(00,42,18) = [0, # I -- SWITCH VECTOR #
  147. 1, # L #
  148. 2, # LF #
  149. 3, # LO #
  150. 4 # NF #
  151. ];
  152. END
  153. SWITCH LO$JUMP NEXTVAL,# ZERO -- JUMP FOR LIST OPTIONS #
  154. ERR$VAL,# A #
  155. ERR$VAL,# B #
  156. ERR$VAL,# C #
  157. D$VAL, # D #
  158. ERR$VAL,# E #
  159. F$VAL, # F #
  160. ERR$VAL,# G #
  161. ERR$VAL,# H #
  162. ERR$VAL,# I #
  163. ERR$VAL,# J #
  164. ERR$VAL,# K #
  165. ERR$VAL,# L #
  166. ERR$VAL,# M #
  167. N$VAL, # N #
  168. ERR$VAL,# O #
  169. ERR$VAL,# P #
  170. ERR$VAL,# Q #
  171. ERR$VAL,# R #
  172. S$VAL, # S #
  173. ERR$VAL,# T #
  174. ERR$VAL,# U #
  175. ERR$VAL,# V #
  176. ERR$VAL,# W #
  177. ERR$VAL,# X #
  178. ERR$VAL,# Y #
  179. ERR$VAL,# Z #
  180. ERR$VAL,# 0 #
  181. ERR$VAL,# 1 #
  182. ERR$VAL,# 2 #
  183. ERR$VAL,# 3 #
  184. ERR$VAL,# 4 #
  185. ERR$VAL,# 5 #
  186. ERR$VAL,# 6 #
  187. ERR$VAL,# 7 #
  188. ERR$VAL,# 8 #
  189. ERR$VAL;# 9 #
  190. SWITCH PRMJUMP I$PARAM,# INPUT FILE NAME -- PARAMETER JUMP #
  191. L$PARAM,# OUTPUT FILE NAME #
  192. LF$PARM,# LCF FILE NAME #
  193. LO$PARM,# LIST OPTIONS #
  194. NF$PARM;# NCF FILE NAME #
  195. CONTROL EJECT;
  196. # #
  197. # CRACKER CODE BEGINS HERE #
  198. # #
  199. P<PARAMS> = O"2"; # POINT TO PARAMETER LIST #
  200. P<NUM$PRM> = O"64"; # POINT TO PARAMETER COUNT #
  201. ERROR = FALSE; # CLEAR ERROR FLAG #
  202. DONE = FALSE; # CLEAR TERMINATION FLAG #
  203. IF NUM$PARAM[0] NQ 0 # IF THERE WERE PARAMETERS SPECIFIED #
  204. THEN
  205. BEGIN
  206. FOR I=0 STEP 1 WHILE NOT DONE
  207. DO # FOR EACH PARAMETER SPECIFIED #
  208. BEGIN
  209. IF PCODE[I] EQ TRMNAT OR # IF CODE FOR TERMINATION #
  210. PCODE[I+1] EQ TRMNAT # DETECTED #
  211. THEN
  212. BEGIN
  213. DONE = TRUE; # SET DONE FLAG #
  214. END
  215. FOUND = FALSE; # CLEAR FOUND FLAG #
  216. FOR J=1 STEP 1 WHILE NOT FOUND AND
  217. J LQ MXPRMS
  218. DO # SEARCH TABLE FOR PARAMETER #
  219. BEGIN
  220. IF PARAM[I] EQ PRMNAME[J] # IF PARAMETER IS FOUND #
  221. THEN
  222. BEGIN
  223. FOUND = TRUE; # SET FOUND FLAG #
  224. SWTCHVCTR = PRMSVCTR[J]; # SAVE SWITCH VECTOR FOR PARAM #
  225. END
  226. END
  227. IF NOT FOUND # IF PARAM NOT FOUND IN TABLE #
  228. THEN
  229. BEGIN
  230. ERROR = TRUE; # SET ERROR FLAG #
  231. DONE = TRUE; # SET DONE FLAG #
  232. TEST I;
  233. END
  234. ELSE # PARAMETER IS LEGAL #
  235. BEGIN
  236. GOTO PRMJUMP[SWTCHVCTR]; # GOTO APPROPRIATE PARAGRAPH #
  237. I$PARAM:
  238. CRERUN = TRUE; # SET CREATION RUN FLAG #
  239. IF PCODE[I] EQ EQUAL # IF DELIMITER IS EQUAL #
  240. THEN
  241. BEGIN
  242. I = I + 1; # POINT TO VALUE #
  243. INFILE = PVALUE[I]; # SAVE INPUT FILE NAME #
  244. END
  245. ELSE # DELIMITER NOT EQUAL #
  246. BEGIN
  247. IF PCODE[I] EQ COMMA OR # IF DELIMITER IS COMMA OR #
  248. PCODE[I] EQ TRMNAT # TERMINATOR #
  249. THEN
  250. BEGIN
  251. INFILE = "COMPILE"; # DEFAULT INPUT FILE NAME #
  252. END
  253. ELSE # ILLEGAL DELIMITER #
  254. BEGIN
  255. ERROR = TRUE; # SET ERROR FLAG #
  256. DONE = TRUE; # SET DONE FLAG #
  257. END
  258. END
  259. TEST I;
  260. L$PARAM:
  261. IF PCODE[I] EQ EQUAL # IF DELIMITER IS EQUAL #
  262. THEN
  263. BEGIN
  264. I = I + 1; # POINT TO VALUE #
  265. IF PVALUE[I] EQ ZERO # IF VALUE IS ZERO, NO OUTPUT #
  266. THEN # LISTING DESIRED #
  267. BEGIN
  268. LISTFLG = FALSE; # CLEAR LISTING FLAG #
  269. END
  270. ELSE # VALUE IS NOT ZERO #
  271. BEGIN
  272. OUTFILE = PVALUE[I]; # SAVE OUTPUT FILE NAME #
  273. END
  274. END
  275. ELSE # DELIMITER IS NOT EQUAL #
  276. BEGIN
  277. ERROR = TRUE; # SET ERROR FLAG #
  278. DONE = TRUE; # SET DONE FLAG #
  279. END
  280. TEST I;
  281. LF$PARM:
  282. IF PCODE[I] EQ EQUAL # IF DELIMITER IS EQUAL #
  283. THEN
  284. BEGIN
  285. SUMRUN = TRUE; # SET SUMMARY RUN FLAG #
  286. LISTLF = TRUE; # SET LCF SUMMARY FLAG #
  287. I = I + 1; # POINT TO VALUE #
  288. LFFILE = PVALUE[I]; # SAVE LCF FILE NAME #
  289. NDLZFIL(LFFILE); # ZERO FILL NAME #
  290. END
  291. ELSE # DELIMITER IS NOT ZERO #
  292. BEGIN
  293. ERROR = TRUE; # SET ERROR FLAG #
  294. DONE = TRUE; # SET DONE FLAG #
  295. END
  296. TEST I;
  297. LO$PARM:
  298. IF PCODE[I] EQ EQUAL # IF DELIMITER IS EQUAL #
  299. THEN
  300. BEGIN
  301. I = I + 1; # POINT TO VALUE #
  302. CRERUN = TRUE; # SET CREATION RUN FLAG #
  303. LISTN = FALSE; # CLEAR NORMAL SOURCE LIST FLAG #
  304. LISTD = FALSE; # CLEAR DEFINE LISTING FLAG #
  305. FOR J=0 STEP 1 UNTIL 7
  306. DO # FOR EACH CHARACTER IN VALUE #
  307. BEGIN # GOTO APPROPRIATE PARAGRAPH #
  308. GOTO LO$JUMP[C<J,1>PVALUE[I]];
  309. N$VAL:
  310. LISTN = TRUE; # SET NORMAL SOURCE LISTING FLAG#
  311. TEST J;
  312. D$VAL:
  313. LISTD = TRUE; # SET DEFINE LISTING FLAG #
  314. TEST J;
  315. S$VAL:
  316. LISTS = TRUE; # SET EXPANDED SOURCE LIST FLAG #
  317. TEST J;
  318. F$VAL:
  319. LISTF = TRUE; # SET FILE SUMMARY FLAG #
  320. TEST J;
  321. ERR$VAL:
  322. ERROR = TRUE; # SET ERROR FLAG #
  323. DONE = TRUE; # SET DONE FLAG #
  324. NEXTVAL:
  325. TEST J;
  326. END
  327. END
  328. ELSE # DELIMITER IS NOT EQUAL #
  329. BEGIN
  330. ERROR = TRUE; # SET ERROR FLAG #
  331. DONE = TRUE; # SET DONE FLAG #
  332. END
  333. TEST I;
  334. NF$PARM:
  335. IF PCODE[I] EQ EQUAL # IF DELIMITER IS EQUAL #
  336. THEN
  337. BEGIN
  338. SUMRUN = TRUE; # SET SUMMARY RUN FLAG #
  339. LISTNF = TRUE; # SET NCF SUMMARY LIST FLAG #
  340. I = I + 1; # POINT TO VALUE #
  341. NFFILE = PVALUE[I]; # SAVE NCF FILE NAME #
  342. NDLZFIL(NFFILE); # ZERO FILL NAME #
  343. END
  344. ELSE # DELIMITER IS NOT EQUAL #
  345. BEGIN
  346. ERROR = TRUE; # SET ERROR FLAG #
  347. DONE = TRUE; # SET DONE FLAG #
  348. END
  349. TEST I;
  350. END
  351. END
  352. END
  353. ELSE # NO PARAMETER SPECIFIED #
  354. BEGIN
  355. CRERUN = TRUE; # SET CREATION RUN FLAG #
  356. SUMRUN = FALSE; # CLEAR SUMMARY RUN FLAG #
  357. END
  358. NDLZFIL(OUTFILE); # ZERO FILL OUTPUT FILE NAME #
  359. NDLZFIL(INFILE); # ZERO FILL INPUT FILE NAME #
  360. IF CRERUN AND # IF BOTH CREATION RUN AND SUMMARY RUN #
  361. SUMRUN # PARAMETERS SPECIFIED #
  362. THEN
  363. BEGIN
  364. ERROR = TRUE; # SET ERROR FLAG #
  365. END
  366. IF NOT CRERUN AND # IF BOTH FLAG ARE NOT SET, THEN ONLY THE #
  367. NOT SUMRUN # -L- PARAMETER WAS SPECIFIED #
  368. THEN
  369. BEGIN
  370. CRERUN = TRUE; # SET CREATION RUN FLAG #
  371. SUMRUN = FALSE; # CLEAR SUMMARY RUN FLAG #
  372. END
  373. RETURN; # **** RETURN **** #
  374. END # CRACKER #
  375. CONTROL EJECT;
  376. # #
  377. # NDLINIT CODE BEGINS HERE #
  378. # #
  379. # INITIALIZE FLAGS AND FILE NAMES #
  380. LISTLF = FALSE;
  381. LISTNF = FALSE;
  382. LISTN = TRUE;
  383. LISTD = TRUE;
  384. LISTS = FALSE;
  385. LISTF = FALSE;
  386. INFILE = "INPUT";
  387. OUTFILE = "OUTPUT";
  388. LISTFLG = TRUE;
  389. CRERUN = FALSE;
  390. SUMRUN = FALSE;
  391. EOINP = FALSE;
  392. # INITIALIZE TABLE MANAGER #
  393. RQTYPE = "CM"; # SET REQUEST TYPE #
  394. MEMSTAT = 0;
  395. P<RA104> = O"104"; # POINT BASED ARRAY TO REL ADDR 104 #
  396. MEMORY(RQTYPE,MEMSTAT);# FIND SIZE OF FIELD LENGTH #
  397. MEML = HHA[0]; #SAVE POINTER TO BEGINNING OF MANAGED AREA#
  398. SSTITM(MEML,P<TEND>,LOC(MEML)); # INITIALIZE MANAGER #
  399. # CRACK CONTROL CARD #
  400. CRACKER(CC$ERROR);
  401. IF CC$ERROR # IF CONTROL CARD ERROR DETECTED #
  402. THEN
  403. BEGIN
  404. MESSAGE(INVCCRD,0); # SEND DAYFILE MESSAGE #
  405. ABORT; # **** ABORT RUN **** #
  406. END
  407. # OPEN FILES #
  408. OUTLFN[0] = OUTFILE;
  409. OUTFIRST[0] = LOC(OUTWB);
  410. OUTIN[0] = LOC(OUTWB);
  411. OUTOUT[0] = LOC(OUTWB);
  412. OUTLIMIT[0] = LOC(OUTWB) + PRULNGTH + 1;
  413.  
  414. IF CRERUN
  415. THEN
  416. BEGIN
  417. INLFN[0] = INFILE;
  418. INFIRST[0] = LOC(INWB);
  419. ININ[0] = LOC(INWB);
  420. INOUT[0] = LOC(INWB);
  421. INLIMIT[0] = LOC(INWB) + PRULNGTH + 1;
  422. READ(INFET);
  423. RECALL(INFET);
  424. SECFIRST[0] = LOC(SECWB);
  425. SECIN[0] = LOC(SECWB);
  426. SECOUT[0] = LOC(SECWB);
  427. SECLIMIT[0] = LOC(SECWB) + PRULNGTH + 1;
  428. ESIFIRST[0] = LOC(ESIWB);
  429. ESIIN[0] = LOC(ESIWB);
  430. ESIOUT[0] = LOC(ESIWB);
  431. ESILIMIT[0] = LOC(ESIWB) + PRULNGTH + 1;
  432. STFIRST[0] = LOC(STWB);
  433. STIN[0] = LOC(STWB);
  434. STOUT[0] = LOC(STWB);
  435. STLIMIT[0] = LOC(STWB) + PRULNGTH + 1;
  436. E1FIRST[0] = LOC(E1WB);
  437. E1IN[0] = LOC(E1WB);
  438. E1OUT[0] = LOC(E1WB);
  439. E1LIMIT[0] = LOC(E1WB) + PRULNGTH + 1;
  440. E2FIRST[0] = LOC(E2WB);
  441. E2IN[0] = LOC(E2WB);
  442. E2OUT[0] = LOC(E2WB);
  443. E2LIMIT[0] = LOC(E2WB) + PRULNGTH + 1;
  444. # ALLOCATE TABLE SPACE FOR LABELS AND DEFINES #
  445. SSTATS(P<DEFINE$TABLE>,MAXDT); # GET SPACE FOR DEFINE TABLE #
  446. SSTATS(P<LABEL$TABLE>,MAXLT); # GET SPACE FOR LABEL TABLE #
  447. SSTATS(P<STMT$TABLE>,MXSTBL); # GET SPACE FOR STMT TABLE #
  448. SSTATS(P<TERM$BUFFER>,MXTBUFF);# GET SPACE FOR TERM STMT BUFFER#
  449. END
  450. RETURN;
  451. END # NDLINIT #
  452. TERM
cdc/nos2.source/nam5871/ndlinit.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator