NEM TITLE 'DMKNEM (CP) VM/370 - RELEASE 6' 00001000
ISEQ 73,80 VALIDATE SEQUENCING OF SYSIN 00002000
*. 00003000
* MODULE NAME - 00004000
* 00005000
* DMKNEM 00006000
* 00007000
* FUNCTION - 00008000
* 00009000
* TO GET A 5-BYTE MNEMONIC OP-CODE FOR A 370 BINARY OP-CODE 00010000
* 00011000
* ATTRIBUTES - 00012000
* 00013000
* REENTRANT, PAGEABLE, CALLED VIA SVC. 00014000
* 00015000
* ENTRY POINTS - 00016000
* 00017000
* DMKNEMOP 00018000
* 00019000
* ENTRY CONDITIONS - 00020000
* 00021000
* GPR 0 (BITS 16-31) = FIRST TWO BYTES OF 370 INSTRUCTION 00022000
* (BITS 0-15 OF GPR 0 ARE IMMATERIAL) 00023000
* GPR 1 = ADDRESS WHERE 5-BYTE MNEMONIC IS TO BE STORED 00024000
* GPR 12 = ADDRESSABILITY 00025000
* 00026000
* EXIT CONDITIONS - 00027000
* 00028000
* 5-BYTE MNEMONIC HAS BEEN STORED AT LOCATION 00029000
* SPECIFIED BY GPR 1 AT ENTRY. 00030000
* 00031000
* CONDITION CODE = 0: OP-CODE IS NOT PRIVILEGED 00032000
* CONDITION CODE = 1: OP-CODE IS PRIVILEGED 00033000
* 00034000
* CALLS TO OTHER ROUTINES - 00035000
* 00036000
* NONE 00037000
* 00038000
* EXTERNAL REFERENCES - 00039000
* 00040000
* NONE 00041000
* 00042000
* TABLES / WORK AREAS 00043000
* 00044000
* NONE (OTHER THAN STANDARD SAVE AREA) 00045000
* 00046000
* REGISTER USAGE - 00047000
* 00048000
* GPR 0 = BINARY OP-CODE (BITS 16-31) 00049000
* GPR 1 = ADDRESS FOR STORING 5-BYTE MNEMONIC OP-CODE 00050000
* GPRS 2-5 USED FOR WORK REGISTERS 00051000
* GPR 12 = ADDRESSABILITY 00052000
EJECT 00053000
* NOTES - 00054000
* 00055000
* IF THE OP-CODE IS UNKNOWN, A 4-BYTE MNEMONIC 00056010
* OF '????' IS RETURNED TO THE CALLER. 00057000
* 00058000
* 'BCR' AND 'BC' INSTRUCTIONS ARE CONVERTED AS FOLLOWS: 00059000
* 00060000
* BCR 0 = 'NOPR' 00061000
* BCR 15 = 'BR' 00062000
* ALL OTHER BCR INSTRUCTIONS = 'BCR' 00063000
* 00064000
* BC 0 = 'NOP' 00065000
* BC 1 = 'BO' 00066000
* BC 2 = 'BP' 00067000
* BC 4 = 'BM' 00068000
* BC 7 = 'BNZ' 00069000
* BC 8 = 'BZ' 00070000
* BC 11 = 'BNM' 00071000
* BC 13 = 'BNP' 00072000
* BC 14 = 'BNO' 00073000
* BC 15 = 'B' 00074000
* ALL OTHER BC INSTRUCTIONS (3, 5, 6, 9, 10, 12) = 'BC' 00075000
* 00076000
* ALL OTHER OP-CODES ARE CONVERTED TO THE 00077000
* STANDARD MNEMONIC OF 5 BYTES OR LESS. 00078010
* 00079000
* OPERATION - 00080000
* 00081000
* 1. INDEXES TABLE OF 4-BYTE MNEMONICS TO GET UNIQUE 00082000
* 4-BYTE EQUIVALENT IF THIS IS AVAILABLE. IF YES, STORES SAME 00083000
* WITH 5TH BYTE SET TO BLANK, AND EXITS. 00084000
* 00085000
* 2. IF NO UNIQUE 4-BYTE EQUIVALENT IS AVAILABLE, 00086000
* HANDLES 'BCR' AND 'BC' INSTRUCTIONS AS INDICATED IN NOTES 00087000
* ABOVE. 5-BYTE MNEMONICS ARE HANDLED VIA A JUMP TABLE AND 00088000
* ARE RETURNED TO THE CALLER. 00089000
* 00090000
* 3. FOR THE REMAINING CASE OF 'B2' INSTRUCTIONS, A TABLE 00091000
* OF KNOWN LEGAL 'B2' COMMANDS IS SEARCHED PER THE SECOND BYTE 00092000
* OF THE OP-CODE. IF FOUND, THE EQUIVALENT IS RETURNED TO 00093000
* THE CALLER. IF NOT, THE UNKNOWN OP-CODE IS RETURNED. 00094000
*. 00095000
EJECT 00096000
DMKNEM CSECT 00097000
SPACE 00098000
DC CL8'DMKNEM' MODULE IDENTIFIER 00099000
SPACE 00100000
USING SAVEAREA,R13 00101000
USING DMKNEM,R12 00102000
EJECT 00103000
DMKNEMOP RELOC ENTRY POINT 00104000
MVI 4(R1),C' ' TENTATIVELY SET 5TH BYTE TO BLANK 00105000
SLR R2,R2 00106000
IC R2,SAVER0+2 GET OP-CODE BITS 00107000
ALR R2,R2 SHIFTED LEFT 4 00108000
ALR R2,R2 ... 00109000
LA R2,OPTABLE(R2) INDEX THE OP-CODE-TABLE 00110000
L R3,0(,R2) PICK UP THE AL4(NNNN) OR CL4'MNEM' 00111000
CLI 0(R2),X'00' SOMETHING THERE, OR JUMP-ADDRESS ? 00112000
BE CVTJUMP(R3) IF FIRST BYTE = 0, IT'S A JUMP NUMBER 00113000
CVTSTORE ST R3,0(,R1) IF OK, THAT'S THE ANSWER - STORE IT 00114000
CVTEXIT TM 0(R1),PB IS IT A PRIVILEGED OP-CODE ? 00115000
BZ CVTEXIT2 YES (BIT OFF) - SET PRIV INDICATOR 00116000
SR R15,R15 NO - CLEAR CONDITION-CODE 00117000
EXIT AND EXIT. 00118000
* 00119000
CVTEXIT2 OI 0(R1),PB PRIVILEGED OP-CODE - TURN BIT BACK ON 00120000
EXIT AND EXIT (COND CODE = 1 FROM "OI" INSTR) 00121000
* 00122000
CVTJUMP B CVTBCR 0 - BCR INSTRUCTIONS 00123000
B CVTBC 4 - BC INSTRUCTIONS 00124000
B CVTSTNSM 8 - STNSM 00125000
B CVTSTOSM 12 - STOSM 00126000
B CVTB2 16 - B2 INSTRUCTIONS 00127000
B CVTSTCTL 20 - STCTL 00128000
B CVTSIO 24 - SIO OR SIOF 00129000
B CVTHIO 28 - HIO OR HDV 00130000
B CVTTIO 32 - TIO OR CLRIO @VM01053 00131000
B CVT9F 36 - TCH OR CLRCH @VA07963 00131010
* 00132000
CVTBCR L R3,BCRF ASSUME IT MIGHT BE 'BR' 00133000
TM SAVER0+3,X'F0' IS IT X'F0' ? 00134000
BO CVTSTORE YES - 'BR' IT IS. 00135000
L R3,BCROTHER NO, PROBABLY 1 TO 14 00136000
BM CVTSTORE YES - 'BCR' IT IS. 00137000
L R3,BCR0 NEITHER OF THE ABOVE, IT MUST BE 'NOPR' 00138000
B CVTSTORE GO STORE SAME. 00139000
* 00140000
CVTBC LA R2,X'F0' BC INSTRUCTION, ISOLATE 2ND BYTE 00141000
NR R2,R0 ... 00142000
SRL R2,2 NOW HAVE AS AN INDEXER (MULTIPLE OF 4) 00143000
L R3,BCTABLE(R2) PICK UP THE RIGHT BC EQUIVALENT 00144000
B CVTSTORE AND GO STORE IT. 00145000
* 00146000
CVTSTNSM MVC 0(5,R1),CLSTNSM 'STNSM' 00147000
B CVTEXIT2 EXIT (PRIV OP) 00148000
CVTSTOSM MVC 0(5,R1),CLSTOSM 'STOSM' 00149000
B CVTEXIT2 EXIT (PRIV OP) 00150000
CVTSTCTL MVC 0(5,R1),CLSTCTL 'STCTL' 00151000
B CVTEXIT2 EXIT (PRIV OP) 00152000
* 00153000
CVTSIO MVC 0(4,R1),CLSIO SIO/SIOF - ASSUME IT'S SIO ... 00154000
TM SAVER0+3,X'01' IS IT ? 00155000
BZ CVTEXIT2 YES - EXIT (PRIV OP). 00156000
MVI 3(R1),C'F' NO - SIOF - ADD 'F' TO MAKE IT 'SIOF' 00157000
B CVTEXIT2 AND EXIT (PRIV OP). 00158000
* 00159000
CVTHIO MVC 0(4,R1),CLHIO HIO/HDV - ASSUME IT'S HIO ... 00160000
TM SAVER0+3,X'01' IS IT ? 00161000
BZ CVTEXIT2 YES - EXIT (PRIV OP). 00162000
MVC 0(4,R1),CLHDV WE GUESSED WRONG - MAKE THAT 'HDV' 00163000
B CVTEXIT2 AND EXIT (PRIV OP). 00164000
* 00165000
CVTTIO MVC 0(4,R1),CLTIO ASSUME IT'S A TIO @VM01053 00166000
TM SAVER0+3,X'01' IS IT ?? @VM01053 00167000
BZ CVTEXIT2 YES - EXIT (PRIV OP) @VM01053 00168000
MVC 0(5,R1),CLCLRIO NO - MAKE IT CLRIO @VM01053 00169000
B CVTEXIT2 & EXIT (PRIV OP) @VM01053 00170000
* 00171000
CVT9F DS 0H @VMD0142 00171100
MVC 0(4,R1),CLTCH ASSUME IT'S A TCH @VMD0142 00171110
TM SAVER0+3,X'01' IS IT A TCH? @VMD0142 00171120
BZ CVTEXIT2 YES, EXIT (PRIV OP) @VMD0142 00171130
MVC 0(5,R1),CLCLRCH NO, MAKE IT A CLRCH @VA07963 00171140
B CVTEXIT2 EXIT (PRIV OP) @VMD0142 00171150
* 00171160
CVTB2 LA R3,B2TABLE POINT TO TABLE OF B2 COMMANDS 00172000
LA R4,6 6 BYTES PER ENTRY 00173000
LA R5,ENDB2TBL LAST ENTRY IN TABLE 00174000
ICM R2,8,SAVER0+3 2ND BYTE OF B2 COMMAND INTO R2 HIGH END 00175000
CVT2LOOP CLM R2,8,0(R3) DOES 2ND BYTE OF B2 INSTR. MATCH ? 00176000
BE CVT2FND YES 00177000
BXLE R3,R4,CVT2LOOP KEEP LOOKING. 00178000
L R3,OPTABLE GIVE UP IF NOT THERE 00179000
B CVTSTORE ... 00180000
* 00181000
CVT2FND MVC 0(5,R1),1(R3) IF FOUND, MOVE THE 5-BYTE EQUIVALENT. 00182000
B CVTEXIT AND GO EXIT. 00183000
EJECT 00184000
DS 0F 00185000
OPTABLE DC CL4'????',CL4'????',CL4'????',CL4'????',CL4'SPM ' 00-UP 00186000
DC CL4'BALR',CL4'BCTR',AL4(0000) *BCR 00187000
DC AL1(C'S'-PB),CL3'SK' 08 = 'SSK' (PRIV) 00188000
DC AL1(C'I'-PB),CL3'SK' 09 = 'ISK' (PRIV) 00189000
DC CL4'SVC ',CL4'????',CL4'????',CL4'BASR',CL4'MVCL' 00190000
DC CL4'CLCL',CL4'LPR ',CL4'LNR ',CL4'LTR ',CL4'LCR ' 00191000
DC CL4'NR ',CL4'CLR ',CL4'OR ',CL4'XR ',CL4'LR ' 00192000
DC CL4'CR ',CL4'AR ',CL4'SR ',CL4'MR ',CL4'DR ' 00193000
DC CL4'ALR ',CL4'SLR ',CL4'LPDR',CL4'LNDR',CL4'LTDR' 00194000
DC CL4'LCDR',CL4'HDR ',CL4'LRDR',CL4'MXR ',CL4'MXDR' 00195000
DC CL4'LDR ',CL4'CDR ',CL4'ADR ',CL4'SDR ',CL4'MDR ' 00196000
DC CL4'DDR ',CL4'AWR ',CL4'SWR ',CL4'LPER',CL4'LNER' 00197000
DC CL4'LTER',CL4'LCER',CL4'HER ',CL4'LRER',CL4'AXR ' 00198000
DC CL4'SXR ',CL4'LER ',CL4'CER ',CL4'AER ',CL4'SER ' 00199000
DC CL4'MER ',CL4'DER ',CL4'AUR ',CL4'SUR ' 00200000
DC CL4'STH ',CL4'LA ',CL4'STC ',CL4'IC ',CL4'EX ' 40-UP 00201000
DC CL4'BAL ',CL4'BCT ',AL4(0004),CL4'LH ',CL4'CH ' *BC 00202000
DC CL4'AH ',CL4'SH ',CL4'MH ',CL4'BAS ',CL4'CVD ' 00203000
DC CL4'CVB ',CL4'ST ',CL4'????',CL4'????',CL4'????' 00204000
DC CL4'N ',CL4'CL ',CL4'O ',CL4'X ',CL4'L ' 00205000
DC CL4'C ',CL4'A ',CL4'S ',CL4'M ',CL4'D ' 00206000
DC CL4'AL ',CL4'SL ',CL4'STD ',CL4'????',CL4'????' 00207000
DC CL4'????',CL4'????',CL4'????',CL4'????',CL4'MXD ' 00208000
DC CL4'LD ',CL4'CD ',CL4'AD ',CL4'SD ',CL4'MD ' 00209000
DC CL4'DD ',CL4'AW ',CL4'SW ',CL4'STE ',CL4'????' 00210000
DC CL4'????',CL4'????',CL4'????',CL4'????',CL4'????' 00211000
DC CL4'????',CL4'LE ',CL4'CE ',CL4'AE ',CL4'SE ' 00212000
DC CL4'ME ',CL4'DE ',CL4'AU ',CL4'SU ' 00213000
DC AL1(C'S'-PB),CL3'SM' 80 = 'SSM' (PRIV) 00214000
DC CL4'????' 81 00215000
DC AL1(C'L'-PB),CL3'PSW' 82 = 'LPSW' (PRIV) 00216000
DC AL1(C'D'-PB),CL3'IAG' 83 = 'DIAG' (PRIV) 00217000
DC AL1(C'W'-PB),CL3'RD' 84 = 'WRD' (PRIV) 00218000
DC AL1(C'R'-PB),CL3'DD' 85 = 'RDD' (PRIV) 00219000
DC CL4'BXH ',CL4'BXLE',CL4'SRL ',CL4'SLL ' 00220000
DC CL4'SRA ',CL4'SLA ',CL4'SRDL',CL4'SLDL',CL4'SRDA' 00221000
DC CL4'SLDA',CL4'STM ',CL4'TM ',CL4'MVI ',CL4'TS ' 00222000
DC CL4'NI ',CL4'CLI ',CL4'OI ',CL4'XI ',CL4'LM ' 00223000
DC CL4'????',CL4'????',CL4'????' 00224000
DC AL4(0024) 9C = 'SIO' OR 'SIOF' (PRIV) 00225000
DC AL4(0032) 9D = 'TIO' OR 'CLRIO' (PRIV) @VM01053 00226000
DC AL4(0028) 9E = 'HIO' OR 'HDV' (PRIV) 00227000
DC AL4(0036) 9F = 'TCH' OR 'CLRCH' (PRIV) @VA07963 00228010
DC CL4'????',CL4'????',CL4'????' 00229000
DC CL4'????',CL4'????',CL4'????',CL4'????',CL4'????' 00230000
DC CL4'????',CL4'????',CL4'????',CL4'????',AL4(0008) *STNSM 00231000
DC AL4(0012),CL4'SIGP',CL4'MC ',CL4'????' *STOSM 00232000
DC AL1(C'L'-PB),CL3'RA' B1 = 'LRA' (PRIV) 00233000
DC AL4(0016) *B2 00234000
DC CL4'????',CL4'????',CL4'????',AL4(0020) *STCTL 00235000
DC AL1(C'L'-PB),CL3'CTL' B7 = 'LCTL' (PRIV) 00236000
DC CL4'????' B8 00237000
DC AL1(C'L'-PB),CL3'MP' B9 = 'LMP' (PRIV) 00238000
DC CL4'CS ',CL4'CDS ' @V200138 00239000
DC CL4'NCTL',CL4'CLM ',CL4'STCM',CL4'ICM ' 00240000
DC CL4'????',CL4'????',CL4'????',CL4'????',CL4'????' C0-UP 00241000
DC CL4'????',CL4'????',CL4'????',CL4'????',CL4'????' 00242000
DC CL4'????',CL4'????',CL4'????',CL4'????',CL4'????' 00243000
DC CL4'????',CL4'????',CL4'MVN ',CL4'MVC ',CL4'MVZ ' 00244000
DC CL4'NC ',CL4'CLC ',CL4'OC ',CL4'XC ',CL4'????' 00245000
DC CL4'????',CL4'????',CL4'????',CL4'TR ',CL4'TRT ' 00246000
DC CL4'ED ',CL4'EDMK',CL4'????',CL4'????',CL4'????' 00247000
DC CL4'????',CL4'????',CL4'????',CL4'????',CL4'????' 00248000
DC CL4'????',CL4'????',CL4'????',CL4'????',CL4'????' 00249000
DC CL4'????',CL4'????',CL4'????',CL4'SRP ',CL4'MVO ' 00250000
DC CL4'PACK',CL4'UNPK',CL4'????',CL4'????',CL4'????' 00251000
DC CL4'????',CL4'ZAP ',CL4'CP ',CL4'AP ',CL4'SP ' 00252000
DC CL4'MP ',CL4'DP ',CL4'????',CL4'????' 00253000
SPACE 2 00254000
* MNEMONICS FOR 'BCR' CASES: 00255000
BCR0 DC CL4'NOPR' BCR X'0' = NO-OP 00256000
BCRF DC CL4'BR ' BCR X'F' = UNCONDITIONAL BRANCH 00257000
BCROTHER DC CL4'BCR ' FOR ALL OTHER BCR'S 00258000
SPACE 00259000
* MNEMONICS FOR 'BC ' CASES: 00260000
BCTABLE DC CL4'NOP ' BC 0 00261000
DC CL4'BO ' BC 1 00262000
DC CL4'BP ' BC 2 (= BH) 00263000
DC CL4'BC ' BC 3 00264000
DC CL4'BM ' BC 4 (= BL) 00265000
DC CL4'BC ' BC 5 00266000
DC CL4'BC ' BC 6 00267000
DC CL4'BNZ ' BC 7 (= BNE) 00268000
DC CL4'BZ ' BC 8 (= BE) 00269000
DC CL4'BC ' BC 9 00270000
DC CL4'BC ' BC 10 00271000
DC CL4'BNM ' BC 11 (= BNL) 00272000
DC CL4'BC ' BC 12 00273000
DC CL4'BNP ' BC 13 (= BNH) 00274000
DC CL4'BNO ' BC 14 00275000
DC CL4'B ' BC 15 00276000
SPACE 00277000
* THE FOLLOWING (THRU 'STCTL') ARE ALL PRIVILEGED OP CODES ..... 00278000
CLSIO DC CL4'SIO' OP-CODE 9C = SIO OR SIOF 00279000
* (ADD 'F' IN BYTE 3 IF 'SIOF') 00280000
CLTIO DC CL4'TIO' OP CODE 9D00 = TIO @VM01053 00281000
CLCLRIO DC CL5'CLRIO' OP CODE 9D01 = CLRIO @VM01053 00282000
CLHIO DC CL4'HIO' OP CODE 9E00 = HIO 00283000
CLHDV DC CL4'HDV' OP CODE 9E01 = HDV 00284000
CLTCH DC CL4'TCH' OP-CODE 9F00 = TCH @VMD0142 00284100
CLCLRCH DC CL5'CLRCH' OP-CODE 9F01 = CLRCH @VA07963 00284110
CLSTNSM DC CL5'STNSM' OP-CODE AC 00285000
CLSTOSM DC CL5'STOSM' OP-CODE AD 00286000
CLSTCTL DC CL5'STCTL' OP-CODE B6 00287000
SPACE 00288000
* 00289000
* B2XX OP-CODES 00290000
* FIRST BYTE = 2ND BYTE OF OP-CODE (E.G. 09 FOR B209) 00291000
* NEXT FIVE BYTES = MNEMONIC FOR SAME (E.G. STPT) 00292000
* 00293000
B2TABLE DS 0H ... 00294000
DC XL1'02',AL1(C'S'-PB),CL4'TIDP' B202 = STIDP (PRIV) 00295000
DC XL1'03',AL1(C'S'-PB),CL4'TIDC' B203 = STIDC (PRIV) 00296000
DC XL1'04',AL1(C'S'-PB),CL4'CK ' B204 = SCK (PRIV) 00297000
DC XL1'05',CL5'STCK ' B205 = STCK 00298000
DC XL1'06',AL1(C'S'-PB),CL4'CKC ' B206 = SCKC (PRIV) 00299000
DC XL1'07',AL1(C'S'-PB),CL4'TCKC' B207 = STCKC (PRIV) 00300000
DC XL1'08',AL1(C'S'-PB),CL4'PT ' B208 = SPT (PRIV) 00301000
DC XL1'09',AL1(C'S'-PB),CL4'TPT ' B209 = STPT (PRIV) 00302000
DC XL1'0A',AL1(C'S'-PB),CL4'PKA ' B20A = SPKA @VA05113 00303500
* (PRIV) 00304000
DC XL1'0B',AL1(C'I'-PB),CL4'PK ' B20B = IPK @V200138 00305000
* (PRIV) 00306000
DC XL1'0C',CL5'PBINT' B20C = PBINT 00307000
DC XL1'0D',AL1(C'P'-PB),CL4'TLB ' B20D = PTLB (PRIV) 00308000
DC XL1'10',AL1(C'S'-PB),CL4'PX ' B210 = SPX (PRIV) 00309000
DC XL1'11',AL1(C'S'-PB),CL4'TPX ' B211 = STPX (PRIV) 00310000
DC XL1'12',AL1(C'S'-PB),CL4'TAP ' B212 = STAP (PRIV) 00311000
DC XL1'13',AL1(C'R'-PB),CL4'RB ' B213 = RRB (PRIV) 00312000
DC XL1'2D',CL5'DXR ' B22D = DXR 00313000
* 00314000
ENDB2TBL EQU *-6 LAST ENTRY IN TABLE. 00315000
SPACE 00316000
PB EQU X'40' "PRIVILEGED BIT" (TO MAKE A-Z LOWER CASE) 00317000
EJECT 00318000
COPY SAVE 00319000
COPY EQU 00320000
END 00321000