User Tools

Site Tools


ibm:vm370-lib:macro:wrterm.macro_src

WRTERM Source

References

Source Listing

WRTERM.MACRO.txt
  1. MACRO 00001000
  2. &LABEL WRTERM &UMSG,&ULEN,&EDIT=YES,&COLOR=B 00002000
  3. LCLA &PNT,&CNT,&END 00003000
  4. LCLC &FLG,&CLR,&LEN,&MSG 00004000
  5. LCLB &MR,&LR,&MSD 00005000
  6. .**** 00006000
  7. .** LCLA'S USED TO COMPUTE LENGTH OF SELF-DEFINING MESSAGE 00007000
  8. .** LCLC'S USED TO ASSEMBLE PLIST VALUES 00008000
  9. .** LCLB'S CONTAIN CODE-GENERATION FLAGS 00009000
  10. .**** 00010000
  11. .** MAKE SURE A MESSAGE OF SOME TYPE WAS GIVEN, AND NOTE 00011000
  12. .** IF IT'S SELF-DEFINING OR GIVEN AS A REGISTER 00012000
  13. .**** 00013000
  14. AIF (T'&UMSG NE 'O').UMSGOK 00014000
  15. MNOTE 8,'LINE ADDRESS NOT SPECIFIED' 00015000
  16. MEXIT 00016000
  17. .* 00017000
  18. .UMSGOK AIF ('&UMSG'(1,1) NE '''').UMSGR 00018000
  19. &MSD SETB 1 NOTE SELF-DEFINING MSG 00019000
  20. &MSG SETC 'DMS&SYSNDX.D' ASSEMBLE MSG-ADDRESS 00020000
  21. AGO .UMSGZ 00021000
  22. .* 00022000
  23. .UMSGR AIF ('&UMSG'(1,1) NE '(').UMSGA 00023000
  24. &MR SETB 1 NOTE MSG REGISTER-ADDRESSED 00024000
  25. &MSG SETC '&UMSG(1)' DUMMY ASSEMBLE-VALUE 00025000
  26. AGO .UMSGZ 00026000
  27. .* 00027000
  28. .UMSGA ANOP 00028000
  29. &MSG SETC '&UMSG' MESSAGE SYMBOLIC NAME 00029000
  30. .UMSGZ ANOP 00030000
  31. .**** 00031000
  32. .** GET THE VALUE OF THE MESSAGE LENGTH. COMPUTE IT, IF IT 00032000
  33. .** WASN'T GIVEN OR IF THE MESSAGE IS SELF-DEFINING. 00033000
  34. .**** 00034000
  35. AIF (T'&ULEN EQ 'O').ULENO 00035000
  36. AIF ('&ULEN'(1,1) EQ '(').ULENR 00036000
  37. &LEN SETC '&ULEN' SELF-DEFINING LENGTH 00037000
  38. AGO .ULENZ 00038000
  39. .* 00039000
  40. .ULENR ANOP 00040000
  41. &LR SETB 1 NOTE LENGTH IN REGISTER 00041000
  42. &LEN SETC '01' INSURE &LEN HAS VALUE 00041500
  43. AGO .COMPL 00042000
  44. .* 00043000
  45. .ULENO AIF (&MSD).COMPL 00044000
  46. MNOTE 8,'LENGTH PARAMETER NOT SPECIFIED' 00045000
  47. MEXIT 00046000
  48. .* 00047000
  49. .COMPL ANOP PREPARE TO COMPUTE MSG-LENGTH 00048000
  50. AIF (NOT &MSD).ULENZ BRANCH IF NOT SELF-DEFINING 00048500
  51. &PNT SETA 2 FIRST-CHARACTER INDEX 00049000
  52. &END SETA K'&UMSG-2 LAST CHARACTER INDEX 00050000
  53. AIF (&END GT 0).COMPGO 00051000
  54. MNOTE 8,'INVALID LINE SPECIFICATION' 00052000
  55. MEXIT 00053000
  56. .* 00054000
  57. .COMPGO AIF (&PNT GT &END).COMPZ 00055000
  58. AIF ('&UMSG'(&PNT,2) EQ '''''').QUOTE 00056000
  59. &PNT SETA &PNT+1 00057000
  60. AGO .COMPGO 00058000
  61. .QUOTE ANOP 00059000
  62. &CNT SETA &CNT+1 00060000
  63. &PNT SETA &PNT+2 00061000
  64. AGO .COMPGO 00062000
  65. .COMPZ ANOP 00063000
  66. &CNT SETA K'&UMSG-&CNT-2 00064000
  67. &LEN SETC '&CNT' ASSEMBLE LENGTH-VALUE 00065000
  68. .* 00066000
  69. .ULENZ ANOP 00067000
  70. .**** 00068000
  71. .** EXAMINE THE EDIT PARAMETER, TRANSLATE IT TO 00069000
  72. .** FLAG BITS FOR 'DMSCWR' TO USE. 00070000
  73. .**** 00071000
  74. &FLG SETC '00' 00072000
  75. AIF ('&EDIT' EQ 'YES').UEDITZ 00073000
  76. &FLG SETC '80' 00074000
  77. AIF ('&EDIT' EQ 'NO').UEDITZ 00075000
  78. &FLG SETC '90' 00076000
  79. AIF ('&EDIT' EQ 'LONG').UEDITZ 00077000
  80. MNOTE 4,'INVALID EDIT SPECIFICATION - YES ASSUMED' 00078000
  81. &FLG SETC '00' 00079000
  82. .UEDITZ ANOP 00080000
  83. .**** 00081000
  84. .** EXAMINE THE COLOR PARAMETER FOR 'B' OR 'R' 00082000
  85. .**** 00083000
  86. &CLR SETC 'B' 00084000
  87. AIF ('&COLOR' EQ 'B').UCLRZ 00085000
  88. AIF ('&FLG' EQ '90').UCLRERR 00086000
  89. AIF ('&COLOR' NE 'R').UCLRERR 00087000
  90. &CLR SETC 'R' 00088000
  91. AGO .UCLRZ 00089000
  92. .UCLRERR MNOTE 4,'INVALID COLOR SPECIFICATION - B ASSUMED' 00090000
  93. .UCLRZ ANOP 00091000
  94. .**** 00092000
  95. .** ALIGN TO A WORD, GENERATE LABEL 00093000
  96. .**** 00094000
  97. CNOP 0,4 00095000
  98. &LABEL DS 0H 00096000
  99. .**** 00097000
  100. .** GENERATE ADDRESS-STORE, IF NEEDED. 00098000
  101. .**** 00099000
  102. AIF (NOT &MR).CONT5 00100000
  103. ST &MSG,DMS&SYSNDX.B STORE MESSAGE-ADDRESS 00101000
  104. MVI DMS&SYSNDX.B,X'01' RESTORE FLAG 00102000
  105. .CONT5 ANOP 00103000
  106. .**** 00104000
  107. .** GENERATE LENGTH-STORE, IF NEEDED 00105000
  108. .**** 00106000
  109. AIF (NOT &LR).CONT6 00107000
  110. STH &ULEN(1),DMS&SYSNDX.C+2 STORE LENGTH IN PLIST 00108000
  111. .CONT6 ANOP 00109000
  112. .**** 00110000
  113. .** GENERATE PLIST, BAL ON R1 AROUND IT 00111000
  114. .**** 00112000
  115. BAL 1,DMS&SYSNDX.E POINT R1 TO PLIST 00113000
  116. DMS&SYSNDX.A DC CL8'TYPLIN' 00114000
  117. DMS&SYSNDX.B DC X'01',AL3(&MSG) 00115000
  118. DMS&SYSNDX.C DC C'&CLR',X'&FLG',AL2(&LEN) 00116000
  119. .**** 00117000
  120. .** GENERATE MESSAGE TEXT, IF SELF-DEFINING 00118000
  121. .**** 00119000
  122. AIF (NOT &MSD).CONTZ 00120000
  123. DMS&SYSNDX.D DC CL&LEN&UMSG 00121000
  124. .CONTZ ANOP 00122000
  125. .**** 00123000
  126. .** GENERATE SVC, ALIGNED ON HALFWORD 00124000
  127. .**** 00125000
  128. DMS&SYSNDX.E DS 0H 00126000
  129. SVC 202 CALL CMS TO TYPE 00127000
  130. DC AL4(*+4) 00128000
  131. MEXIT 00129000
  132. MEND 00130000
ibm/vm370-lib/macro/wrterm.macro_src.txt ยท Last modified: 2023/08/06 13:38 by Site Administrator