User Tools

Site Tools


cdc:nos2.source:nam5871:np_dbg

NP$DBG

Table Of Contents

  • [00011] PROC NP$DBG
  • [00166] PROC NP$CLK
  • [00167] PROC NP$PIOE
  • [00168] PROC NP$RTIM
  • [00169] PROC NP$WRTO
  • [00170] PROC NP$WRTR
  • [00171] PROC NP$WRTW

Source Code

NP$DBG.txt
  1. *DECK NP$DBG
  2. *IF,DEF,DEBUG
  3. USETEXT AIPDEF
  4. USETEXT NP$DB
  5. USETEXT NP$GETS
  6. USETEXT NP$NWL
  7. USETEXT NP$TAA
  8. USETEXT NP$NWNC
  9. USETEXT HEADER
  10. *ENDIF
  11. PROC NP$DBG;
  12.  
  13.  
  14. *IF,DEF,IMS
  15. #
  16. *1DC NP$DBG
  17. *
  18. * 1. PROC NAME AUTHOR DATE
  19. * NP$DBG S. KRULEVITCH 78/11/15
  20. *
  21. * 2. FUNCTIONAL DESCRIPTION
  22. * CONVERTS SUPERVISORY OR DATA MESSAGES INTO DEBUG LOG FORMAT
  23. * AND WRITES IT TO FILE ZZZZZDN IF THE PROPER DEBUG SWITCH IS
  24. * TURNED ON.
  25. *
  26. * 3. METHOD USED
  27. * WHEN ENTERED THE ABT FIELD IN THE MESSAGE HEADER AND THE DEBUG
  28. * SWITCHES, DB$SM AND DB$DM ARE TESTED TO DETERMINE IF THE
  29. * MESSAGE WILL BE LOGGED. IF NOT, CONTROL IS RETURNED TO THE
  30. * CALLING ROUTINE.
  31. * EACH ENTRY OF THE DEBUG LOG FILE GENERATED BY
  32. * NP$DB HAS A THREE WORD HEADER.
  33. * WORD 0
  34. * 2
  35. * 0 4
  36. * I-------------------------I----------------I
  37. * I I I
  38. * I SECONDS SINCE DEADSTART I MILLISECONDS I
  39. * I I I
  40. * I-------------------------I----------------I
  41. *
  42. * WORD 1
  43. * 2 4 5 5
  44. * 0 6 4 2 3 9
  45. * I-----I-----------I------------I--------I--------I
  46. * I I I I I I
  47. * I I DL$BS I DL$CALL I DL$ADR I DL$OPC I
  48. * I I I I I I
  49. * I-----I-----------I------------I--------I--------I
  50. *
  51. * DL$BS - SIZE OF MESSAGE BLOCK (INCLUDES WORD 1)
  52. * DL$CALL - CALLING ADDRESS
  53. * DL$ADR - THIS FIELD IS DEPENDENT ON DL$OPC[0].
  54. * = APPLICATION CONNECTION NUMBER FOR NETGET (=ACLN)
  55. * = APPLICATION CONNECTION NUMBER FOR NETGETF (=ACLN)
  56. * = APPLICATION LIST NUMBER FOR NETGETL (=ACLN)
  57. * = APPLICATION LIST NUMBER FOR NETGTFL (=ACLN)
  58. * = 0 FOR NETPUT OR NETPUTF
  59. * DL$OPC - OP$CODE OF CALLING ROUTINE
  60. *1
  61. *
  62. * WORD 2
  63. * 2 4 5
  64. * 0 6 4 2 9
  65. * I-----I-----------I------------I----------------I
  66. * I I I I I
  67. * I I DL$TL I DL$HA I DL$TA I
  68. * I I I I I
  69. * I-----I-----------I------------I----------------I
  70. *
  71. * DL$TL - THIS FIELD IS DEPENDENT ON DL$OPC[0].
  72. * = MAXIMUM ALLOWABLE TEXT LENGTH FOR NETGET (=TLMX)
  73. * = MAXIMUM ALLOWABLE TEXT LENGTH FOR NETGETL (=TLMX)
  74. * = NUMBER OF FRAGMENTED BUFFERS FOR NETGETF (=LTAA)
  75. * = NUMBER OF FRAGMENTED BUFFERS FOR NETGTFL (=LTAA)
  76. * = NUMBER OF FRAGMENTED BUFFERS FOR NETPUTF (=LTAA)
  77. * = 0 FOR NETPUT
  78. * DL$HA - HEADER ADDRESS (=LOC$HA)
  79. * DL$TA - THIS FIELD IS DEPENDENT ON DB$OPC[0]
  80. * = TEXT AREA FOR NETGET,NETGETL, AND NETPUT (=LOC$TA)
  81. * = TEXT AREA ARRAY ADDRESS FOR NETGETF, NETGTFL, AND
  82. * NETPUTF (=LOC$TA)
  83. *
  84. * WORD 3 (NORMAL FORMAT)
  85. * 5
  86. * 0 9
  87. * I----------------------------------------------I
  88. * I I
  89. * I DL$ABH I
  90. * I I
  91. * I----------------------------------------------I
  92. *
  93. * DL$ABH - APPLICATION BLOCK HEADER FOR NETGET,M
  94. * NETGETL, NETGETFL, NETGETF, NETPUT, AND
  95. * NETPUTF.
  96. *
  97. * WORD 3 (NETLOG ENTRY)
  98. * 2 4 5
  99. * 0 4 2 9
  100. * I--------------------I-------------I-------------I
  101. * I I I I
  102. * I I DL$SIZE I DL$FORMAT I
  103. * I I I I
  104. * I--------------------I-------------I-------------I
  105. *
  106. * DL$SIZE - SIZE OF THE TEXT
  107. * DL$FORMAT - FORMAT FLAG FOR NETLOG ENTRIES
  108. * 0 FOR UNFORMATTED DATA
  109. * 1 FOR FORMATTED DATA
  110. *
  111. * FOR NON-SUPERVISORY MESSAGES DB$TRUNC WILL GIVE THE NUMBER OF
  112. * MESSAGE TEXT TO BE PRINTED OUT. DEFAULT IS THE COMPLETE MESSAGE
  113. * UP TO 410 WORDS.
  114. *
  115. * EVERY 500 MESSAGES,AN END-OF-RECORD IS WRITTEN TO ZZZZZDN.
  116. * THIS ALLOWS THE USER TO PRINT A PORTION OF THE FILE. DOING A
  117. * CATALOG ON A SAVED ZZZZZDN FILE WILL SHOW THE TIME OF DAY
  118. * AT THE START OF EACH 500 LINE RECORD. THUS THE USER MAY COPYBR
  119. * TO OUTPUT THE SPECIFIC TIME PERIOD THAT WARRANTS EXAMINATION.
  120. *
  121. * 4. ENTRY CONDITIONS
  122. * ALL ENTRY CONDITIONS ARE ESTABLISHED IN COMMON BLOCK NETDB.
  123. *
  124. * DB$SM - LOG SUPERVISORY MESSAGES, EXCEPT FC/ACK, IF TRUE
  125. * DB$DM - LOG DATA MESSAGES, PLUS FC/ACK SUPERVISORY MESSAGES,
  126. * IF TRUE
  127. * DB$ERCT - UP TO 500 BEFORE EOR WRITTEN TO ZZZZZDN
  128. * DB$FET - FET FOR FILE ZZZZZDN
  129. * DB$OP - OPERATION CODE OF NAM PROCEDURE CALL
  130. * DB$PAR - PARAMETERS FROM NAM PROCEDURE CALL
  131. *
  132. * 5. EXIT CONDITIONS
  133. * NONE
  134. *
  135. * 6. COMDECKS CALLED AND SYMPLTEXTS USED.
  136. * AIPDEF HEADER
  137. * NP$CRT NP$DB NP$DLA NP$GETS
  138. * NP$NWNC NP$NWL NP$TAA
  139. *
  140. * 7. PROCEDURES/FUNCTIONS CALLED
  141. * NP$CLK - CLOCK TIME IN DISPLAY CODE. USES MACREL INTERFACE
  142. * NP$PIOE - PROCESS I/O ERROR AFTER WRITE OPERATION ON FILE
  143. * NP$RTIM - REAL TIME SINCE DEADSTART IN SECONDS AND
  144. * MILLISECONDS
  145. * NP$WRTR - NOS MACRO TO WRITE EOR TO FILE. CALLED WITH MACREL
  146. * INTERFACE.
  147. * NP$WRTO - WRITES ONE WORD TO CIO BUFFER
  148. * NP$WRTW - NOS DATA TRANSFER MACRO TO TRANSFER DATA FROM A
  149. * WORKING BUFFER TO THE INPUT/OUTPUT BUFFER. CALLED
  150. * WITH MACREL INTERFACE
  151. *
  152. * 8. DAYFILE/DIAGNOSTIC MESSAGES
  153. * NONE
  154. *
  155.  #
  156. *ENDIF
  157. BEGIN
  158.  
  159. *CALL NP$CRT
  160. *IF DEF,DEBUG
  161.  
  162. # EXTERNAL PROCEDURES/FUNCTIONS #
  163.  
  164. XREF
  165. BEGIN
  166. PROC NP$CLK; # CLOCK TIME IN DISPLAY CODE #
  167. PROC NP$PIOE; # PROCESS I/O ERROR ON FILE #
  168. PROC NP$RTIM; # REAL TIME #
  169. PROC NP$WRTO; # WRITES ONE WORD #
  170. PROC NP$WRTR; # WRITES EOR #
  171. PROC NP$WRTW; # WRITES WORDS #
  172. END
  173.  
  174. # ITEM DEFINITIONS #
  175.  
  176. ITEM CHARWD C(10); # WORD TO STORE CLOCK TIME #
  177. ITEM K; # TEMPORARY INDEX VARIABLE #
  178. ITEM L; # TEMPORARY INDEX VARIABLE #
  179. ITEM NA; # NUMBER OF TEXT ARRAY FRAGMENTS #
  180. ITEM NUMF; # NUMBER OF FRAGMENTS USED BY TEXT #
  181. ITEM TAALEN; # LENGTH OF FRAGMENTED MESSAGE VECTOR #
  182. ITEM TIMEWD U; # TEMPORARY STORE FOR TIME #
  183. ITEM TRUNC; # NUMBER OF WORDS OF MESSAGE TEXT (MAX) #
  184. ITEM WR; # WORDS REMAINING IN TEXT #
  185.  
  186. # ARRAY DEFINITIONS #
  187.  
  188.  
  189. ARRAY DATLINE P(4);
  190. *CALL NP$DLA
  191. #**********************************************************************#
  192. # #
  193. # NP$DBG EXECUTION BEGINS HERE #
  194. # #
  195. # DETERMINE IF MESSAGE WILL BE LOGGED #
  196.  
  197. P<HEADER> = LOC$HA; # HEADER ADDRESS #
  198. P<SUPMSG> = LOC$TA ;
  199. P<TAA> = LOC$TA;
  200. IF DB$OP EQ OP$LOG
  201. THEN
  202. BEGIN
  203. TRUNC = DB$SIZE; # TEXT LENGTH IN CM WORDS #
  204. IF TRUNC GR DB$TRUNC
  205. THEN
  206. TRUNC = DB$TRUNC;# TRUNCATE LENGTH OF TEXT #
  207. END
  208. ELSE
  209. BEGIN # NOT NETLOG ENTRIES #
  210. IF DB$OP NQ OP$PUT AND# INPUT NULL BLOCK #
  211. DB$OP NQ OP$PUTF AND# BREAK FLAG NOT SET #
  212. ABHABT[0] EQ 0 AND
  213. ABHBRK[0] EQ 0
  214. THEN
  215. IF ABHDBC[0] EQ 0
  216. THEN
  217. RETURN ; # ********************** #
  218.  
  219. IF DB$OP EQ OP$PUTF
  220. THEN
  221. NP$NA = ACLN; # NUMBERS OF FRAGMENTS FROM ACLN #
  222. IF DB$OP GQ OP$GETF
  223. THEN
  224. P<SUPMSG> = TAADDR[1]; # FRAGMENT CALL AND TA FROM TAA #
  225. IF ABHABT[0] EQ 3 OR
  226. ABHABT[0] EQ 4
  227. THEN
  228. BEGIN # SUPERVISORY MESSAGES #
  229. IF PFCSFC[0] EQ FCACK
  230. THEN
  231. BEGIN # FC/ACK SUPERVISORY MESSAGE #
  232. IF NOT DB$DM
  233. THEN # DATA MESSAGE LOGGING NOT ON #
  234. RETURN; # ***** RETURN ***** #
  235. END
  236. ELSE
  237. IF NOT DB$SM
  238. THEN # SUPERVISORY MESSAGE LOGGING NOT ON #
  239. RETURN; # ***** RETURN ***** #
  240. END
  241. ELSE
  242. IF NOT DB$DM
  243. THEN # DATA MESSAGE LOGGING NOT ON #
  244. RETURN; # ***** RETURN ***** #
  245.  
  246. # DETERMINE NUMBER OF TEXT WORDS TO OUTPUT #
  247. IF ABHACT[0] EQ 0
  248. THEN
  249. K = 1 ; # PRETEND TO HAVE ACT = 1 #
  250. ELSE
  251. K = ABHACT[0] ;
  252. IF ABHABT[0] EQ 0
  253. THEN
  254. TRUNC = 0 ;
  255. ELSE
  256. TRUNC = ( ABHTLC[0] * 2 + NW$ROUND[K] ) / NW$FACT[K] ;
  257. IF TRUNC GR DB$TRUNC
  258. THEN
  259. TRUNC = DB$TRUNC;# MAXIMUM WORDS OF DATA TEXT OUTPUT #
  260. END
  261.  
  262.  
  263. # FORMAT MESSAGE AND OUTPUT TO FILE #
  264.  
  265. NP$RTIM(TIMEWD); # CURRENT TIME #
  266. DL$TIME[0] = TIMEWD;
  267. DL$CALL[0] = DB$CALL;
  268. WR = TRUNC; # CALCULATE THE NUMBER OF FRAGMENTS USED #
  269. NUMF = 0;
  270. IF DB$OP GQ OP$GETF AND DB$OP LQ OP$GTFL
  271. THEN # FRAGMENTED MESSAGE BLOCK #
  272. BEGIN
  273. FOR K = 1 STEP 1 WHILE K LQ NP$NA AND WR GR 0
  274. DO
  275. BEGIN
  276. L = TAASIZE[K]; # ADDRESS OF KTH FRAGMENT #
  277. WR = WR - L;
  278. NUMF = K; # NUMBER OF FRAGMENTS USED BY TEXT #
  279. END # FRAGMENTED CASE #
  280. IF WR GR 0
  281. THEN # WR WAS LARGER THAN TOTAL FRAG BUF SIZE #
  282. TRUNC = TRUNC-WR; # TOTAL FRAGMENTED BUFFER SIZE #
  283.  
  284. END
  285.  
  286. IF DB$OP NQ OP$LOG
  287. THEN
  288. BEGIN # NOT NETLOG ENTRIES #
  289. IF ABHABT[0] EQ 0 # NULL BLOCK #
  290. OR ( ABHIBU[0] EQ 1 # INPUT UNDELIVERABLE #
  291. AND NOT( DB$OP EQ OP$PUT # NET PUT #
  292. OR DB$OP EQ OP$PUTF ) ) # NET PUT F #
  293. THEN # SET BS TO 3, ONLY THE HEADER #
  294. DL$BS[0] = 3;
  295. ELSE
  296. DL$BS[0] = TRUNC + NUMF + 3;# NORMAL BLOCK SIZE #
  297. END
  298. ELSE
  299. BEGIN # NETLOG ENTRY #
  300. DL$BS[0] = TRUNC + NUMF + 3;# NORMAL BLOCK SIZE #
  301. DL$SIZE[0] = DB$SIZE;
  302. DL$FORMAT[0] = DB$FORMAT;
  303. END
  304.  
  305. DL$OPC[0] = DB$OP;
  306. DL$HA[0] = LOC$HA;
  307. DL$TA[0] = LOC$TA;
  308. DL$ADR[0] = ACLN;
  309. IF DB$OP EQ OP$PUTF
  310. THEN
  311. DL$ADR[0] = 0;
  312. IF DB$OP EQ OP$GET OR DB$OP EQ OP$GETL
  313. THEN
  314. DL$TL[0] = TLMX; # BLOCK SIZE TO RECEIVE DATA #
  315. ELSE
  316. BEGIN
  317. DL$TL[0] = NP$NA; # NUMBER OF FRAGMENTED BUFFERS #
  318. IF DB$OP EQ OP$PUT
  319. THEN
  320. BEGIN
  321. DL$TL[0] = 0;
  322. DL$ADR[0] = 0;
  323. END
  324.  
  325. END # FRAGMENTS AND OP$PUT #
  326.  
  327. IF DB$OP NQ OP$LOG
  328. THEN # SET HEADER WORD IN DEBUG LOG FILE #
  329. DL$ABH[0] = ABHWORD[0];
  330.  
  331. NP$WRTW(DB$FET,DATLINE,4); # WRITE HEADER TO ZZZZZDN #
  332. #
  333.   NSUPWRD BASED ARRAY POINTER TO THE USER COMMUNICATION WORD
  334.   WAS SET BY NETON. THE ARRAY IS LOCATED IN NP$NWL COMDECK.
  335.  
  336.   UPDATE MSGCNT IN THE COMMUNICATION WORD.
  337. #
  338. MSGCNT[0] = MSGCNT[0] + 1;
  339. # #
  340. IF DB$OP GQ OP$GETF AND
  341. DB$OP LQ OP$GTFL
  342. THEN
  343. BEGIN # FRAGMENTED GETS AND GETLS #
  344. IF ABHIBU[0] NQ 1
  345. THEN # INPUT UNDELIVERABLE #
  346. BEGIN
  347. WR = TRUNC; # WORDS TO BE TRANSFERRED TO ZZZZZDN #
  348. FOR K = 1 STEP 1 WHILE K LQ NUMF AND
  349. WR GR 0
  350. DO
  351. BEGIN
  352. NP$WRTW(DB$FET,TAAWORD[K],1); # COPY TAA WORD TO ZZZZZDN #
  353. P<SUPMSG> = TAADDR[K] ; # KTH FRAGMENT 'S ADDRESS #
  354. L = TAASIZE[K]; # KTH FRAGMENT SIZE,DB$OP=TEMP #
  355. IF L GR WR
  356. THEN
  357. L = WR;
  358. NP$WRTW(DB$FET,SUPMSG,L); # COPY TEXT TO ZZZZZDN #
  359. WR = WR - L; # WORDS REMAINING IN TEXT #
  360. END # FRAGMENTED MESSAGE + TAA #
  361. # COPIED TO ZZZZZDN #
  362. END
  363. END
  364. ELSE
  365. BEGIN
  366. IF DB$OP EQ OP$LOG OR
  367. NOT ( ABHIBU[0] EQ 1 AND ( DB$OP EQ OP$GET
  368. OR DB$OP EQ OP$GETL
  369. OR DB$OP EQ OP$GSM ) )
  370. THEN
  371. NP$WRTW(DB$FET,SUPMSG,TRUNC);# COPY TO ZZZZZDN #
  372. END
  373.  
  374. IF MSGCNT[0] GQ DB$ERCT
  375. THEN # END OF RECORD TO BE WRITTEN #
  376. BEGIN
  377. NP$WRTR (DB$FET,1); # WRITE END OF RECORD TO ZZZZZDN #
  378. NP$CLK(CHARWD); # GET CLOCK TIME IN DISPLAY CODE #
  379. NP$WRTO(DB$FET,CHARWD);
  380. DB$ERCT = DB$ERCT + 500;
  381. END
  382. #
  383.   CHECK FOR I/O ERROR IN DEBUG LOG FILE
  384. #
  385. IF FET$AT[0] NQ 0
  386. THEN # I/O ERROR HAS OCCURRED ON FILE#
  387. BEGIN
  388. NP$PIOE(DB$FET); # PROCESS I/O ERROR #
  389. END
  390. *ENDIF
  391. RETURN;
  392.  
  393. END # NP$DBG #
  394.  
  395. TERM # NP$DBG #
cdc/nos2.source/nam5871/np_dbg.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator