Table of Contents

DMSEXC Source

References

Source Listing

DMSEXC.ASSEMBLE.txt
  1. EXC TITLE 'DMSEXC (CMS) VM/370 - RELEASE 6' 00001000
  2. SPACE 2 00002000
  3. * MODULE NAME - 00003000
  4. * 00004000
  5. * DMSEXC (EXEC) 00005000
  6. * 00006000
  7. * FUNCTION - 00007000
  8. * 00008000
  9. * BOOTSTRAP FOR DISK VERSION OF EXEC. 00009000
  10. * 00010000
  11. * ATTRIBUTES - 00011000
  12. * 00012000
  13. * NUCLEUS, REENTRANT, SHARED 00013000
  14. * 00014000
  15. * ENTRY POINTS - 00015000
  16. * 00016000
  17. * DMSEXC(EXEC) 00017000
  18. * 00018000
  19. * ENTRY CONDITIONS - 00019000
  20. * 00020000
  21. * GPR1 = A(EXEC PARAMETER LIST) 00021000
  22. * GPR14 = RETURN ADDRESS 00022000
  23. * GPR15 = A(DMSEXC) 00023000
  24. * PLIST = IMMATERIAL 00024000
  25. * 00025000
  26. * EXIT CONDITIONS - 00026000
  27. * 00027000
  28. * NORMAL - 00028000
  29. * GPR15 = 0(AS RETURNED BY EXECTOR) 00029000
  30. * 00030000
  31. * ERROR - 00031000
  32. * GPR15 NE 0(AS RETURNED BY EXECTOR) 00032000
  33. * GPR15 = -3 : EXECTOR MODULE NOT FOUND 00033000
  34. * 00034000
  35. * CALLS TO OTHER ROUTINES - 00035000
  36. * 00036000
  37. * FREE - GET FREE STORAGE 00037000
  38. * FRET - RETURNS FREE STORAGE 00038000
  39. * STATE - SEE IF EXECTOR MODULE EXISTS 00039000
  40. * RDBUF - READ IN EXECTOR MODULE 00040000
  41. * FINIS - CLOSE THE READING OF EXECTOR MODULE 00041000
  42. * REXX - Execute a REXX procedure HRC371DS 00041100
  43. * 00042000
  44. * EXTERNAL REFERENCES - 00043000
  45. * 00044000
  46. * FVS 00045000
  47. * OPSECT - I/O INFORMATION 00046000
  48. * NUCON - NUCLEUS AREA INFORMATION 00047000
  49. * 00048000
  50. * TABLES / WORKAREAS - 00049000
  51. * 00050000
  52. * STATE - LIST AREA FOR STATE, FINIS, RDBUF 00051000
  53. * BUFFER - read first line of EXEC here HRC371DS 00051100
  54. * FILEID - fileid of EXEC to read HRC371DS 00051200
  55. * 00052000
  56. * REGISTER USAGE - 00053000
  57. * 00054000
  58. * GPR1 = A(PLIST FOR CALLS TO OTHER ROUTINES) 00055000
  59. * GPR2 = A(EXEC PLIST) 00056000
  60. * GPR6 = A(FVS) 00057000
  61. * GPR7 = A(OPSECT) 00058000
  62. * GPR8 = A(NUCON) 00059000
  63. * GPR9 = A(SYSREF) 00060000
  64. * GPR9 = saved R14 while checking for REXX program HRC371DS 00060100
  65. * GPR10 = saved R0 while checking for REXX program HRC371DS 00060200
  66. * GPR11 = saved R1 while checking for REXX program HRC371DS 00060300
  67. * GPR13 = BASE REGISTER 00061000
  68. * GPR14, GPR15 = BALR INSTRUCTIONS 00062000
  69. * GPR0, GPR3, GPR4 = WORK REGISTERS 00063000
  70. * GPR5 = RETURN ADDRESS SAVED 00064000
  71. * 00065000
  72. * NOTES - 00066000
  73. * 00067000
  74. * NONE 00068000
  75. * 00069000
  76. * OPERATION - 00070000
  77. * 00071000
  78. * 0. Read the first line of the user program, and scan HRC371DS 00071100
  79. * to determine if the first word in the line is HRC371DS 00071200
  80. * '/*'. If so, call REXX via SVC 202 to execute HRC371DS 00071300
  81. * the program, then return to our caller. HRC371DS 00071400
  82. * HRC371DS 00071500
  83. * 1. DETERMINE FROM EXLEVEL IN OPSECT WHETHER OR NOT THE 00072000
  84. * EXECTOR MODULE MUST BE READ IN. 00073000
  85. * 00074000
  86. * 2. IF LEVEL=1 THEN CALL STATE TO SEE IF THE MODULE EXISTS. 00075000
  87. * IF THE FILE EXISTS, GET ENOUGH FREE STORAGE(VIA FREE) 00076000
  88. * TO HOLD IT AND READ IT IN(RDBUF). ONCE THE FILE IS 00077000
  89. * READ IN, CALL FINIS TO END THE READING OPERATION, 00078000
  90. * AND SET THE EXECRUN FLAG ON. 00079000
  91. * 00080000
  92. * 3. SET THE ENTRY CONDITIONS REQUIRED FOR EXECTOR AND 00081000
  93. * BALR THERE. 00082000
  94. * 00083000
  95. * 4. DECREMENT EXLEVEL AND STORE THE NEW VALUE. IF IT IS 0, 00084000
  96. * RETURN THE FREE STORAGE(VIA FRET). 00085000
  97. * 00086000
  98. * 5. SET EXECRUN FLAG OFF AND RETURN. 00087000
  99. *. 00088000
  100. EJECT 00089000
  101. EXEC CSECT 00090000
  102. DMSEXC EQU EXEC 00091000
  103. ENTRY DMSEXC 00092000
  104. LR R13,R15 ADDRESSABILITY 00093000
  105. USING EXEC,R13 INTO R13, 00094000
  106. USING NUCON,R0 ACCESS NUCLEUS AREA INFORMATION 00095000
  107. LR R5,R14 SAVE RETURN-REGISTER IN R5 (SAFE THERE) 00096000
  108. CLI 8(R1),FENCE EXECNAME SPECIFIED ? @VM03113 00097000
  109. BE ERR001 NO, ERROR @VM03113 00098000
  110. SPACE 1 HRC371DS 00098010
  111. * The exec program can be written either in REXX or EXEC. We HRC371DS 00098020
  112. * read the first line of the file, and if the first word in HRC371DS 00098030
  113. * that line begins with '/*', then it is a REXX program, and HRC371DS 00098040
  114. * we invoke DMSREX to execute it. Otherwise we fall through HRC371DS 00098050
  115. * and let EXEC handle it. HRC371DS 00098060
  116. LR R9,R14 save return address HRC371DS 00098070
  117. LR R10,R0 save eplist pointer HRC371DS 00098080
  118. LR R11,R1 save plist pointer HRC371DS 00098090
  119. DMSFREE DWORDS=66,TYPE=NUCLEUS,TYPCALL=BALR HRC371DS 00098100
  120. LR R8,R1 save memory address HRC371DS 00098110
  121. USING WORK,R8 HRC371DS 00098120
  122. LA R7,256(R8) map FSCB on top of BUFFER1 HRC371DS 00098130
  123. USING FSCBD,R7 HRC371DS 00098140
  124. MVC FSCBCOMM(8),=C'RDBUF ' HRC371DS 00098150
  125. MVC FSCBFN(8),8(R11) copy exec name HRC371DS 00098160
  126. MVC FSCBFT(10),=C'EXEC * ' HRC371DS 00098170
  127. MVC FSCBITNO(2),=H'1' HRC371DS 00098180
  128. ST R8,FSCBBUFF HRC371DS 00098190
  129. MVC FSCBSIZE,=F'256' buffer length HRC371DS 00098200
  130. MVC FSCBNOIT(2),=H'1' HRC371DS 00098210
  131. LR R1,R7 address of FSCB HRC371DS 00098220
  132. L R15,ARDBUF HRC371DS 00098230
  133. BALR R14,R15 read the file's first line HRC371DS 00098240
  134. BNZ NOTREXX let EXEC handle any read error HRC371DS 00098250
  135. MVC FSCBCOMM(8),=C'FINIS ' HRC371DS 00098260
  136. L R15,AFINIS close the file HRC371DS 00098270
  137. BALR R14,R15 HRC371DS 00098280
  138. * Now scan the line we read, looking for '/*'. HRC371DS 00098290
  139. L R5,FSCBNORD get bytes read HRC371DS 00098300
  140. DROP R7 HRC371DS 00098310
  141. LR R3,R8 start of line into R3 HRC371DS 00098320
  142. LA R4,1 increment HRC371DS 00098330
  143. AR R5,R3 end of line into R5 HRC371DS 00098340
  144. SCANLOOP DS 0H HRC371DS 00098350
  145. CLI 0(R3),C' ' skip blanks HRC371DS 00098360
  146. BNE CHECK found non-blank HRC371DS 00098370
  147. BXLE R3,R4,SCANLOOP keep looking HRC371DS 00098380
  148. CHECK DS 0H HRC371DS 00098390
  149. CLC 0(2,R3),=C'/*' found REXX comment? HRC371DS 00098400
  150. BNE NOTREXX no, continue with EXEC HRC371DS 00098410
  151. * We have an exec written in REXX. Build new regular and HRC371DS 00098420
  152. * extended plists with REXX as the command name. HRC371DS 00098430
  153. MVC BUFFER1(256),0(R11) copy original plist HRC371DS 00098440
  154. MVC BUFFER1(8),=C'DMSREX ' overlay EXEC with REXX HRC371DS 00098450
  155. LA R1,BUFFER1 recover R1 HRC371DS 00098460
  156. ST R11,BUFFER0 HRC371DS 00098470
  157. ICM R1,8,BUFFER0 copy flag byte from original R1 HRC371DS 00098480
  158. MVC BUFFER0(7),=C'DMSREX ' insert command name HRC371DS 00098490
  159. L R3,0(R10) get start of eplist HRC371DS 00098500
  160. L R4,8(R10) end of old argstring HRC371DS 00098510
  161. MVC BUFFER0+7(249),0(R3) copy eplist HRC371DS 00098520
  162. SR R4,R3 compute length of old argstring HRC371DS 00098530
  163. LA R3,BUFFER0 HRC371DS 00098540
  164. ST R3,EPLIST store as eplist command HRC371DS 00098550
  165. LA R3,7(R3) start of arguments HRC371DS 00098560
  166. ST R3,EPLIST+4 store as eplist argbeg HRC371DS 00098570
  167. AR R3,R4 add length of arguments HRC371DS 00098580
  168. ST R3,EPLIST+8 store a eplist argend HRC371DS 00098590
  169. SR R3,R3 HRC371DS 00098600
  170. ST R3,EPLIST+12 HRC371DS 00098610
  171. LA R0,EPLIST point R0 at eplist HRC371DS 00098620
  172. * At last we invoke the REXX interpreter. HRC371DS 00098630
  173. SVC 202 should we set EXECRUN flag??? HRC371DS 00098640
  174. DC AL4(*+4) HRC371DS 00098650
  175. LR R3,R15 save return code from REXX HRC371DS 00098660
  176. DMSFRET DWORDS=66,LOC=WORK,TYPCALL=BALR HRC371DS 00098670
  177. LR R15,R3 recover return code HRC371DS 00098680
  178. BR R9 return to our caller HRC371DS 00098690
  179. * Return our memory, restore registers, and let EXEC proceed HRC371DS 00098700
  180. NOTREXX DS 0H continue with normal EXEC... HRC371DS 00098710
  181. DMSFRET DWORDS=66,LOC=WORK,TYPCALL=BALR HRC371DS 00098720
  182. DROP R8 HRC371DS 00098730
  183. LR R5,R9 recover R5 HRC371DS 00098740
  184. LR R0,R10 recover R0 HRC371DS 00098750
  185. LR R1,R11 recover R1 HRC371DS 00098760
  186. SPACE 1 HRC371DS 00098770
  187. LR R2,R1 SAVE POINTER TO P-LIST, 00099000
  188. L R7,AOPSECT A(IO INFORMATION) 00100000
  189. USING OPSECT,R7 ... 00101000
  190. LM R3,R4,EXLEVEL EXEC LEVEL INTO R3, 1 --> R4 00102000
  191. AR R3,R4 ADD 1 TO LEVEL, 00103000
  192. CR R3,R4 IF LEVEL = 1, MUST READ IN EXECTOR MODU, 00104000
  193. BNE GETBASE READ FROM DISK FOR ... @V305614 00105000
  194. SPACE 1 00106000
  195. MVC PLIST(SIZDUM),STATE SET UP STATE & RDBUF PLIST @V305614 00107000
  196. OI MISFLAGS,NEGITS GUILTY UNTIL PROVEN INNOCENT @VA04594 00108000
  197. STLOOP LA R1,PLIST POINT TO STATE PLIST @V305614 00109000
  198. LH R12,FFD FORCE ERROR -3 IF ERROR @V305614 00110000
  199. ST R12,EXNUM INITIALIZE NEGATIVE @V305614 00111000
  200. L R15,=V(DMSLFS) CALL "FSTLKP" @VM03083 00112000
  201. BALR R14,R15 LOADMOD ON DISK ? @V305614 00113000
  202. BZ LOADEX YES, LOADMOD IT @V305614 00114000
  203. SPACE 1 00115000
  204. CLI FILEMODE,E2 WAS THAT FOR THE 'S' DISK ? @V305066 00116000
  205. BE SETRET IF SO, WE'RE ALL DONE @V305614 00117000
  206. B TRYSYS OTHERWISE, TRY SAVED SYSTEM @V305614 00118000
  207. SPACE 1 00119000
  208. LOADEX LR R6,R1 GET FST ADDRESS @V305614 00120000
  209. USING FSTD,R6 ..... @V305614 00121000
  210. L R1,FSTLRECL GET MODULE SIZE @V305614 00122000
  211. ST R1,FILEBYTE STORE WHERE NEEDED @V305614 00123000
  212. LR R11,R0 GET ADT ADDRESS @V305614 00124000
  213. USING ADTSECT,R11 ..... @V305614 00125000
  214. SPACE 1 00126000
  215. MVC FILEMODE(2),ADTM SET PLIST FILEMODE @V305614 00127000
  216. LA R0,7(,R1) ROUND UPWARD AND.. @V305614 00128000
  217. SRA R0,3 SHIFT FOR DWORDS @V305614 00129000
  218. * GET ENOUGH FREE STORAGE FOR EXECTOR MODULE .... 00130000
  219. DMSFREE DWORDS=(0),TYPE=NUCLEUS,TYPCALL=BALR @VM03083 00131000
  220. ST R1,FILEBUFF STORE ADDRESS IN PLIST AND @V305614 00132000
  221. STM R0,R1,EXNUM SAVE THESE FOR LATER FRET CALL @V305614 00133000
  222. LA R1,PLIST READ IN EXECTOR @V305614 00134000
  223. SVC 202 INTO FREE STORAGE @V305614 00135000
  224. DC AL4(SETRET) @V305614 00136000
  225. L R15,AFINIS FINIS THE FILE @V305614 00137000
  226. BALR R14,R15 ..... @V305614 00138000
  227. B EXECIN PROCEED.. @V305614 00139000
  228. SPACE 1 00140000
  229. NOSYS MVC FILEMODE(2),SMODE LETS TRY FOR THE 'S' DISK @V305614 00141000
  230. B STLOOP LAST ATTEMPT @V305614 00142000
  231. SPACE 1 00143000
  232. TRYSYS TM DCSSFLAG,DCSSLDED+DCSSAVAL CHECK DCSS STATUS @V305614 00144000
  233. BZ NOSYS BR, IF NO DCSS AVAILABLE @V305614 00145000
  234. BM LOADSYS BR, IF DCSS NOT LOADED @V305614 00146000
  235. L R8,ACMSSEG GET SEGMENT ADDRESS @V305614 00147000
  236. B SKIPLOAD AND GO AROUND LOADSYS @V305614 00148000
  237. SPACE 1 00149000
  238. LOADSYS L R10,ASYSNAMS POINT TO SAVEDSYS NAME TABLE @V305614 00150000
  239. USING SYSNAMES,R10 SYSNAMES ADDRESSABILITY @V305614 00151000
  240. LA R8,CMSSEG PULL OUT CMSSEG NAME @V305614 00152000
  241. DROP R10 ..... @V305614 00153000
  242. SR R9,R9 INDICATE LOADSYS FUNCTION @V305614 00154000
  243. DC X'83890064' LOADSYS @V305614 00155000
  244. BC 3,NOSYS BR, MIX UP SOMEWHERE @V305614 00156000
  245. SPACE 1 00157000
  246. ST R8,ACMSSEG PLUG NUCLEUS SEGMENT ADDRESS @V305614 00158000
  247. OI DCSSFLAG,DCSSLDED LET EVERYONE KNOW @V305614 00159000
  248. SKIPLOAD L R8,4(,R8) LOAD EXECTOR ENTRY ADR @V305614 00160000
  249. L R8,0(,R8) ONE EXTRA LOAD NEEDED ... @VM03154 00161000
  250. ST R8,EXADD AND SAVE ADDRESS OF DMSEXT @VM03154 00162000
  251. EXECIN OI EXECFLAG,EXECRUN INDICATE THAT EXEC LIVES @V305614 00163000
  252. NI MISFLAGS,X'FF'-NEGITS VERDICT: INNOCENT @VA04594 00164000
  253. GETBASE ST R3,EXLEVEL STORE NEW LEVEL, 00165000
  254. LR R1,R2 RESTORE POINTER TO P-LIST IN R1, 00166000
  255. L R15,EXADD GET ADDRESS OF EXECTOR, 00167000
  256. BALR R14,R15 CALL "EXECTOR" WHO REALLY DOES THE WORK 00168000
  257. NI MISFLAGS,X'FF'-NEGITS RESET NEGITS @VA06277 00169000
  258. L R13,AEXEC RESTORE ADDRESSIBILITY 00170000
  259. L R7,AOPSECT RELOAD A(IO INFORMATION) 00171000
  260. LM R3,R4,EXLEVEL DECREMENT EXEC NEST LEVEL @V305614 00172000
  261. SR R3,R4 LEVEL 00173000
  262. ST R3,EXLEVEL AND STORE NEW VALUE. 00174000
  263. BNZ OUT IF NOT ZERO, KEEP EXECTOR IN CORE 00175000
  264. LR R12,R15 SAVE THE RETURN CODE @VA04594 00176000
  265. NOFILE EQU * 00177000
  266. LM R0,R1,EXNUM RETURN FREE STORAGE 00178000
  267. LTR R0,R0 SHARED SYSTEM ? @V305614 00179000
  268. BM NOFILE1 YES, NO STORAGE TO FREE @V305614 00180000
  269. DMSFRET DWORDS=(0),LOC=(1),TYPCALL=BALR @VM03083 00181000
  270. NOFILE1 EQU * 00182000
  271. L R1,EXADD+4 GET POINTER TO GLOBAL FREE STOR @V305614 00183000
  272. LA R0,7 NUMBER OF DWORDS @V305614 00184000
  273. DMSFRET DWORDS=(0),LOC=(1),TYPCALL=BALR @VM03083 00185000
  274. NI EXECFLAG,255-EXECRUN TURN OFF EXECRUN FLAG 00186000
  275. SETRET LR R15,R12 PUT RETURN CODE INTO R15 @V305614 00187000
  276. * 00188000
  277. OUT LR R14,R5 RESTORE RETURN-REGISTER (WAS SAFE IN R5) 00189000
  278. BR R14 RETURN TO CALLER 00190000
  279. * 00191000
  280. FFD DC H'-3' ERROR RETURN CODE @V305614 00192000
  281. SMODE DC CL2'S ' FOR 'S' DISK STATE @V305614 00193000
  282. E2 EQU X'E2' @V305066 00194000
  283. FENCE EQU X'FF' PLIST FENCETESTER @VM03113 00195000
  284. TWENTY4 EQU 24 ERROR RETURN CODE @VM03113 00196000
  285. * 00197000
  286. DS 0F LIVE P-LIST FOR STATE = DUMMY FOR RDBUF & FINIS: 00198000
  287. STATE DC CL8'RDBUF' (NOTE - OK FOR ALL 3 - NO FOOLIN') 00199000
  288. DC CL8'DMSEXT' 00200000
  289. DC CL8'MODULE' 00201000
  290. STATEFM DC CL2'-S' ALL BUT 'S' DISK (TEMPORARY) @V305614 00202000
  291. DC H'0002' ITEM 2 = CORE-IMAGE (FOR RDBUF) 00203000
  292. DC A(0) END OF STATE PART OF P-LIST 00204000
  293. DC F'0' WILL BECOME NO. OF BYTES TO READ 00205000
  294. DC CL2'V' VARIABLE FILE (MODULE) 00206000
  295. DC H'1' READ ONE RECORD (ITEM NO. 2) 00207000
  296. * 00208000
  297. SIZDUM EQU *-STATE SIZE DUMMY P-LIST IN BYTES (FOR MVC) 00209000
  298. * 00210000
  299. SPACE 3 00211000
  300. * ABEND RECOVER ENTRY POINT 00212000
  301. ENTRY DMSEXCAB 00213000
  302. DMSEXCAB EQU * 00214000
  303. L R13,AEXEC SET BASE REGISTER 00215000
  304. LR R5,R14 SAVE RETURN REGISTER 00216000
  305. L R6,AFVS POINT TO FVSECT 00217000
  306. L R7,AOPSECT POINT TO OPSECT 00218000
  307. SR R12,R12 ZERO RETURN CODE FROM HERE @V305614 00219000
  308. ST R12,EXLEVEL SET ZERO EXEC LEVEL @V305614 00220000
  309. TM EXECFLAG,EXECRUN IS EXECTOR IN CORE? 00221000
  310. BO NOFILE GO RELEASE IT IF SO 00222000
  311. B SETRET OTHERWISE, JUST RETURN @V305614 00223000
  312. SPACE 2 00224000
  313. ERR001 EQU * @VM03113 00225000
  314. DMSERR NUM=001,LET=E,CSECT=EXC,TEXT='NO FILENAME SPECIFIED' 00226000
  315. LA R15,TWENTY4 SET BAD RETURN CODE @VM03113 00227000
  316. B OUT @VM03113 00228000
  317. LTORG 00229000
  318. EJECT 00230000
  319. SPACE 1 HRC371DS 00230100
  320. WORK DSECT HRC371DS 00230200
  321. BUFFER0 DS CL256 HRC371DS 00230300
  322. BUFFER1 DS CL256 HRC371DS 00230400
  323. EPLIST DS 4A HRC371DS 00230500
  324. FSCBD HRC371DS 00230600
  325. FSTD , @V305614 00231000
  326. ADT , @V305614 00232000
  327. IO 00233000
  328. NUCON 00234000
  329. SYSNAMES 00235000
  330. * 00236000
  331. REGEQU 00237000
  332. END 00238000