TRN TITLE 'DMMTRN (IPCS) VM/370 - RELEASE 6' 00001000
* 00002000
* MODULE NAME: DMMTRN 00003000
* 00004000
* 00005000
* FUNCTION: TRANSLATE BINARY DATA TO PRINTABLE FORMAT 00006000
* 00007000
* 00008000
* ATTRIBUTES: REUSABLE 00009000
* NON-REENTRANT 00010000
* 00011000
* 00012000
* ENTRY POINTS: DMMTRN 00013000
* 00014000
* 00015000
* ENTRY CONDITIONS: COMMON CONSTANT AREA TRNPARM AND TRNPARM1 00016000
* HAVE DATA LENGTH AND DATA ADDRESS RESPECTIVELY 00017000
* 00018000
* 00019000
* EXIT CONDITIONS: R1 POINTS TO TRANSLATED DATA 00020000
* 00021000
* 00022000
* CALLS TO OTHER ROUTINES: NONE 00023000
* 00024000
* 00025000
* EXTERNAL REFERENCES: EXCONST (COMMON CONSTANT AREA) 00026000
* 00027000
* 00028000
* TABLES/WORKAREAS: 00029000
* 00030000
* 00031000
* REGISTER USAGE: R15 BASE 00032000
* R14 RETURN 00033000
* R13 CALLER'S SAVEAREA 00034000
* R6 SHARECON DSECT USAGE 00035000
* R2-R5 WORK 00036000
* R1 ADDRESS RETURN 00037000
* 00038000
* 00039000
* NOTES: A 200 BYTE PATCH AREA EXISTS AT LABEL 'PATCH' 00040000
* 00041000
* 00042000
* OPERATION: DATA IS OPERATED ON 1 BYTE AT A TIME PRODUCING 00043000
* 2 OUTPUT BYTES PER 1 INPUT BYTE (2 HEX DIGITS PER BYTE). 00044000
* THE TOTAL OUTPUT RESULT IS THEN TRANSLATED TO EBCDIC. 00045000
* 00046000
* 00047000
* ERROR MESSAGES: NONE 00048000
* 00049000
* 00050000
DMMTRN CSECT @VA04250 00051000
USING DMMTRN,R15 TEMPORARY ADDRESSABILITY @VA04250 00052000
B START BRANCH AROUND EYECATCHER @VA04250 00053000
DS 0D @VA04250 00054000
MODNAME DC C'DMMTRN ' MODULE NAME @VA04250 00055000
RELLEV DC C'REL4LEV0' RELEASE AND LEVEL @V4075A1 00056000
START STM R2,R12,28(R13) SAVE REGISTERS @VA04250 00057000
*************************************************************** 00058000
* SET UP 00059000
*************************************************************** 00060000
L R6,VEXCON ADDRESSABILITY FOR CONSTANTS @VA04250 00061000
USING SHARECON,R6 ESTABLISH ADDRESSABILITY @VA04250 00062000
XC OUTPUT,OUTPUT SET OUTPUT TO BINARY ZERO @VA04250 00063000
SR R2,R2 CLEAR WORK FOR IC @VA04250 00064000
L R5,TRNPARM LENGTH OF DATA TO BE TRANSLATED @VA04250 00065000
LA R5,0(R5) ZERO HI-ORDER BIT @VA05445 00065100
L R4,TRNPARM1 GET DATA POINTER @VA04250 00066000
C R5,MAX64 VALID DATA LENGTH? @VA04250 00067000
BNH CONTINUE YES @VA04250 00068000
L R5,MAX64 NO, USE MAX ALLOWED (64) @VA04250 00069000
CONTINUE LTR R5,R5 ANY DATA AT ALL TO BE TRANSLATED?@VA04250 00070000
BNZ CONT2 YES @VA04250 00071000
L R5,MAX64 TRANSLATE 64 ANYWAY JUST IN CASE @VA04250 00072000
CONT2 LA R3,OUTPUT POINT TO OUTPUT AREA @VA04250 00073000
LOOP IC R2,0(R4) NEXT INPUT BYTE @VA04250 00074000
SRL R2,4 ISOLATE 1ST 4 BITS (1 HEX DIGIT) @VA04250 00075000
STC R2,0(R3) PUT IT IN OUTPUT @VA04250 00076000
MVN ONE(ONE,R3),0(R4) MOVE 2ND 4 BITS TO NEXT BYTE @VA04250 00077000
LA R3,TWO(R3) UP OUTPUT POINTER 2 BYTES @VA04250 00078000
LA R4,ONE(R4) UP INPUT POINTER 1 BYTE @VA04250 00079000
BCT R5,LOOP SET UP ALL OUTPUT @VA04250 00080000
*************************************************************** 00081000
* THE OUTPUT AREA NOW HAS ALL THE INPUT DATA. 00082000
* E.G. X'1234' ON INPUT NOW IS X'01020304' IN THE OUTPUT AREA 00083000
* WE NEED TO TRANSLATE THIS TO X'F1F2F3F4' AND WE ARE DONE. 00084000
*************************************************************** 00085000
L R5,TRNPARM GET LENGTH OF DATA AGAIN @VA04250 00086000
SLL R5,1 MULTIPLY BY 2 (2 HEX DIGITS/BYTE)@VA04250 00087000
BCTR R5,0 SET UP FOR EXECUTE INSTRUCTION @VA04250 00088000
EX R5,TRNSLATE TRANSLATE THE DATA TO EBCDIC @VA04250 00089000
LA R1,OUTPUT RETURN RESULTS TO CALLER @VA04250 00090000
LM R2,R12,28(R13) RESTORE CALLER'S REGS @VA04250 00091000
SR R15,R15 RETURN CODE ZERO @VA04250 00092000
BR R14 RETURN TO CALLER @VA04250 00093000
TRNSLATE TR OUTPUT(0),TRTABLE EXECUTED TRANSLATE INSTRUCTION@VA04250 00094000
*************************************************************** 00095000
* CONSTANTS SAVEAREAS AND EQUATES 00096000
*************************************************************** 00097000
MAX64 DC F'64' MAX. ALLOWED TRANSLATION REQUEST @VA04250 00098000
VEXCON DC V(SHARECON) ADDRESS OF SHARED CONSTANT AREA @VA04250 00099000
OUTPUT DS CL128 OUTPUT AREA FOR TRANSLATED DATA @VA04250 00100000
TRTABLE DC C'0123456789ABCDEF' TRANSLATE TABLE @VA04250 00101000
PATCH DC 50F'0' PATCH AREA @VA04250 00102000
ONE EQU 1 FOR LOAD ADDRESS ETC. @VA04250 00103000
TWO EQU 2 FOR LOAD ADDRESS ETC. @VA04250 00104000
LTORG @VA04250 00105000
COPY EXCONST @VA04250 00106000
REGEQU @VA04250 00107000
END 00108000