User Tools

Site Tools


cdc:nos2.source:nam5871:ns_mkd

NS$MKD

Table Of Contents

  • [00009] PROC NS$MKD
  • [00011] NS$MKD - MANAGE K DISPLAY OUTPUT DATA.
  • [00015] MANAGE K-DISPLAY OUTPUT DATA.
  • [00046] PROC NS$DBG
  • [00052] PROC EXINCSZ
  • [00053] PROC EXREDUC
  • [00054] PROC MOVEI
  • [00055] PROC MOVEOK
  • [00056] PROC NETPUT
  • [00057] PROC NS$TKD
  • [00058] PROC TSBINFO

Source Code

NS$MKD.txt
  1. *DECK NS$MKD
  2. USETEXT COM$NS
  3. USETEXT DEF$NS
  4. USETEXT KDS$NS
  5. USETEXT LIN$NS
  6. USETEXT PFC$NS
  7. USETEXT SMB$NS
  8.  
  9. PROC NS$MKD; # MANAGE K DISPLAY OUTPUT DATA #
  10.  
  11. # TITLE NS$MKD - MANAGE K DISPLAY OUTPUT DATA. #
  12.  
  13. BEGIN # NS$MKD #
  14. #
  15. ** NS$MKD - MANAGE K-DISPLAY OUTPUT DATA.
  16. *
  17. * J.C. LEE 1981
  18. *
  19. * THIS ROUTINE MANAGES K-DISPLAY OUTPUT DATA.
  20. *
  21. * PROC NS$MKD
  22. *
  23. * ENTRY:
  24. * - FWA OF FIRST K-DISPLAY LINE WHICH MAY BE FIRST OF
  25. * MANY CONSECUTIVELY ADDRESSED LINES FROM ONE OF THE
  26. * FOLLOWING BUFFERS: HISTORY BUFFER, PAGE-WAIT BUFFER,
  27. * STATUS BUFFER, OR DISPLAY CONTROL BLOCK.
  28. * - K-DISPLAY OUTPUT LINE COUNT.
  29. * - K-DISPLAY OUTPUT WORD COUNT.
  30. *
  31. * EXIT:
  32. * NONE.
  33. *
  34. * METHOD:
  35. * CALL SEND-K-DISPLAY-OUTPUT TO SEND K-DISPLAY OUTPUT LINES
  36. * UNTIL K-DISPLAY OUTPUT LINE COUNT IS EXHAUSTED OR
  37. * K-DISPLAY IS FULL, WHICHEVER HAPPEN FIRST.
  38. * IF REMAINING K-DISPLAY OUTPUT LINES NOT ZERO, ADD THE
  39. * REMAINING LINES TO PAGE-WAIT BUFFER.
  40. *
  41. #
  42.  
  43. $BEGIN
  44. XREF
  45. BEGIN
  46. PROC NS$DBG; # TRACE PROC CALL #
  47. END
  48. $END
  49.  
  50. XREF
  51. BEGIN
  52. PROC EXINCSZ; # INCREASE SIZE #
  53. PROC EXREDUC; # REDUCE SIZE #
  54. PROC MOVEI; # MOVE LINE TO SM BUFFER #
  55. PROC MOVEOK; # ALLOW MOVES #
  56. PROC NETPUT; # SEND HOP MSG #
  57. PROC NS$TKD; # TRANSFER LINES TO K DISPLAY BUFFER #
  58. PROC TSBINFO; # LOCATE K-DISPLAY BUFFER #
  59. END
  60.  
  61. DEF L$HOPDIS # 58 #; # LENGTH OF HOP-DIS-SM #
  62. DEF MDLC # 4 #; # ENTRY SIZE FOR MORE DATA .. ARRAY #
  63.  
  64. ITEM ADDR U; # FWA OF 1ST LINE TO SEND #
  65. ITEM BLKLC U; # KDB CURRENT LINE COUNT #
  66. ITEM BLKWC U; # KDB CURRENT WORD COUNT #
  67. ITEM I I; # LOOP VARIABLE #
  68. ITEM KDBTSBN U; # TSB NUMBER OF K DISPLAY BUFFER #
  69. ITEM KDLC U; # LINES THAT CAN BE SENT OUT #
  70. ITEM LC U; # LINE COUNT #
  71. ITEM LNSIZE U; # CURRENT LINE SIZE #
  72. ITEM TEMP U; # TEMP STORAGE FOR PWB SIZE #
  73. ITEM TLW U; # TEXT LENGTH OF HOP/DIS #
  74. ITEM TSBFWA U; # FIRST WORD ADDRESS OF TSB #
  75. ITEM TSBSIZE U; # SIZE OF TSB #
  76.  
  77. ARRAY MORDATA [0:0] S(MDLC);
  78. BEGIN # MORE DATA .. K DISPLAY LINE #
  79. ITEM MDWD1 U(00,00,60); # PFC/SFC WORD #
  80. ITEM MD$PFCSFC U(00,00,16) = [HOPDIS]; # PFC/SFC CODE #
  81. ITEM MD$F1 U(00,16,44) = [0];
  82. ITEM MDWD2 U(01,00,60);
  83. ITEM MORDAT C(01,00,11) = ["MORE DATA.."];
  84. ITEM MDZERO U(02,06,54) = [0];
  85. ITEM MD$RES U(03,00,60) = [0]; # LAST RESERVED WORD FOR NIP#
  86. END
  87.  
  88. ARRAY ABH [0:0] S(1);
  89. BEGIN # APPLICATION BLOCK HEADER WORD FOR HOP/DIS/SM #
  90. ITEM ABH$ABT U(00,00,06) = [APPCMD];
  91. ITEM ABH$ADR U(00,06,12) = [0];
  92. ITEM ABH$ABN U(00,18,18) = [0];
  93. ITEM ABH$ACT U(00,36,04) = [CT60TRANS];
  94. ITEM ABH$DBC U(00,40,08) = [0];
  95. ITEM ABH$TLC U(00,48,12);
  96. END
  97.  
  98. ARRAY SM$HOPDIS [0:0] S(64);
  99. BEGIN # HOP/DIS/SM BUFFER #
  100. ITEM SM$PFCSFC U(00,00,16) = [HOPDIS];
  101. ITEM SM$HOPI B(00,59,01); # INPUT ALLOWED FLAG #
  102. ITEM SM$F1 U(00,16,44) = [0];
  103. END
  104.  
  105. CONTROL EJECT;
  106.  
  107. $BEGIN
  108. NS$DBG("MKD"); # TRACE CALL #
  109. $END
  110. #
  111.   DETERMINE NUMBER OF LINES TO SEND TO K DISPLAY
  112. #
  113. KDBTSBN = DCW$KDBTSB[0]; # TSB NUMBER OF K DISPLAY BUFFER #
  114. TSBINFO(TSBSIZE,TSBFWA,KDBTSBN); # LOCATE K-DISPLAY BUFFER #
  115. P<KDS$BUFFER> = TSBFWA; # FWA OF K DISPLAY BUFFER #
  116. BLKLC = KDB$LC[0]; # KDB CURRENT LINE COUNT #
  117. BLKWC = KDB$WC[0] - KDB$HDRL; # WORD COUNT OF ALL KDB LINES #
  118. LC = BLKLC;
  119.  
  120. IF DCW$F$PWM[0]
  121. THEN # PAGE WAIT MODE IS ON #
  122. BEGIN
  123. KDLC = MAX$PW - DCW$LC[0]; # LINES THAT CAN BE SENT OUT #
  124. IF LC GR KDLC
  125. THEN # BUFFER CONTAINS MORE LINES THAN NAM K DISPLAY CAN HOLD #
  126. LC = KDLC;
  127. END
  128. #
  129.   FORMAT HOP/DIS/SM TO CARRY AS MANY LINES AS CAN BE FIT INTO THE
  130.   SMB$BUFFER, MULTIPLE HOP/DIS/SM(S) MAY BE SENT
  131. #
  132. P<SMB> = LOC(SM$HOPDIS); # FWA OF HOP/DIS SM BUFFER #
  133. P<LIN$HEADER> = 0;
  134. ADDR = P<KDS$BUFFER> + KDB$HDRL; # FWA OF 1ST LINE IN KDB TO SEND#
  135. TLW = 1; # TEXT LENGTH OF HOP/DIS #
  136.  
  137. IF LC NQ 0
  138. THEN # K-DISPLAY LINES TO SEND TO NIP #
  139. BEGIN
  140.  
  141. FOR I=LC STEP -1 WHILE I GQ 0
  142. DO # SEND LINES TO K DISPLAY #
  143. BEGIN
  144. LNSIZE = LIN$LNSIZE[ADDR] - LIN$HDRL; # CURRENT LINE SIZE #
  145.  
  146. IF (I EQ 0 # ALL LINES ARE SENT #
  147. AND TLW NQ 1) # SM BUFFER CONTAINS K DISPLAY LINES #
  148. OR (TLW+LNSIZE) GR L$HOPDIS # LINE CANNOT FIT IN BUF #
  149. THEN # SEND HOP/DIS/SM #
  150. BEGIN
  151. ABH$TLC[0] = TLW + 1; # SET TEXT LENGTH #
  152. SM$HOPI[0] = DCW$F$IA[0]; # SET INPUT-ALLOWED FLAG #
  153. SMBWORD[TLW] = 0;# CLEAR TEXT LENGTH+1 WORD #
  154. NETPUT(ABH,SM$HOPDIS); # SEND HOP/DIS/SM #
  155. TLW = 1; # RESET TLW TO INITIAL VALUE #
  156. END
  157.  
  158. IF I NQ 0
  159. THEN # MOVE CURRENT LINE TO SMB$BUFFER #
  160. BEGIN
  161. DCW$F$IA[0] = LIN$F$ENDR[ADDR];
  162. MOVEI(LNSIZE,ADDR+LIN$HDRL,LOC(SMBWORD[TLW]));
  163. BLKWC = BLKWC - LNSIZE - LIN$HDRL;
  164. TLW = TLW + LNSIZE; # UPDATE WORD COUNT IN SM BUFFER #
  165. ADDR = ADDR + LNSIZE + LIN$HDRL; # FWA OF NEXT LINE #
  166. END
  167.  
  168. END # I LOOP #
  169.  
  170. BLKLC = BLKLC - LC; # UPDATE REMAINING LINE COUNT #
  171. DCW$LC[0] = DCW$LC[0] + LC; # UPDATE NAM K-DISPLAY LINE CNT #
  172. END
  173.  
  174. IF BLKLC NQ 0
  175. THEN # MORE K-DISPLAY LINES TO FOLLOW #
  176. BEGIN
  177. IF NOT DCW$F$PAGE[0]
  178. THEN # NAM K DISPLAY PAGE WAS NOT FULL #
  179. BEGIN # SEND MORE DATA .. TO NAM K DISPLAY #
  180. ABH$TLC[0] = MDLC; # SET TEXT LENGTH #
  181. NETPUT(ABH,MORDATA); # SEND MORE DATA.. TO K DISPLAY #
  182. DCW$F$PAGE[0] = TRUE; # SET PAGE FULL FLAG #
  183. END
  184. #
  185.   TRANSFER REMAINING KDB LINES TO PAGE WAIT BUFFER
  186. #
  187. TEMP = DCW$PWBTSB[0];
  188. TSBINFO(TSBSIZE,TSBFWA,TEMP); # LOCATE PAGE WAIT BUFFER #
  189. P<PWB$BUFFER> = TSBFWA; # FWA OF PAGE WAIT BUFFER #
  190. IF PWB$LC[0] LS PWB$MAX$LN
  191. THEN # LINE CNT LESS THAN PAGE WAIT LINE LIMIT #
  192. BEGIN # TRANSFER LINE TO PAGE WAIT BUFFER #
  193. EXINCSZ(BLKWC,TSBFWA,TEMP); # INCREASE PWB SIZE #
  194. P<PWB$BUFFER> = TSBFWA; # RESET PWB FWA #
  195. P<LIN$HEADER> = TSBFWA + PWB$WC[0]; # FWA TO MOVE TO #
  196. MOVEI(BLKWC,ADDR,P<LIN$HEADER>);
  197. PWB$LC[0] = PWB$LC[0] + BLKLC;# UPDATE PWB LINE COUNT #
  198. PWB$WC[0] = PWB$WC[0] + BLKWC;# UPDATE PWB WORD COUNT #
  199. MOVEOK(TEMP); # ALLOW PWB TO MOVE #
  200. END
  201.  
  202. END
  203. #
  204.   REDUCE K DISPLAY BUFFER TO ITS HEADER ONLY
  205. #
  206. EXREDUC(KDB$WC[0]-KDB$HDRL,KDBTSBN,FALSE,TSBFWA);
  207. P<KDS$BUFFER> = TSBFWA;
  208. KDB$WC[0] = KDB$HDRL; # RESET KDB WORD COUNT AND LINE COUNT #
  209. KDB$LC[0] = 0;
  210. DCW$F$SKD[0] = FALSE;
  211. MOVEOK(KDBTSBN); # ALLOW K DISPLAY BUFFER TO MOVE #
  212.  
  213. RETURN;
  214. END # NS$MKD #
  215. TERM
cdc/nos2.source/nam5871/ns_mkd.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator