Table of Contents

DMMTRN Source

References

Source Listing

DMMTRN.ASSEMBLE.txt
  1. TRN TITLE 'DMMTRN (IPCS) VM/370 - RELEASE 6' 00001000
  2. * 00002000
  3. * MODULE NAME: DMMTRN 00003000
  4. * 00004000
  5. * 00005000
  6. * FUNCTION: TRANSLATE BINARY DATA TO PRINTABLE FORMAT 00006000
  7. * 00007000
  8. * 00008000
  9. * ATTRIBUTES: REUSABLE 00009000
  10. * NON-REENTRANT 00010000
  11. * 00011000
  12. * 00012000
  13. * ENTRY POINTS: DMMTRN 00013000
  14. * 00014000
  15. * 00015000
  16. * ENTRY CONDITIONS: COMMON CONSTANT AREA TRNPARM AND TRNPARM1 00016000
  17. * HAVE DATA LENGTH AND DATA ADDRESS RESPECTIVELY 00017000
  18. * 00018000
  19. * 00019000
  20. * EXIT CONDITIONS: R1 POINTS TO TRANSLATED DATA 00020000
  21. * 00021000
  22. * 00022000
  23. * CALLS TO OTHER ROUTINES: NONE 00023000
  24. * 00024000
  25. * 00025000
  26. * EXTERNAL REFERENCES: EXCONST (COMMON CONSTANT AREA) 00026000
  27. * 00027000
  28. * 00028000
  29. * TABLES/WORKAREAS: 00029000
  30. * 00030000
  31. * 00031000
  32. * REGISTER USAGE: R15 BASE 00032000
  33. * R14 RETURN 00033000
  34. * R13 CALLER'S SAVEAREA 00034000
  35. * R6 SHARECON DSECT USAGE 00035000
  36. * R2-R5 WORK 00036000
  37. * R1 ADDRESS RETURN 00037000
  38. * 00038000
  39. * 00039000
  40. * NOTES: A 200 BYTE PATCH AREA EXISTS AT LABEL 'PATCH' 00040000
  41. * 00041000
  42. * 00042000
  43. * OPERATION: DATA IS OPERATED ON 1 BYTE AT A TIME PRODUCING 00043000
  44. * 2 OUTPUT BYTES PER 1 INPUT BYTE (2 HEX DIGITS PER BYTE). 00044000
  45. * THE TOTAL OUTPUT RESULT IS THEN TRANSLATED TO EBCDIC. 00045000
  46. * 00046000
  47. * 00047000
  48. * ERROR MESSAGES: NONE 00048000
  49. * 00049000
  50. * 00050000
  51. DMMTRN CSECT @VA04250 00051000
  52. USING DMMTRN,R15 TEMPORARY ADDRESSABILITY @VA04250 00052000
  53. B START BRANCH AROUND EYECATCHER @VA04250 00053000
  54. DS 0D @VA04250 00054000
  55. MODNAME DC C'DMMTRN ' MODULE NAME @VA04250 00055000
  56. RELLEV DC C'REL4LEV0' RELEASE AND LEVEL @V4075A1 00056000
  57. START STM R2,R12,28(R13) SAVE REGISTERS @VA04250 00057000
  58. *************************************************************** 00058000
  59. * SET UP 00059000
  60. *************************************************************** 00060000
  61. L R6,VEXCON ADDRESSABILITY FOR CONSTANTS @VA04250 00061000
  62. USING SHARECON,R6 ESTABLISH ADDRESSABILITY @VA04250 00062000
  63. XC OUTPUT,OUTPUT SET OUTPUT TO BINARY ZERO @VA04250 00063000
  64. SR R2,R2 CLEAR WORK FOR IC @VA04250 00064000
  65. L R5,TRNPARM LENGTH OF DATA TO BE TRANSLATED @VA04250 00065000
  66. LA R5,0(R5) ZERO HI-ORDER BIT @VA05445 00065100
  67. L R4,TRNPARM1 GET DATA POINTER @VA04250 00066000
  68. C R5,MAX64 VALID DATA LENGTH? @VA04250 00067000
  69. BNH CONTINUE YES @VA04250 00068000
  70. L R5,MAX64 NO, USE MAX ALLOWED (64) @VA04250 00069000
  71. CONTINUE LTR R5,R5 ANY DATA AT ALL TO BE TRANSLATED?@VA04250 00070000
  72. BNZ CONT2 YES @VA04250 00071000
  73. L R5,MAX64 TRANSLATE 64 ANYWAY JUST IN CASE @VA04250 00072000
  74. CONT2 LA R3,OUTPUT POINT TO OUTPUT AREA @VA04250 00073000
  75. LOOP IC R2,0(R4) NEXT INPUT BYTE @VA04250 00074000
  76. SRL R2,4 ISOLATE 1ST 4 BITS (1 HEX DIGIT) @VA04250 00075000
  77. STC R2,0(R3) PUT IT IN OUTPUT @VA04250 00076000
  78. MVN ONE(ONE,R3),0(R4) MOVE 2ND 4 BITS TO NEXT BYTE @VA04250 00077000
  79. LA R3,TWO(R3) UP OUTPUT POINTER 2 BYTES @VA04250 00078000
  80. LA R4,ONE(R4) UP INPUT POINTER 1 BYTE @VA04250 00079000
  81. BCT R5,LOOP SET UP ALL OUTPUT @VA04250 00080000
  82. *************************************************************** 00081000
  83. * THE OUTPUT AREA NOW HAS ALL THE INPUT DATA. 00082000
  84. * E.G. X'1234' ON INPUT NOW IS X'01020304' IN THE OUTPUT AREA 00083000
  85. * WE NEED TO TRANSLATE THIS TO X'F1F2F3F4' AND WE ARE DONE. 00084000
  86. *************************************************************** 00085000
  87. L R5,TRNPARM GET LENGTH OF DATA AGAIN @VA04250 00086000
  88. SLL R5,1 MULTIPLY BY 2 (2 HEX DIGITS/BYTE)@VA04250 00087000
  89. BCTR R5,0 SET UP FOR EXECUTE INSTRUCTION @VA04250 00088000
  90. EX R5,TRNSLATE TRANSLATE THE DATA TO EBCDIC @VA04250 00089000
  91. LA R1,OUTPUT RETURN RESULTS TO CALLER @VA04250 00090000
  92. LM R2,R12,28(R13) RESTORE CALLER'S REGS @VA04250 00091000
  93. SR R15,R15 RETURN CODE ZERO @VA04250 00092000
  94. BR R14 RETURN TO CALLER @VA04250 00093000
  95. TRNSLATE TR OUTPUT(0),TRTABLE EXECUTED TRANSLATE INSTRUCTION@VA04250 00094000
  96. *************************************************************** 00095000
  97. * CONSTANTS SAVEAREAS AND EQUATES 00096000
  98. *************************************************************** 00097000
  99. MAX64 DC F'64' MAX. ALLOWED TRANSLATION REQUEST @VA04250 00098000
  100. VEXCON DC V(SHARECON) ADDRESS OF SHARED CONSTANT AREA @VA04250 00099000
  101. OUTPUT DS CL128 OUTPUT AREA FOR TRANSLATED DATA @VA04250 00100000
  102. TRTABLE DC C'0123456789ABCDEF' TRANSLATE TABLE @VA04250 00101000
  103. PATCH DC 50F'0' PATCH AREA @VA04250 00102000
  104. ONE EQU 1 FOR LOAD ADDRESS ETC. @VA04250 00103000
  105. TWO EQU 2 FOR LOAD ADDRESS ETC. @VA04250 00104000
  106. LTORG @VA04250 00105000
  107. COPY EXCONST @VA04250 00106000
  108. REGEQU @VA04250 00107000
  109. END 00108000