User Tools

Site Tools


ibm:vm370-lib:cms:dmsinm.assemble_src

DMSINM Source

References

Source Listing

DMSINM.ASSEMBLE.txt
  1. INM TITLE 'DMSINM (CMS) VM/370 - RELEASE 6' 00001000
  2. SPACE 2 00002000
  3. *. P8024 00005000
  4. * P8024 00006000
  5. * MODULE NAME - DMSINM P8024 00007000
  6. * P8024 00008000
  7. * FUNCTION - OBTAIN THE TIME FROM THE CP TIMER P8024 00009000
  8. * P8024 00010000
  9. * ATTRIBUTES - NUCLEUS RESIDENT, REENTRANT P8024 00011000
  10. * P8024 00012000
  11. * ENTRY POINTS - DMSINM, GETCLK,CMSTIMER P8024 00013000
  12. * P8024 00014000
  13. * ENTRY CONDITIONS P8024 00015000
  14. * REGISTER 15 - ADDRESS OF MODULE FOR ADDRESSABILITY P8024 00016000
  15. * REGISTER 1 - POINTS TO PLIST P8024 00017000
  16. * PLIST FORM P8024 00018000
  17. * DS 0F P8024 00019000
  18. * DC CL8'CMSTIME' P8024 00020000
  19. * DC F' ' PREVIOUS VALUE OF VIRUAL TIME P8024 00021000
  20. * DC F' ' PREVIOUS VALUE OF TOTAL TIME P8024 00022000
  21. * DC A(BUFFER) CALLER'S 26 BYTE BUFFER P8024 00023000
  22. * DS F LENGTH OF BUFFER USED BY DMSINM P8024 00024000
  23. * P8024 00025000
  24. * THE LAST 2 ENTRIES IN THE PLIST ARE OPTIONAL, AND P8024 00026000
  25. * NEITHER OF THEM IS USED IF THE GIVEN BUFFER P8024 00027000
  26. * ADDRESS IS ZERO, OR IF THE FIRST BYTE OF THE P8024 00028000
  27. * ADDRESS CONTAINS A FENCE (X'FF'). P8024 00029000
  28. * P8024 00030000
  29. * P8024 00031000
  30. * EXIT CONDITIONS P8024 00032000
  31. * REGISTER 15 IS SET TO ZERO P8024 00033000
  32. * WHEN RUNNING UNDER CP, THE VALUES OF VIRTUAL P8024 00034000
  33. * TIME AND TOTAL TIME ARE REPLACED BY THE NEW P8024 00035000
  34. * VALUES; THE BUFFER, IF GIVEN, IS FILLED WITH P8024 00036000
  35. * TIME DATA IN THE FORM: P8024 00037000
  36. * P8024 00038000
  37. * X.XX/Y.YY HH.MM.SS P8024 00039000
  38. * P8024 00040000
  39. * WHERE P8024 00041000
  40. * P8024 00042000
  41. * X.XX IS THE DIFFERENCE BETWEEN THE PRESENT VIRTUAL P8024 00043000
  42. * CPU TIME AND THE OLD VALUE, IN SECONDS. P8024 00044000
  43. * P8024 00045000
  44. * Y.YY IS THE DIFFERENCE BETWEEN THE PRESENT TOTAL P8024 00046000
  45. * CPU TIME AND THE OLD VALUE, IN SECONDS. P8024 00047000
  46. * P8024 00048000
  47. * H.MM.SS IS THE TIME-OF-DAY P8024 00049000
  48. * P8024 00050000
  49. * CALLS TO OTHER ROUTINES P8024 00051000
  50. * NONE P8024 00052000
  51. * P8024 00053000
  52. * EXTERNAL REFERENCES P8024 00054000
  53. * NUCON P8024 00055000
  54. * P8024 00056000
  55. * TABLES/WORKAREAS P8024 00057000
  56. * NONE P8024 00058000
  57. * P8024 00059000
  58. * REGISTER USAGE P8024 00060000
  59. * REG15 - BASE P8024 00061000
  60. * REG2-9 - WORK REGISTERS P8024 00062000
  61. * REG10-13 - NOT USED P8024 00063000
  62. * REG14 - RETURN REGISTER P8024 00064000
  63. * P8024 00065000
  64. * OPERATION P8024 00066000
  65. * P8024 00067000
  66. * IF THE CALLER HAS SUPPLIED A BUFFER IT IS CLEARED. THEN THE P8024 00068000
  67. * CP CLOCK IS READ. IF A BUFFER IS PROVIDED THE ELAPSED P8024 00069000
  68. * VIRTUAL AND TOTAL ELAPSED CPU TIMES ARE EDITED AND P8024 00070000
  69. * MOVED INTO THE BUFFER FOLLOWED BY THE TIME-OF-DAY. THE P8024 00071000
  70. * NUMBER OF BYTES OF BUFFER USED IS STORED INTO THE CALLER'S P8024 00072000
  71. * PLIST. THEN THE CURRENT VIRTUAL CPU AND TOTAL CPU TIMES P8024 00073000
  72. * ARE SET INTO THE PLIST. REGISTER 15 IS SET TO ZERO P8024 00074000
  73. * AND A RETURN IS MADE TO THE CALLER. IF NO BUFFER IS P8024 00075000
  74. * PROVIDED, THE VIRTUAL CPU AND TOTAL CPU FIELDS IN P8024 00076000
  75. * THE PLIST ARE FILLED WITH THE CURRENT ELAPSED TIMES, REGISTER P8024 00077000
  76. * 15 IS SET TO ZERO AND A RETURN IS MADE TO THE CALLER. P8024 00078000
  77. * P8024 00079000
  78. *. P8024 00080000
  79. * P8024 00081000
  80. EJECT 00082000
  81. CMSTIMER START 00083000
  82. ENTRY GETCLK,DMSINM P3031 00084000
  83. DMSINM EQU * P3031 00085000
  84. GETCLK EQU * NOW THE SAME THING AS 'CMSTIME' 00086000
  85. SPACE 00087000
  86. USING NUCON,R0 00088000
  87. USING CMSTIMER,R15 00089000
  88. USING SUBSECT,R10 P8024 00090000
  89. STM R1,R10,BALRSAVE SAVE REGS IN NUCON P8024 00091000
  90. L R10,ASUBSECT ADDRESS OF WORK AREA P8024 00092000
  91. L R5,16(,R1) ADDRESS OF CALLER'S BUFFER 00093000
  92. LTR R5,R5 IS THERE ONE? 00094000
  93. BNP NOCLEAR BRANCH IF NOT 00095000
  94. MVI 0(R5),C' ' CLEAR IT... 00096000
  95. MVC 1(25,R5),0(R5) ALL THE WAY WITH BLANKS. 00097000
  96. SPACE 00098000
  97. NOCLEAR LA R1,TIMBUF PREPARE TO READ CP CLOCK P8024 00099000
  98. DC X'8310000C' 'DIAGNOSE' TO READ CLOCK P8024 00100000
  99. LTR R5,R5 DID CALLER GIVE US A BUFFER? 00101000
  100. BNP CPRET BRANCH IF NOT 00102000
  101. L R2,CPDIV DIVIDER FOR RUNNING UNDER CP 00103000
  102. L R3,TIMBUF+20 PICK UP PRESENT VAL OF VIRCPU P8024 00104000
  103. L R1,BALRSAVE RESTORE POINTER P8024 00105000
  104. S R3,8(,R1) AND SUBTRACT OLD VALUE GIVEN BY CALLER 00106000
  105. BAL R4,EDITSUB LAY OUT THE ANSWER IN BUFFER 00107000
  106. MVI 0(R5),C'/' MOVE IN A SLASH 00108000
  107. L R2,CPDIV SET THE DIVIDER AGAIN 00109000
  108. LA R5,1(,R5) AND INCREMENT BUFFER POINTER 00110000
  109. L R3,TIMBUF+28 GET PRESENT VAL OF TOTCPU P8024 00111000
  110. S R3,12(,R1) AND SUBTRACT OLD VALUE SUPPLIED BY CALLER 00112000
  111. BAL R4,EDITSUB LAY OUT THE ANSWER IN BUFFER 00113000
  112. MVC 1(8,R5),TIMBUF+8 SET CURRENT TIME-OF-DAY V0040 00114100
  113. LA R5,9(,R5) AND ADJUST BUFFER POINTER 00115000
  114. S R5,16(,R1) OCCUPIED LENGTH OF CALLER'S BUFFER 00116000
  115. ST R5,20(,R1) STORE IN CALLER'S PLIST 00117000
  116. SPACE 00118000
  117. CPRET EQU * FINISH UP AND RETURN 00119000
  118. MVC CURRDATE(16),TIMBUF MOVE DATE & TIME P8024 00120000
  119. MVC CURRVIRT(4),TIMBUF+20 MOVE CURR ELAPSED VIRT P8024 00121000
  120. MVC CURRCPUT(4),TIMBUF+28 MOVE CURR ELAPSED CPU P8024 00122000
  121. L R1,BALRSAVE POINT TO BUFFER P8024 00123000
  122. MVC 8(8,R1),CURRVIRT UPDATE TIMES IN CALLER'S PLIST 00124000
  123. LM R1,R10,BALRSAVE RESTORE REGS P8024 00125000
  124. SR R15,R15 CLEAR RETURN CODE (FOR CP) 00126000
  125. BR R14 RETURN 00127000
  126. EJECT 00128000
  127. * 00129000
  128. ************** 00130000
  129. * 00131000
  130. * SUBROUTINE TO LAY OUT VIRCPU AND TOTCPU IN CALLER'S BUFFER 00132000
  131. * 00133000
  132. ************** 00134000
  133. SPACE 00135000
  134. USING CMSTIMER,R15 00136000
  135. EDITSUB EQU * 00137000
  136. MVC 5(4,R5),=CL4'*.**' MOVE IN STARS IN CASE... 00138000
  137. LTR R3,R3 WE DO NOT HAVE A VALID TIME. 00139000
  138. BL EDSHIFT BRANCH IF THAT IS IN FACT THE CASE 00140000
  139. LR R8,R2 LOAD DIVIDER P8024 00141000
  140. SR R2,R2 CLEAR P8024 00142000
  141. DR R2,R8 DIVIDE P8024 00143000
  142. SRL R8,1(0) GENERATE THE ROUNDER LIMIT P8024 00144000
  143. LTR R3,R3 IS RESULT ZERO P8024 00145000
  144. BZ EDITSUB1 IF SO MAKE IT ONE P8024 00146000
  145. CLR R2,R8 IS REMAINER LESS THAN HALF P8024 00147000
  146. BL EDITSUB2 IF NOT DON'T ROUND UP P8024 00148000
  147. EDITSUB1 LA R3,1(R3) ROUND UP P8024 00149000
  148. EDITSUB2 EQU * P8024 00150000
  149. CVD R3,BALRSAVE+40 CONVERT TO PACKED DECIMAL P8024 00151000
  150. MVC 0(9,R5),MASK MOVE EDIT MASK INTO CALLER'S BUFFER 00152000
  151. ED 0(9,R5),BALRSAVE+44 EDIT DATA P8024 00153000
  152. EDSHIFT EQU * SHIFT THE RESULT TO THE LEFT 00154000
  153. LA R3,4(,R5) ADDRESS OF LAST POSSIBLE LEADING BLANK 00155000
  154. CLI 0(R3),C' ' IS IT A BLANK? 00156000
  155. BE *+8 SKIP IF SO 00157000
  156. BCT R3,*-8 DECREMENT POINTER AND LOOP BACK 00158000
  157. MVC 0(9,R5),1(R3) MOVE THE ANSWER OVER TO THE RIGHT PLACE 00159000
  158. SR R3,R5 NO. OF LEADING BLANKS WE HAD - 1 00160000
  159. LA R5,8(,R5) ADDRESS OF NEXT FREE BYTE... 00161000
  160. SR R5,R3 WITH CORRECTION FOR LEADING BLANKS 00162000
  161. BR R4 RETURN 00163000
  162. EJECT 00164000
  163. ************** 00165000
  164. * 00166000
  165. * EQUS AND READ-ONLY STORAGE 00167000
  166. * 00168000
  167. ************** 00169000
  168. SPACE 00170000
  169. SPACE 00171000
  170. CPDIV DC F'10000' DIVIDER FOR CP (CONVT TO HUNDREDTHS) P8024 00173000
  171. MASK DC X'4020202021204B2020' MASK FOR EDITING JOB 00174000
  172. SPACE 00175000
  173. * 00176000
  174. LTORG 00177000
  175. SPACE 2 00178000
  176. * 00179000
  177. ************** 00180000
  178. * 00181000
  179. * WRITABLE DATA 00182000
  180. * 00183000
  181. ************** 00184000
  182. SPACE 00185000
  183. EJECT 00186000
  184. NUCON 00187000
  185. SUBSECT P8024 00188000
  186. SPACE 2 00189000
  187. REGEQU 00190000
  188. SPACE 2 00191000
  189. END 00192000
ibm/vm370-lib/cms/dmsinm.assemble_src.txt ยท Last modified: 2023/08/06 13:35 by Site Administrator