OR2 TITLE 'DMSOR2 (CMS) VM/370 - RELEASE 6' 00001000
SPACE 2 00002000
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 00003000
*. * 00004000
* MODULE NAME: * 00005000
* DMSOR2 * 00006000
* * 00007000
* FUNCTION: * 00008000
* THE FUNCTION OF DMSOR2 IS TO RELOCATE ALL DTF TABLE * 00009000
* ADDRESS CONSTANTS FROM THE ASSEMBLED ADDRESSES TO * 00010000
* EXECUTABLE STORAGE ADDRESSES. THIS IS ACCOMPLISHED BY * 00011000
* SUBTRACTING FROM THE BAL ADDRESS PROVIDED BY THE * 00012000
* OPENR MACRO IN REGISTER 0 A FOUR BYTE ASSEMBLED * 00013000
* ADDRESS CONSTANT OF THE BAL ADDRESS. ANY DIFFERENCE * 00014000
* INDICATES THAT THE PROGRAM HAS BEEN RELOCATED. * 00015000
* RELOCATION IS PERFORMED FOR DTFCP AND DTFDI DTFS. * 00016000
* * 00017000
* ATTRIBUTES: * 00018000
* DISCONTIGUOUS SHARED SEGMENT * 00019000
* REENTRANT * 00020000
* * 00021000
* ENTRY POINTS: * 00022000
* DMSOR2 * 00023000
* * 00024000
* ENTRY CONDITIONS: * 00025000
* DMSOR2 IS INVOKED IN RESPONSE TO AN SVC 2 (FETCH) * 00026000
* FROM $$BOPENR (DMSOR1). AT ENTRY TO DMSOR2, R0 POINTS * 00027000
* TO A LIST OF DTF TABLES THAT REQUIRE ADDRESS * 00028000
* MODIFICATION. * 00029000
* * 00030000
* EXIT CONDITIONS: * 00031000
* * 00032000
* NORMAL EXITS: * 00033000
* SVC 2 TO $$BOPEN TO OPEN THE DTFS * 00034000
* AFTER THE ADCONS HAVE BEEN MODIFIED. * 00035000
* * 00036000
* * 00037000
* ABNORMAL EXITS: * 00038000
* NONE * 00039000
* * 00040000
* ERROR MESSAGES ISSUED BY THIS PROGRAM: * 00041000
* NONE * 00042000
* * 00043000
* CALLS TO OTHER ROUTINES: * 00044000
* DMSBOP (SVC 2) * 00045000
* * 00046000
* EXTERNAL REFERENCES: * 00047000
* REGEQU * 00048000
* * 00049000
* CALLED BY: * 00050000
* INVOKED IN RESPONSE TO SVC 2 (FETCH FOR $$BOPNR2 FROM * 00051000
* DMSOR1) * 00052000
* * 00053000
* TABLES AND WORK AREAS: * 00054000
* ADCON TABLE - A TABLE CONSISTING OF INDIVIDUAL TABLES * 00055000
* USED TO MODIFY DIFFERENT DTF TYPES. EACH* 00056000
* HAS A UNIQUE NAME TO IDENTIFY IT. * 00057000
* EACH TABLE HAS THE FOLLOWING LAYOUT: * 00058000
* * 00059000
* BYTE 1 CONTAINS THE COUNT OF ADCONS * 00060000
* TO BE MODIFIED. * 00061000
* * 00062000
* BYTE 2 CONTAINS THE BYTE COUNT FROM * 00063000
* THE LOGIC MODULE ADDRESS TO * 00064000
* THE FIRST ADCON. * 00065000
* * 00066000
* SUBSEQUENT BYTES CONTAIN THE BYTE * 00067000
* COUNT NEEDED TO ADDRESS THE NEXT * 00068000
* ADCON. * 00069000
* * 00070000
* REGISTER USAGE: * 00071000
* * 00072000
* TABLEREG - 0 TABLE PARAMETER - INPUT * 00073000
* BASEREG - 3 DTF TABLE ADDRESS * 00074000
* MODREG - 4 DTF TABLE ADDRESS CONSTANT DISP. TABLE* 00075000
* ADDRREG - 5 ADDRESS CONSTANT RELOCATE REGISTER * 00076000
* COUNTREG - 6 COUNT OF DTF ADCONS TO BE CHANGED * 00077000
* LINKREG - 7 LINK REGISTER TO ADDRESS MOD. RTN. * 00078000
* TYPEREG - 8 USED TO DETERMINE DTF TYPE * 00079000
* DTFREG - 9 DTF TYPE TABLE * 00080000
* CCWREG - 10 POINTER TO START OF EACH DTF TABLE * 00081000
* WORKREG1 - 11 TABLE PARAMETER WORK REGISTER * 00082000
* R12 - BASE REGISTER * 00083000
* RELOCREG - 13 RELOCATION FACTOR * 00084000
* R14 - UNUSED * 00085000
* R15 - UNUSED * 00086000
* * 00087000
* OPERATION: * 00088000
* DMSOR2 PERFORMS THE FOLLOWING FUNCTIONS: * 00089000
* 1. DETERMINES IF RELOCATION IS RE- * 00090000
* QUIRED. IF NOT EXIT IS MADE TO * 00091000
* $$BOPEN TO OPEN THE FILE. * 00092000
* * 00093000
* 2. DETERMINES WHAT DTF TYPE IS THE * 00094000
* OBJECT OF THE OPENR MACRO. * 00095000
* * 00096000
* MODIFIES THE ADCONS IN THE * 00097000
* DTFCP AND DTFDI DTFS. * 00098000
* * 00099000
* 3. A CHECK IS MADE TO SEE IF MORE * 00100000
* FILES REMAIN TO BE OPENED. IF * 00101000
* SO, ADDRESS MODIFICATION IS PER-* 00102000
* FORMED ON THOSE DTFS AND THEN AN* 00103000
* SVC 2 IS ISSUED TO FETCH $$BOPEN* 00104000
*. PERFORM THE ACTUAL OPEN. * 00105000
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 00106000
DMSOR2 CSECT @V305066 00107000
TABLEREG EQU 0 POINTER TO TABLE SUPPLIED BY OPENR MACRO @V305066 00108000
GR1 EQU 1 WORK REGISTER @V305066 00109000
GR2 EQU 2 WORK REGISTER @V305066 00110000
BASEREG EQU 3 CONTAINS ADDRESS OF THE ACTIVE DTF TABLE @V305066 00111000
MODREG EQU 4 CONTAINS ADDRESS OF DTF DISPLACEMENT TABLE @V305066 00112000
ADDRREG EQU 5 REG USED TO RELOCATE ADDRESS CONSTANTS @V305066 00113000
COUNTREG EQU 6 CONTAINS COUNT OF ADDRESSES TO BE MODIFIED @V305066 00114000
LINKREG EQU 7 LINK REGISTER @V305066 00115000
TYPEREG EQU 8 REGISTER USED TO DETERMINE DTF TYPE @V305066 00116000
DTFREG EQU 9 DTF TYPE TABLE @V305066 00117000
CCBREG EQU 10 POINT TO DTFDA BUILDING ROUTINE @V305066 00118000
WORKREG1 EQU 11 POINTER TO DTF TABLE LIST @V305066 00119000
RELOCREG EQU 13 REGISTER CONTAINS THE RELOCATION FACTOR @V305066 00120000
GRD EQU 15 WORK REG - VALIDATE DTF ADDRESS @V305066 00121000
CCWREG EQU CCBREG @V305066 00122000
DC CL8'$$BOPNR2' @V305066 00123000
BALR R12,0 EST. ADDRESSABILITY @V305066 00124000
USING *,R12 @V305066 00125000
EJECT 00126000
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 00127000
* THE ADDRESS OF THE DTF TABLE ADDRESSES IS PASSED IN REGISTER 0. * 00128000
* THE RELOCATION FACTOR IS DETERMINED BY SUBTRACTING THE ASSEMBLED * 00129000
* DTF TABLE ADDRESS FROM THE RELOCATED DTF TABLE ADDRESS. IF THE * 00130000
* DIFFERENCE IS ZERO, NO RELOCATION IS NECESSARY, THEREFORE THE OPEN * 00131000
* TRANSIENT IS CALLED IMMEDIATELY. * 00132000
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 00133000
SPACE 2 00134000
LR WORKREG1,TABLEREG PTR TO DTF TABLE ADDR. @V305066 00135000
NEXT L CCWREG,0(WORKREG1) LOAD DTF TABLE ADDRESS @V305066 00136000
LA BASEREG,16(CCWREG) INCREM 16 INTO DTF @V305066 00137000
TM 0(BASEREG),RELOC HAS FILE BEEN RELOCATED @V305066 00138000
BO RETURN YES RETURN @V305066 00139000
OI 0(BASEREG),RELOC TURN ON RELOCATION BIT @V305066 00140000
EJECT 00141000
*********************************************************************** 00142000
* EACH DTF TYPE HAS IN ITS TABLE A UNIQUE CODE LOCATED IN DECIMAL * 00143000
* BYTE 20. THIS CODE IS USE TO DETERMINE WHICH DTF TYPE IS TO BE * 00144000
* RELOCATED. * 00145000
* AFTER THE DTF TYPE IS ESTABLISHED EXITS TO THE ADDRESS MODIFICATION * 00146000
* SUBROUTINE ARE IN ONE OF TWO FORMS. * 00147000
* THE FIRST FORM IS A BRANCH INSTRUCTION. THIS WILL CAUSE THE ADDRESS* 00148000
* MODIFICATION SUBROUTINE TO EXIT TO THE ENDING ROUTINE. THE ENDING * 00149000
* ROUTINE WILL DETERMINE IF ADDITIONAL DTF TABLES NEED MODIFICATION. * 00150000
* THE SECOND FORM IS A BRANCH AND LINK. THIS WILL CAUSE THE ADDRESS * 00151000
* MODIFICATION SUBROUTINE TO RETURN TO THE NEXT SEQUENTIAL INSTRUCTION* 00152000
* THIS IS NEEDED BECAUSE OF ADDITIONAL CHECKS WITHIN THE TABLE TO * 00153000
* DETERMINE IF FURTHER ADDRESS MODIFICATION IS NEEDED. FOLLOWING THE * 00154000
* LAST BAL WILL BE A BRANCH TO THE ENDING ROUTINE. * 00155000
*********************************************************************** 00156000
SPACE 2 00157000
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 00158000
* DTF TYPE 31 DTFCP TAPE * 00159000
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 00160000
SPACE 2 00161000
CPTEST CLI 4(BASEREG),DTFCPT IS THIS DTFCP TAPE @V305066 00162000
BE CPDEC BRANCH NOT CP TAPE @V305066 00163000
CLI 4(BASEREG),DTFDI IS THIS DTFDI TYPE @V305066 00164000
BE DEVINDT YES @V305066 00165000
BH RETURN INVALID DTF TYPE @V305066 00166000
TM 15(BASEREG),CPTAPIP TEST FOR DTFCP TAPE INPUT @V305066 00167000
LA MODREG,CPTBL1 LOAD INPUT TBL @V305066 00168000
BO CPDEC1 BRANCH IF INPUT @V305066 00169000
LA MODREG,CPTBL2 LOAD OUTPUT TABLE @V305066 00170000
CPDEC1 BAL LINKREG,MODLOOP GO TO MODIFY ADDRESSES @V305066 00171000
CLC 6(2,CCWREG),CON1 FURTHER RELOC NECESSARY? @V305066 00172000
BNE RETURN NOT NECESSARY, RETURN @V305066 00173000
LA MODREG,CPTBL3 LOAD CP TAPE TABLE @V305066 00174000
B MODEXIT MODIFY LAST TABLE @V305066 00175000
SPACE 2 00176000
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 00177000
* DTF TYPE 32 DTFCP DISK * 00178000
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 00179000
SPACE 2 00180000
CPDEC LA MODREG,CPTBL4 ADCON TABLE @V305066 00181000
BAL LINKREG,MODLOOP BR TO MAKE MODIFICATION @V305066 00182000
TM 44(CCWREG),CPTAPIP IS THIS AN INPUT TABLE @V305066 00183000
BZ CPDEC2 BRANCH IF OUTPUT @V305066 00184000
LA MODREG,CPTBL5 MODIFY EOF ADDRESS @V305066 00185000
BAL LINKREG,MODLOOP BR TO MAKE ADD MODIFICATION @V305066 00186000
CPDEC2 LR BASEREG,CCWREG REST. BASEREG TO TABLE BEG. @V305066 00187000
CLI 30(BASEREG),FF IS BYTE 30 ALL ONES @V305066 00188000
BNE CPDEC3 NO BRANCH @V305066 00189000
LA MODREG,CPTBL6 ADCON TABLE @V305066 00190000
BAL LINKREG,MODLOOP BR TO MAKE ADD MODIFICATION @V305066 00191000
CLC 6(2,CCWREG),CON1 TEST FOR SYS IPT @V305066 00192000
BNE RETURN BRANCH IF NOT @V305066 00193000
LA MODREG,CPTBL7 MAKE FURTHER MODIFICATION @V305066 00194000
B MODEXIT MODIFY SYSIPT SAVE AREA @V305066 00195000
CPDEC3 LA MODREG,CPTBL8 BYTE 30 ALL ONES @V305066 00196000
BAL LINKREG,MODLOOP BR TO MAKE ADD MODIFICATION @V305066 00197000
TM 44(CCWREG),CPTAPIP TEST FOR OUTPUT FILE @V305066 00198000
BO RETURN BRANCH IF INPUT @V305066 00199000
LA MODREG,CPTBL9 ADCON TABLE @V305066 00200000
B MODEXIT MODIFY OUTPUT AREAS @V305066 00201000
SPACE 2 00202000
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 00203000
* DTF TYPE 33 DTFDI 00204000
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 00205000
SPACE 2 00206000
DEVINDT LA MODREG,DITBL ADDR. OF DTFDI TABLE @V305066 00207000
BAL LINKREG,MODLOOP MOD. ADDRS., RET. TO NSI @V305066 00208000
TM 44(CCWREG),CPTAPIP TEST IF INPUT FILE @V305066 00209000
BZ DIOUT NO @V305066 00210000
CLI 120(BASEREG),BRINST TEST IF BRANCH INSTRUCTION @V305066 00211000
BE RETURN YES, BRANCH @V305066 00212000
BAL LINKREG,MODLOOP MODIFY WLR ADDRESS @V305066 00213000
CLI 4(BASEREG),BRINST TEST IF BRANCH INSTRUCTION @V305066 00214000
BE RETURN YES, BRANCH @V305066 00215000
B MODEXIT MODIFY ERROPT ADDRES @V305066 00216000
DIOUT LA MODREG,DITBLOUT @V305066 00217000
B MODEXIT @V305066 00218000
EJECT 00219000
*********************************************************************** 00220000
* E N D I N G R O U T I N E * 00221000
* * 00222000
* A CHECK IS MADE TO DETERMINE IF MORE DTF TABLES REQUIRE ADDRESS * 00223000
* MODIFICATION. IF SO, RETURN IS MADE TO THE START OF THIS TRANSIENT.* 00224000
* IF NOT, A SUPERVISOR CALL 2 IS MADE TO CALL IN THE OPEN TRANSIENT. * 00225000
*********************************************************************** 00226000
RETURN LA WORKREG1,4(WORKREG1) BUMP TO NEXT DTF TABLE @V305066 00227000
CLI 0(WORKREG1),ENDTAB END OF DTF TABLE ? @V305066 00228000
BNE NEXT NO, PROCESS NEXT TABLE @V305066 00229000
EXIT LA R1,BOPEN PREPARE TO CALL $$BOPEN @V305066 00230000
SVC SVC2 CALL IN OPEN MONITOR @V305066 00231000
EJECT 00232000
*********************************************************************** 00233000
* A D D R E S S M O D I F I C A T I O N S U B R O U T I N E * 00234000
* * 00235000
* BASEREG CONTAINS ADDRESS OF THE ADCON TO BE MODIFIED * 00236000
* COUNTREG CONTAINS NUMBER OF ADDRESSES TO BE MODIFIED * 00237000
* DTFREG CONTAINS THE DIFFERENCE FROM ONE ADDRESS TO NEXT ADDRESS * 00238000
* RELOCREG CONTAINS THE RELOCATION FACTOR * 00239000
* MODREG POINTS TO OR WITHIN DISPLACEMENT TABLE * 00240000
* ADDRREG IS THE WORK REGISTER * 00241000
* THE ORIGINAL CONTENTS OF MODREG POINTS TO THE START OF THE CURRENT * 00242000
* ADCON TABLE. THE FIRST BYTE OF EACH TABLE CONTAINS THE COUNT OF * 00243000
* ADDRESSES TO BE MODIFIED. THIS COUNT IS PLACED IN COUNTREG. THE * 00244000
* SECOND BYTE IS THE DISPLACEMENT BYTE COUNT OF THE FIRST ADCON FROM * 00245000
* THE LOGIC MODULE ADDRESS IN THE DTF TABLE. EACH TABLE BYTE THERE- * 00246000
* AFTER IS THE BYTE COUNT BETWEEN SUBSEQUENT ADCONS. EACH BYTE COUNT* 00247000
* IS ADDED TO BASEREG TO ADDRESS EACH ADCON. THE ADCON TO BE * 00248000
* MODIFIED IS LOADED INTO ADDRREG. THE RELOCATION FACTOR IN RELOCREG * 00249000
* IS ADDED TO THE ADCON WITH THE RESULTANT EXECUTABLE ADDRESS STORED * 00250000
* BACK INTO THE ASSEMBLED ADCON LOCATION. * 00251000
*********************************************************************** 00252000
SPACE 2 00253000
MODEXIT LA LINKREG,RETURN LAST MOD. TO TABLE ENTRY @V305066 00254000
MODLOOP SR DTFREG,DTFREG CLEAR DISPLACEMENT REG @V305066 00255000
SR COUNTREG,COUNTREG CLEAR BCT REG @V305066 00256000
IC COUNTREG,0(MODREG) INSERT COUNT @V305066 00257000
LR GR1,CCWREG PT. BEG. OF DTF TABLE @V305066 00258000
LR GR2,GR1 LOAD MAX ADDRESS REGISTER @V305066 00259000
SR GRD,GRD ZERO REGISTER @V305066 00260000
VALIDATE IC GRD,0(COUNTREG,MODREG) INSERT ADDR DISP. @V305066 00261000
AR GR2,GRD ADD TO START OF TABLE @V305066 00262000
BCT COUNTREG,VALIDATE DECREM COUNT AND VALID ADD @V305066 00263000
SVC SVC26 DO ADDRESS VALIDATION @V305066 00264000
IC COUNTREG,0(MODREG) RESTORE COUNT @V305066 00265000
MODLOOP1 LA MODREG,1(MODREG) POINT TO DISPLACEMENT @V305066 00266000
IC DTFREG,0(MODREG) INSERT DISPLACEMENT FACTOR @V305066 00267000
AR BASEREG,DTFREG ADD DISPLACE TO BASE @V305066 00268000
CLC 1(3,BASEREG),ZERO COMPARE ADDR.TO ZERO @V305066 00269000
BE MODLOOP2 ZERO ADDRESS, BYPASS UPDATE @V305066 00270000
L ADDRREG,0(BASEREG) LOAD ADCON TO BE MODIFIED @V305066 00271000
AR ADDRREG,RELOCREG ADD RELOCATION FACTOR @V305066 00272000
ST ADDRREG,0(BASEREG) STORE RELOCATED ADCON @V305066 00273000
MODLOOP2 BCT COUNTREG,MODLOOP1 RELOCATE NEXT ADDRESS @V305066 00274000
LA MODREG,1(MODREG) ADD 1 TO POINT TO NEXT TABLE @V305066 00275000
BR LINKREG RETURN TO ASKING ROUTINE @V305066 00276000
CON1 DC X'0002' @V305066 00277000
EJECT 00278000
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 00279000
* * 00280000
* CONSTANTS * 00281000
* * 00282000
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 00283000
SPACE 2 00284000
BOPEN DC CL8'$$BOPEN' OPEN MONITOR @V305066 00285000
ZERO DC XL3'000000' @V305066 00286000
EJECT 00287000
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 00288000
* * 00289000
* EQUATES * 00290000
* * 00291000
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 00292000
SPACE 2 00293000
RELOC EQU X'08' RELOCATION BIT IN DTF @V305066 00294000
DTFCPT EQU X'32' DTFCP TYPE = 32 @V305066 00295000
DTFDI EQU X'33' DTFDI @V305066 00296000
CPTAPIP EQU X'80' DTFCP TAPE INPUT FILE @V305066 00297000
FF EQU X'FF' @V305066 00298000
BRINST EQU X'47' BRANCH INSTRUCTION @V305066 00299000
ENDTAB EQU X'0A' END OF LIST OF DTF TABLES @V305066 00300000
SVC2 EQU 2 SVC 2 @V305066 00301000
SVC26 EQU 26 SVC 26 @V305066 00302000
EJECT 00303000
*********************************************************************** 00304000
* A D C O N T A B L E * 00305000
* THE FOLLOWING TABLE CONSISTS OF INDIVIDUAL TABLES USED TO MODIFY * 00306000
* DIFFERENT DTF TYPES. EACH INDIVIDUAL TABLE HAS A UNIQUE NAME TO * 00307000
* IDENTIFY IT. * 00308000
* THE TABLE LAYOUT IS AS FOLLOWS- * 00309000
* BYTE 1 CONTAINS THE COUNT OF ADCONS TO BE MODIFIED. * 00310000
* BYTE 2 CONTAINS THE BYTE COUNT FROM THE LOGIC MODULE ADDRESS TO * 00311000
* THE FIRST ADCON * 00312000
* SUBSEQUENT BYTES CONTAIN THE BYTE COUNT NEEDED TO ADDRESS THE NEXT * 00313000
* ADCON. * 00314000
*********************************************************************** 00315000
SPACE 2 00316000
CPTBL1 DC X'03080808' DTFCP TAPE INPUT @V305066 00317000
CPTBL2 DC X'021008' DTFCP TAPE OUTPUT @V305066 00318000
CPTBL3 DC X'020808' @V305066 00319000
CPTBL4 DC X'011C' DTFCP DISK TABLE1 @V305066 00320000
CPTBL5 DC X'0114' DTFCP DISK @V305066 00321000
CPTBL6 DC X'0130' @V305066 00322000
CPTBL7 DC X'020808' @V305066 00323000
CPTBL8 DC X'0458080808' @V305066 00324000
CPTBL9 DC X'03080808' @V305066 00325000
DITBL DC X'061C1418080808' COMMON TABLE FOR DTFDI @V305066 00326000
DC X'0178' @V305066 00327000
DC X'0104' @V305066 00328000
DITBLOUT DC X'03080808' TABLE FOR DTFDI OUTPUT @V305066 00329000
EJECT 00330000
REGEQU @V305066 00331000
DMSOR2 CSECT @V305066 00332000
LTORG @V305066 00333000
END 00335000