Table of Contents

DMSLGT Source

References

Source Listing

DMSLGT.ASSEMBLE.txt
  1. LGT TITLE 'DMSLGT (CMS) VM/370 - RELEASE 6' 00001000
  2. SPACE 2 00002000
  3. *. 00003000
  4. * 00004000
  5. * 00005000
  6. * MODULE NAME: 00006000
  7. * 00007000
  8. * DMSLGT 00008000
  9. * 00009000
  10. * FUNCTION: 00010000
  11. * 00011000
  12. * CONSISTS OF TWO SUBROUTINES: DMSLGTA, DMSLGTB 00012000
  13. * 00013000
  14. * 00014000
  15. * SUBROUTINE NAME: 00015000
  16. * 00016000
  17. * DMSLGTA 00017000
  18. * 00018000
  19. * FUNCTION: 00019000
  20. * 00020000
  21. * FREE ALL TXTLIB DIRECTORY BLOCKS ON TXTLIB CHAIN. 00021000
  22. * 00022000
  23. * ATTRIBUTES: 00023000
  24. * 00024000
  25. * REENTRANT, NUCLEUS RESIDENT 00025000
  26. * 00026000
  27. * ENTRY POINTS: 00027000
  28. * 00028000
  29. * DMSLGTA - ENTERED FROM DMSLDRB IF NOT A DYNAMIC LOAD. 00029000
  30. * 00030000
  31. * ENTRY CONDITIONS: 00031000
  32. * 00032000
  33. * R14 RETURN ADDRESS 00033000
  34. * R13 CONTAINS ADDRESS OF LDRST WORK AREA 00034000
  35. * R15 CONTAINS ADDRESS OF DMSLGTA 00035000
  36. * 00036000
  37. * EXIT CONDITIONS: 00037000
  38. * 00038000
  39. * NORMAL - RETURN VIA R14 00039000
  40. * ERROR - NONE 00040000
  41. * 00041000
  42. * CALLS TO OTHER ROUTINES: 00042000
  43. * 00043000
  44. * DMSFREB 00044000
  45. * 00045000
  46. * EXTERNAL REFERENCES: 00046000
  47. * 00047000
  48. * TXTLIB - LIST ANCHOR IN NUSECT. 00048000
  49. * 00049000
  50. * REGISTER USAGE: 00050000
  51. * 00051000
  52. * R10 - BASE 00052000
  53. * R13 - LDRST 00053000
  54. * R14 - RETURN 00054000
  55. * R0, 1, 15 - WORK 00055000
  56. * 00056000
  57. * OPERATION: 00057000
  58. * 00058000
  59. * PICK UP ANCHOR TO TXTLIB CHAIN. ZERO THE ANCHOR IN 00059000
  60. * NUSECT. CALL DMSFREE FOR EACH BLOCK OF FREE STORAGE 00060000
  61. * OCCUPIED BY A TXTLIB DIRECTORY. RETURN TO DMSLDRB VIA 00061000
  62. * R14. 00062000
  63. * 00063000
  64. * SUBROUTINE NAME: 00064000
  65. * 00065000
  66. * DMSLGTB 00066000
  67. * 00067000
  68. * FUNCTION: 00068000
  69. * 00069000
  70. * TO READ TXTLIB DIRECTORIES INTO A CHAIN OF FREE STORAGE 00070000
  71. * DIRECTORY BLOCKS. 00071000
  72. * 00072000
  73. * ATTRIBUTES: 00073000
  74. * 00074000
  75. * REENTRANT, NUCLEUS RESIDENT 00075000
  76. * 00076000
  77. * ENTRY POINTS: 00077000
  78. * 00078000
  79. * DMSLGTB - FROM DMSLDRB 00079000
  80. * 00080000
  81. * ENTRY CONDITIONS: 00081000
  82. * 00082000
  83. * R13 ADDRESS OF LDRST WORK AREA 00083000
  84. * R14 RETURN ADDRESS 00084000
  85. * R15 ADDRESSABILITY 00085000
  86. * 00086000
  87. * EXIT CONDITIONS: 00087000
  88. * 00088000
  89. * NORMAL - RETURN VIA R14 00089000
  90. * 00090000
  91. * ERROR - EXIT TO DMSLDRD IF TXTLIB NOT FOUND 00091000
  92. * OR INVALID TXTLIB 00092000
  93. * 00093000
  94. * CALLS TO OTHER ROUTINES: 00094000
  95. * 00095000
  96. * DMSBRD - TO READ TXTLIB RECORDS 00096000
  97. * DMSFREB - TO AQUIRE DIRECTORY BLOCKS 00097000
  98. * 00098000
  99. * EXTERNAL REFERENCES: 00099000
  100. * 00100000
  101. * TXTLIB LIST IN NUCON 00101000
  102. * 00102000
  103. * TABLES/WORKAREAS: 00103000
  104. * 00104000
  105. * NONE. 00105000
  106. * 00106000
  107. * REGISTER USAGE: 00107000
  108. * 00108000
  109. * R10 - BASE 00109000
  110. * R13 - LDRST 00110000
  111. * R14 - RETURN 00111000
  112. * R0, 1, 15 - WORK 00112000
  113. * 00113000
  114. * OPERATION: 00114000
  115. * 00115000
  116. * READ IN FIRST RECORD OF THE TXTLIB. FROM IT CALCULATE 00116000
  117. * SIZE AND LOCATION OF ITS DICTIONARY. CALL DMSFREB FOR A 00117000
  118. * FREE STORAGE REGION. READ THE DIRECTORY INTO IT. 00118000
  119. * CHAIN THE BLOCK FROM THE TXTLIB ANCHOR IN NUSECT. SAVE 00119000
  120. * THE SIZE OF THE BLOCK IN THE BLOCK HEADER. DO THE 00120000
  121. * ABOVE FOR EACH TXTLIB IN THE LIST BEGINNING AT 'TXTLIB' 00121000
  122. * IN NUSECT. IF AN ERROR OCCURS WHIL PROCESSING A 00122000
  123. * TXTLIB, EXIT TO DMSLDRD, OTHERWISE RETURN TO DMSLDRB. 00123000
  124. *. 00124000
  125. EJECT 00125000
  126. DMSLGT START 0 @V305665 00126100
  127. ENTRY DMSLGTA @V305665 00126200
  128. ENTRY DMSLGTB 00127000
  129. DMSLGTA EQU * @V305665 00127100
  130. LR R10,R15 00128000
  131. USING DMSLGTA,R10 00129000
  132. USING LDRST,R13 00130000
  133. USING NUCON,R0 00131000
  134. LR R5,R14 PROTECT RETURN REG 00132000
  135. SR R8,R8 GET ZERO 00133000
  136. L R1,TXTDIRC POINT TO TXTLIB FREE STOR CHN 00134000
  137. ST R8,TXTDIRC CLEAR TXTLIB ANCHOR WORD 00135000
  138. SPACE 00136000
  139. GLFRETLP EQU * FREE OLD TXTLIB DIRECTORY BLOCKS 00137000
  140. LTR R1,R1 END OF CHAIN? 00138000
  141. BCR 8,R14 IF SO RETURN 00139000
  142. L R0,8(R1) NO. OF DBL-WDS TO FREE 00140000
  143. L R7,12(R1) ADDRESS OF NEXT BLOCK TO FREE 00141000
  144. DMSFRET DWORDS=(0),LOC=(1),TYPCALL=BALR FREE THE BLOCK 00142000
  145. LR R14,R5 RESTORE RETURN REG 00143000
  146. LR R1,R7 00144000
  147. B GLFRETLP LOOP 00145000
  148. SPACE 00146000
  149. DROP R10 00147000
  150. USING *,R12 00148000
  151. DMSLGTB ST R14,APSV+56 SAVE R14 00149000
  152. LR R12,R15 MAKE A NEW TXTLIB DIRECTORY BLOCK CHAIN 00150000
  153. LA R3,TXTLIBS ADDR OF TXTLIB LIST 00151000
  154. LA R6,TXTDIRC-12 SET FOR CREATING CHAIN 00152000
  155. MVC READBUF(8),=CL8'RDBUF' SET FOR READING 00153000
  156. MVC FTYPE(8),=CL8'TXTLIB' FILETYPE TXTLIB 00154000
  157. MVC FMODE(2),=CL2'*' WITH ANY MODE 00155000
  158. MVC RFIX(2),=CL2'F' AND F FORMAT 00156000
  159. SPACE 00157000
  160. GLNEWLP EQU * 00158000
  161. CLI 0(R3),X'FF' END OF NEW TXTLIB CHAIN? 00159000
  162. BE GLOBRET BRANCH IF SO 00160000
  163. MVC FNAME(8),0(R3) MOVE IN THE LIBNAME 00161000
  164. LA R1,1 00162000
  165. STH R1,RITEM SET TO READ ITEM 1 00163000
  166. STH R1,RNUM (1 ITEM) 00164000
  167. LA R1,SPEC 00165000
  168. ST R1,RADD INTO SPEC 00166000
  169. LA R1,80 00167000
  170. ST R1,RLENG UP TO 80 BYTES 00168000
  171. LA R1,READBUF DO IT 00169000
  172. L R15,ARDBUF ADR OF RDBUF V0304 00170100
  173. BALR R14,R15 V0304 00170200
  174. BNZ GLRD1ERR BRANCH IF ERROR V0304 00170300
  175. CLC SPEC+3(3),=CL3'LIB' VALID TXTLIB ? 00172000
  176. BE GLTXTOK YES, CONTINUE 00173000
  177. LA R5,54 ERROR 056E 00174000
  178. B GLRDFERR 00175000
  179. GLTXTOK L R1,SPEC+8 NO. OF DBL-WDS NEEDED FOR DIRECTORY 00176000
  180. LA R1,SEVEN(,R1) ROUND UP TO NEXT DLB-WD @VA05939 00176500
  181. SRL R1,3 00177000
  182. LA R0,12(R1) ADD 12 FOR HEADING @VA07654 00178500
  183. DMSFREE DWORDS=(0),TYPE=NUCLEUS,TYPCALL=BALR GET FREE STORAGE 00179000
  184. ABOVE ST R1,12(R6) NEW BLK IN OLD LINK @VM08822 00180000
  185. MVC 0(8,R1),0(R3) MOVE LIBNAME INTO HEAD OF BLOCK 00181000
  186. ST R0,8(R1) AND SAVE LENGTH IN 3RD WORD 00182000
  187. SR R8,R8 GET A ZERO 00183000
  188. ST R8,12(R1) AND ZERO CHAIN POINTER IN 4TH 00184000
  189. LR R14,R6 SAVE R6 00185000
  190. LR R6,R1 00186000
  191. LA R1,12 ALLOW 12 FOR HEADING @VA08674 00187100
  192. SR R0,R1 RESTORE R0 00188000
  193. ST R0,16(R6) STORE IN HEADER 00189000
  194. LA R1,32(R6) ADDRESS OF DIRECTORY (AFTER HEADER) 00190000
  195. ST R1,20(R6) STORE IT IN HEADER 00191000
  196. CH R0,=H'-5' SETTING UP DUMMY DIRECTORY? @VA08674 00191110
  197. BE ENDPTR YES @VM08822 00191200
  198. A R1,SPEC+8 ADD SOME MAGIC NUMBER 00192000
  199. STORIT ST R1,28(,R6) STORE IT IN HDR TOO. @VM08822 00193000
  200. LA R1,12 GET 12 00194000
  201. ST R1,24(R6) AND STORE THIS TOO 00195000
  202. CH R0,=H'-5' SETTING UP DUMMY DIRECTORY? @VA08674 00195110
  203. BE GLNXTLIB @VM08822 00195200
  204. LH R4,SPEC+6 PICK UP ITEM NO. FROM SPEC 00196000
  205. LA R7,32(R6) POINT TO SPACE FOR PUTTING DIRECTORY 00197000
  206. L R9,SPEC+8 NO. OF BYTES IN DICT. 00198000
  207. LA R9,0(R7,R9) END OF DICTIONARY ADDR. 00199000
  208. LA R8,72 BXLE INCREMENT 00200000
  209. LR R5,R9 POINT TO END @VA05939 00200300
  210. SR R5,R8 ADDRESS OF LAST RECORD @VA05939 00200700
  211. LA R1,READBUF READ TXTLIB DIRECTORY INTO FREE STRO 00201000
  212. READIN STH R4,RITEM SET READ ITEM NO. 00202000
  213. L R15,ARDBUF V0304 00203100
  214. BALR R14,R15 V0304 00203200
  215. BNZ GLRDZERR BRANCH IF ERROR V0304 00203300
  216. CR R7,R5 WITHIN LAST RECORD AREA? @VA05939 00203500
  217. BL MOVEIN BRANCH IF NOT @VA05939 00203700
  218. SR R9,R7 COMPUTE LENGTH OF LAST MOVE @VA05939 00203900
  219. BCTR R9,0 LESS ONE FOR EX @VA05939 00204100
  220. EX R9,MVC MOVE IN LAST PART OF DICT @VA05939 00204300
  221. B GLNXTLIB FINISHED WITH THIS DICT @VA05939 00204500
  222. MOVEIN EQU * @VA05939 00204700
  223. MVC 0(72,R7),SPEC MOVE DICT. RECORD TO BUFFER 00205000
  224. LA R4,1(0,R4) BUMP ITEM NO. 00206000
  225. BXLE R7,R8,READIN READ IN ALL DICT. ITEMS 00207000
  226. SPACE 00208000
  227. GLNXTLIB EQU * PROCEED TO NEXT LIBRARY 00209000
  228. LA R3,8(R3) POINT TO NEXT LIBNAME 00210000
  229. B GLNEWLP AND LOOP 00211000
  230. ENDPTR XC 32(24,R6),32(R6) FILL ENTRIES ZEROS @VM08822 00211100
  231. LA R1,44(,R6) 2 TEXT ENTRIES @VM08822 00211200
  232. B STORIT STORE ENDPTR DIR @VM08822 00211300
  233. SPACE 00212000
  234. GLRD1ERR CH R15,=H'1' FILE NOT FOUND V0314 00213100
  235. BE NOTFD YES @VM08822 00213200
  236. RDERR LA R5,62 CODE FOR READ ERR @VM08822 00213300
  237. GLRDFERR LM R8,R9,APSV+32 GET DMSLDR BASE REGS 00215000
  238. MVC OUTBUF(18),FNAME SET MSG SUBSITUTIONS V0314 00216100
  239. L R12,=V(DMSLDRD) GET TERMINAL ERROR ENTRY TO LDRV0314 00217100
  240. BR R12 V0314 00217200
  241. SPACE 00219000
  242. *SET UP DUMMY DIRECTORY @VM08822 00220000
  243. NOTFD DMSERR TEXT='FILE ''........ TXTLIB'' NOT FOUND', @VM08822X00220100
  244. SUB=(CHARA,(R3)),NUM=2,LET=I @VM08929 00220200
  245. LA R0,7 DEF DBL-WDS TO 7 @VM08822 00220300
  246. DMSFREE DWORDS=(0),TYPE=NUCLEUS,TYPCALL=BALR @VM08822 00220400
  247. B ABOVE BR TO CREATE DIR @VM08822 00220500
  248. SPACE 00222000
  249. GLRDZERR EQU * READ ERROR FOR DIRECTORY 00223000
  250. CH R15,=H'12' END OF FILE 00224000
  251. BE GLNXTLIB YES, DO NEXT LIBRARY 00225000
  252. LR R1,R6 SET UP TO FREE THE BLOCK 00226000
  253. L R0,8(R1) 00227000
  254. DMSFRET DWORDS=(0),LOC=(1),TYPCALL=BALR 00228000
  255. LR R6,R14 RESTORE R9 00229000
  256. XC 12(4,R6),12(R6) CLEAR CHAIN POINTER 00230000
  257. B RDERR TERMINATE THE COMMAND 00231000
  258. SPACE 00232000
  259. GLOBRET EQU * 00233000
  260. LM R0,R15,APSV RESTORE ALL REGISTERS 00234000
  261. BR R14 AND RETURN 00235000
  262. MVC MVC 0(0,R7),SPEC @VA05939 00235200
  263. FOUR EQU 4 @VA05939 00235400
  264. SEVEN EQU 7 @VA05939 00235600
  265. LTORG 00235800
  266. EJECT 00236000
  267. LDRST 00237000
  268. EJECT 00238000
  269. REGEQU 00239000
  270. SPACE 2 00240000
  271. NUCON 00241000
  272. END 00242000