User Tools

Site Tools


cdc:nos2.source:nam5871:khopdis

KHOPDIS

Table Of Contents

  • [00013] PRGM KHOPDIS
  • [00074] PROC XTRACE
  • [00075] PROC MRELS
  • [00076] PROC HRELPWL

Source Code

KHOPDIS.txt
  1. *DECK KHOPDIS
  2. USETEXT NIPDEF
  3. USETEXT DRHDR
  4. USETEXT KINITBF
  5. USETEXT ACB
  6. USETEXT KDIS
  7. USETEXT DISTAIL
  8. USETEXT SUPMSG
  9. USETEXT OVERLAY
  10. USETEXT PARAMS
  11. USETEXT APPSTAT
  12. USETEXT NWLNTRY
  13. PRGM KHOPDIS;
  14. STARTIMS;
  15. #
  16. *1DC KHOPDIS
  17. *
  18. * 1. PROC NAME AUTHOR DATE
  19. * KHOPDIS A. BEN-ARTZI 81/12/08
  20. *
  21. * 2. FUNCTIONAL DESCRIPTION
  22. *
  23. * PUT HOP/DIS MESSAGES ON K-DISPLAY SCREEN
  24. *
  25. * 3. METHOD USED
  26. * DECODE OUT THE DIS MESSAGE FROM NWL.
  27. * RELEASE USED PORTION OF NWL.
  28. * CHAIN BUFFER WITH K-DISPLAY DATA RING, AND
  29. * RELEASE SAME NUMBER OF LINES FROM TOP OF RING.
  30. *
  31. * 4. ENTRY PARAMETERS.
  32. *
  33. * WLADDR
  34. *
  35. * 5. EXIT PARAMETERS
  36. *
  37. * PARAMS1 - ERROR CODE (IF ANY)
  38. *
  39. * 6. COMDECKS CALLED AND SYMPL TEXT USED
  40. *
  41. * NIPDEF KDIS DISTAIL
  42. * SUPMSG APPSTAT NWLNTRY
  43. * DRHDR KINITBF PARAMS
  44. *
  45. * 7. ROUTINES AND OVRLAYS CALLED
  46. *
  47. * XTRACE - TRACE PROCEDURE CALL
  48. * MRELS - RELEASE BUFFER SPACE
  49. * HRELPWL - RELEASE USED PORTION OF WORKLIST
  50. *
  51. *
  52. *
  53. *
  54. * 8. DAYFILE MESSAGES
  55. *
  56. * THIS PROGRAM IS A SECONDARY OVERLAY LOADED BY
  57. * SUBROUTINE OVLCALL. WHEN EXECUTION HAS COMPLETED,
  58. * A JUMP IS MADE TO LOCATION RJMAIN TO RETURN TO
  59. * THE CALLING PROGRAM.
  60. *
  61. * W A R N I N G - THIS PROGRAM CANNOT EXCEED THE SECONDARY
  62. *CALL OSSIZE
  63. *
  64. * THIS OVERLAY IS CALLED BY HPKDISP
  65. *
  66.  #
  67. STOPIMS;
  68. #
  69.   EXTERNAL REFERENCES
  70. #
  71. XREF
  72. BEGIN
  73. LABEL RJMAIN; # RETURN ADDRESS IN OVLCALL #
  74. PROC XTRACE;
  75. PROC MRELS;
  76. PROC HRELPWL;
  77. END
  78. #
  79.   INTERNAL VARIABLES
  80. #
  81. ITEM ENDLOOP I=0 ;
  82. ITEM KLINES I=0 ; # NUMBER OF LINES IN HOP/DIS RECEIVED #
  83. ITEM KINDEX I=0; # LOCAL LOOP COUNTER #
  84. ITEM KCOUNT I=0; # LOCAL COUNTER #
  85. ITEM KDONE B ; # AND OF RELEASE LOOP CHECK #
  86. ITEM K2 I=0; # NO OF DOWN LINES KDISTOP SHOULD MOVE #
  87. ITEM KBACK U ; # ADDRESS OF FORMER BLOCK IN RING #
  88. ITEM KREL U ; # ADDRESS OF BUFFER TO BE RELEASED #
  89. BASED ARRAY HOPLN [1:1] S(1) ;
  90. BEGIN
  91. ITEM HOPENDL U(0,48,12) ;
  92. ITEM HOPSTRL U(0,0,12) ;
  93. ITEM HOPWRDL U(0,0,60) ;
  94. END
  95. BEGIN
  96. CONTROL IFEQ DEBUG,1;
  97. XTRACE("KHOPD");
  98. CONTROL FI;
  99. #**********************************************************************#
  100. PARAMS1 = 0 ;
  101. #
  102.   FIRST PUT THE TABLETS
  103. #
  104. P<DRHDRWD> = WLADDR;
  105. P<SUPMSG> = WLADDR + AIPHSIZE + ABHSIZE;
  106. P<HOPLN> = P<SUPMSG> + 1 ;
  107. IF HOPI[0]
  108. THEN # WE CAN ENABLE INPUT TO APPLICATION #
  109. BEGIN
  110. KDNI[0]=FALSE;
  111. KDBK[0]=FALSE;
  112. END
  113. # #
  114. P<KINITBF> = WLADDR + BLKBS[0]-1; # TABLET ON LAST WORD OF BUFFR#
  115. IF P<KINITBF> LS P<HOPLN>
  116. THEN # NO DATA AT ALL. EVEN A ZERO WORD #
  117. GOTO ERRX ;
  118. IF HOPSCR THEN
  119. BEGIN
  120. K7777[0] = 0;
  121. KDSTAIL[0] = 0; # END OF RIGHT DISPLAY #
  122. END
  123. ELSE
  124. BEGIN
  125. K7777[0] = O"7777";
  126. KDSTAIL[0] = LOC(KDTLNAM[0])+1;# AND POINT TO NEXT DATA(TAIL) #
  127. END
  128. #
  129.   SCAN ALL MESSAGE TO SEE HOW MANY LINES WE GOT (BYTE 4=BINARY 0
  130. #
  131. KLINES = 0 ;
  132. ENDLOOP = BLKBS[0] - AIPHSIZE - ABHSIZE - KHDRSIZE - 1 ;
  133. IF ENDLOOP EQ 0
  134. THEN # EMPTY HOPDIS #
  135. GOTO KEXIT ;
  136. IF HOPWRDL[1] EQ 0
  137. THEN # TERMINATOR WITHOUT TEXT #
  138. GOTO ERRX ;
  139. FOR KINDEX=1 STEP 1 UNTIL ENDLOOP DO
  140. BEGIN
  141. IF HOPSTRL[KINDEX] EQ 0 AND HOPWRDL[KINDEX] NQ 0
  142. THEN
  143. GOTO ERRX ;
  144. IF HOPENDL[KINDEX] EQ 0
  145. THEN
  146. BEGIN
  147. KLINES = KLINES+1;
  148. IF (HOPWRDL[KINDEX+1] EQ 0) AND
  149. (KINDEX NQ ENDLOOP)
  150. THEN # DSD MAY GET CONFUSED #
  151. GOTO ERRX ;
  152. END
  153. END
  154.  
  155. BLKID[0] = KDISIDVALUE; # THEN MAKE IT A K TYPE BLOCK #
  156. P<KINITBF> = WLADDR+BLKHSIZE ;
  157. KDTYPE[0] = KDISTYPE ;
  158. IF HOPSCR THEN
  159. BEGIN
  160. IF KDRFP[0] NQ 0
  161. THEN # PREVIOUS RIGHT SCREEN BUFFER EXISTS #
  162. BEGIN
  163. MRELS(KDRFP[0]); # RELEASE PREVIOUS RIGHT SCREEN BUFFER #
  164. END
  165. HRELPWL; # RELEASE FIRST PART OF NWL #
  166. BACKPTR[0] = LOC(KDRBP[0]); # CHAIN BUF INTO RIGHT SCRN CHAIN #
  167. KDRBP[0] = WLADDR;
  168. NEXTPTR[0] = LOC(KDRFP[0]);
  169. KDRFP[0] = WLADDR;
  170. KDRSTOP[0] = WLADDR+3; # POINT TO FIRST DISPLAY WORD #
  171. GOTO RJMAIN;
  172. END
  173. #
  174.   NOW WE UPDATE DATA AND POINTERS IN THE BLOCK WE JUST GOT
  175. #
  176. BACKPTR[0] = KDBP[0]; # FIRST PUT INTO K RING #
  177. NEXTPTR[0] = LOC(KDFP[0]);
  178. #
  179.   NOW UPDATE THE LAST BLOCK (TO BE CHAINED TO NEW ONE)
  180. #
  181. P<DRHDRWD> = KDBP[0]; # HERE IT IS #
  182. # #
  183. NEXTPTR[0] = WLADDR;
  184. # #
  185. P<KINITBF> = KDBP[0]+BLKBS[0]-1; # PUT TABLET ON LAST WORD OF BLK#
  186. KDSTAIL[0] = P<HOPLN> ; # AND POINT TO NEW DATA #
  187. #
  188.   FINALLY SHOW THE CHAIN BOTTOM MOVE ON THE KDIS COMMON
  189. #
  190. KDBP[0] = WLADDR;
  191. #
  192.   AND RELEASE USED PORTION ON NWL
  193. #
  194. HRELPWL;
  195. #
  196.   NOW WE MOVE KDISTOP POINTER DOWN,SAME LINES AS NEWLY CAME
  197. #
  198. KCOUNT=0;
  199. K2 =0;
  200. KDONE = FALSE ;
  201. P<KINITBF> = KDLSTOP[0]; # START COUNTING FROM CURRENT LOCATION #
  202. # #
  203. FOR KINDEX =0 WHILE NOT KDONE DO
  204. BEGIN
  205. # #
  206. IF K7777[KCOUNT] EQ O"7777" # THIS IS NOT A DATA LINE #
  207. THEN
  208. BEGIN # JUMP TO NEXT BLOCK TO CONTINUE SEARCH.RELEASE THIS ONE #
  209. # #
  210. KDLSTOP[0] = KDSTAIL[KCOUNT];
  211. P<KINITBF> = KDLSTOP[0];
  212. KCOUNT = 0;
  213. # AND RELEASE THE ONE JSUT PASSED #
  214. P<DRHDRWD> = KDFP[0];
  215. KBACK = BACKPTR[0] ;
  216. KDFP[0]=NEXTPTR[0] ;
  217. IF KDORIG[0]
  218. THEN
  219. BEGIN # THIS IS OUR FIRST AND SPECIAL BUFFER #
  220. BACKPTR[0] = LOC(KORIGBP[0]) ; # SO WE SAVE IT #
  221. NEXTPTR[0] = BACKPTR[0] ;
  222. BLKID [0] = DRIDVALUE ;
  223. KORIGBP[0] = P<DRHDRWD> ; # SAVE ADDRESS IN COMMON #
  224. KORIGFP[0] = P<DRHDRWD> ;
  225. END
  226. ELSE
  227. KREL = P<DRHDRWD> ;
  228. P<DRHDRWD> = KDFP[0];
  229. BACKPTR[0] = KBACK;
  230. #
  231.   AND RELEASE IT (IF IT IS NOT THE ORIGINAL)
  232. #
  233. IF KDORIG[0]
  234. THEN
  235. KDORIG[0] = FALSE ;
  236. ELSE
  237. MRELS(KREL) ;
  238. END
  239. # #
  240. ELSE # THIS IS A REGULAR DATA LINE IN PREVIOUS MESSAGE #
  241. BEGIN
  242. IF K2 EQ KLINES
  243. THEN
  244. KDONE = TRUE ; # WE ADVANCED EXACTLLY ENOUGH LINES #
  245. ELSE
  246. BEGIN
  247. IF K312[KCOUNT] EQ 0
  248. THEN
  249. K2=K2+1; # ZERO BYTE,MEANS WE GOT ONE MORE LINE IN HAND #
  250. #
  251.   AND INCREMENT THE WORDS COUNTER IN BOTH CASES
  252. #
  253. KCOUNT = KCOUNT + 1 ;
  254. END
  255. END
  256. END
  257. #
  258.   NOW KCOUNT HAS NUMBER OF WORDS (IN JUST THE UPMOST BLOCK) THAT
  259.   THE DATA POINTER(KDISTOP) SHOULD BE MOVED
  260. #
  261. KDLSTOP[0] = KDLSTOP[0] + KCOUNT ;
  262. GOTO RJMAIN; # RETURN TO CALLING ROUTINE #
  263.  
  264. ERRX:
  265. PARAMS1 = RLG"ISM" ;
  266. KEXIT:
  267. GOTO RJMAIN ;
  268.  
  269. END
  270. TERM
cdc/nos2.source/nam5871/khopdis.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator