LAF TITLE 'DMSLAF (CMS) VM/370 - RELEASE 6' 00001000
SPACE 2 00002000
*. 00003000
* MODULE NAME: 00005000
* 00006000
* DMSLAF 00007000
* 00008000
* CONTENTS: 00009000
* 00010000
* DMSLAFP 00011000
* DMSLAFNX 00012000
* DMSLAFFE 00013000
* DMSLAFFT 00014000
* 00015000
* SUBROUTINE: 00016000
* 00017000
* DMSLAFP (ACTLKP) 00018000
* 00019000
* FUNCTION: 00020000
* 00021000
* FIND THE ACTIVE FILE TABLE BLOCK WHOSE FILENAME, 00022000
* FILETYPE, AND MODE MATCH THE ONE SUPPLIED BY THE 00023000
* CALLER. 00024000
* 00025000
* ATTRIBUTES: 00026000
* 00027000
* NUCLEUS RESIDENT, RE-ENTRANT 00028000
* 00029000
* ENTRY POINTS: 00030000
* 00031000
* DMSLAFP 00032000
* 00033000
* ENTRY CONDITIONS: 00034000
* 00035000
* L R15, AACTLKP WHERE AACTLKP=V(DMSLAF) 00036000
* BALR R14, R15 00037000
* 00038000
* 00039000
* R0=0: START SEARCH AT BEGINNING OF ACTIVE FILE TABLE. 00040000
* 00041000
* OR 00042000
* 00043000
* R0=NONZERO: GIVEN PRESENT ACTIVE FILE TABLE BLOCK, RESUME 00044000
* SEARCHING AT NEXT AFT BLOCK (IF ANY). 00045000
* 00046000
* R1 MUST POINT TO PARAMETER LIST AS USUAL: 00047000
* 00048000
* DS OF 00049000
* PLIST DC CL8' ' IMMATERIAL 00050000
* DC CL8' ' FILENAME 00051000
* DC CL8' ' FILETYPE 00052000
* DC CL2' ' MODE 00053000
* 00054000
* R13 MUST POINT TO A SAVE-AREA OF AT LEAST TEN WORDS 00055000
* (NORMALLY WOULD POINT TO FVS=DISK$SEG AREA). 00056000
* 00057000
* EXIT CONDITIONS: 00058000
* 00059000
* MATCH FOUND 00060000
* 00061000
* R1=ADDRESS OF MATCHING ACTIVE FILE TABLE BLOCK 00062000
* R15=0 (AND CONDITION-CODE=0) 00063000
* 00064000
* MATCH NOT FOUND 00065000
* 00066000
* R1 SAME AS AT ENTRY 00067000
* R15=1 (AND CONDITION-CODE=2) 00068000
* 00069000
* CALLS TO OTHER ROUTINES: 00070000
* 00071000
* NONE 00072000
* EXTERNAL REFERENCES: 00073000
* 00074000
* AFTSECT 00075000
* 00076000
* TABLES / WORKAREAS: 00077000
* 00078000
* NONE 00079000
* 00080000
* REGISTER USAGE: 00081000
* 00082000
* R15 - BASE 00083000
* R3 - PLIST 00084000
* R13 - ACTSECT 00085000
* R1 - AFTSECT 00086000
* REST- WORK 00087000
* 00088000
* OPERATION: 00089000
* 00090000
* IF R0=0 AT ENTRY, DMSLAF STARTS SEARCHING THE ACTIVE 00091000
* FILE TABLE AT THE FIRST BLOCK (AT FVSAFT). IF 00092000
* R0=NONZERO AT ENTRY, THE GIVEN VALUE IN R0 IS TAKEN 00093000
* AS THE ADDRESS OF THE PRESENT AFT BLOCK, AND 00094000
* SEARCHING COMMENCES WITH THE NEXT BLOCK (IF ANY). 00095000
* (THIS FEATURE FACILITATES SEARCHING FOR MORE THAN ONE 00096000
* MATCHING FILE BY THE CALLING FUNCTION.) 00097000
* 00098000
* DMSLAF EXAMINES EACH BLOCK IN THE ACTIVE FILE TABLE 00099000
* FOR A FILENAME, FILETYPE, AND FILEMODE 00100000
* MATCHING THOSE IN THE PARAMETER LIST. IF THE GIVEN 00101000
* FILENAME AND/OR FILETYPE WAS SPECIFIED AS '*' IN THE 00102000
* PARAMETER LIST, A MATCHING FILENAME OR FILETYPE, 00103000
* RESPECTIVELY, IS ASSUMED. IF THE MODE WAS SPECIFIED 00104000
* AS EITHER '*', BINARY 0, BLANK (X'40'), OR X'FF', THE 00105000
* MODE IS ASSUMED CORRECT. IF NOT, THE GIVEN MODE 00106000
* LETTER MUST EQUAL THE MODE IN THE ACTIVE FILE TABLE 00107000
* BLOCK FOR A MATCH. (IT IS NOT NECESSARY TO CHECK THE 00108000
* MODE NUMBER.) 00109000
* 00110000
* EXIT CONDITIONS ARE RETURNED AS SPECIFIED ABOVE, WITH 00111000
* THE ADDRESS OF THE MATCHING BLOCK (IF ANY) RETURNED 00112000
* IN R1. THE CONDITION-CODE IS SET PER R15, FOR 00113000
* CONVENIENCE OF THE CALLER. 00114000
* 00115000
* SUBROUTINE NAME: 00116000
* 00117000
* DMSLAFNX 00118000
* 00119000
* FUNCTION: 00120000
* 00121000
* FIND THE NEXT (OR FIRST) AFT BLOCK IN THE ACTIVE FILE 00122000
* TABLE. 00123000
* 00124000
* ATTRIBUTES: 00125000
* 00126000
* NUCLEUS RESIDENT, RE-ENTRANT 00127000
* 00128000
* ENTRY POINTS: 00129000
* 00130000
* DMSLAFNX (ACTNXT) 00131000
* 00132000
* ENTRY CONDITIONS: 00133000
* 00134000
* L R15, AACTNXT WHERE AACTNXT=V(DMSLAFNX) 00135000
* BALR R14,R15 00136000
* 00137000
* 00138000
* R1=0: FIND FIRST ACTIVE FILE TABLE BLOCK. 00139000
* OR 00140000
* R1=NONZERO: GIVEN PRESENT ACTIVE FILE TABLE BLOCK, FIND 00141000
* NEXT AFT BLOCK (IF ANY). 00142000
* 00143000
* EXIT CONDITIONS: 00144000
* 00145000
* R1=0: NO MORE BLOCKS IN ACTIVE FILE TABLE. 00146000
* R1=NONZERO: R1 HOLDS ADDRESS OF NEXT (OR FIRST) AFT BLOCK. 00147000
* R15=0 (IN ANY EVENT) (AND CONDITION-CODE=0) 00148000
* 00149000
* CALLS TO OTHER ROUTINES: 00150000
* 00151000
* NONE 00152000
* 00153000
* EXTERNAL REFERENCES: 00154000
* 00155000
* AFTSECT 00156000
* 00157000
* TABLES / WORKAREAS: 00158000
* 00159000
* NONE 00160000
* 00161000
* REGISTER USAGE: 00162000
* 00163000
* R15 - BASE 00164000
* R1 - AFTSECT 00165000
* R14 - RETURN 00166000
* 00167000
* OPERATION: 00168000
* 00169000
* IF R1 =0 AT ENTRY, THE ADDRESS OF THE FIRST ACTIVE 00170000
* FILE TABLE BLOCK (FVSAFT) IS RETURNED. 00171000
* 00172000
* IF R1=NONZERO AT ENTRY, THE GIVEN VALUE IN R1 IS 00173000
* TAKEN AS THE ADDRESS OF THE PRESENT AFT BLOCK, AND 00174000
* THE POINTER TO THE NEXT AFT BLOCK (IF ANY) IS LOADED 00175000
* INTO R1 (WITH THE HIGH-ORDER BYTE STRIPPED OFF). 00176000
* 00177000
* IN EITHER EVENT, NO CHECK IS MADE AS TO WHETHER THE 00178000
* AFT BLOCK WHOSE ADDRESS IS RETURNED CONTAINS AN 00179000
* ACTIVE FILE (THIS BEING DONE BY THE CALLER). 00180000
* 00181000
* DMSLAFNX CAN BE USED (FOR EXAMPLE, BY DMSERS) FOR 00182000
* SCANNING THROUGH THE ACTIVE FILE TABLE FOR PARTICULAR 00183000
* CONDITIONS OTHER THAN MIGHT BE FOUND BY CALLING 00184000
* DMSLAF. 00185000
* 00186000
* NOTE: DMSLAFNX IS AN ENTRY-POINT IN THE ACTLKP 00187000
* ROUTINE. 00188000
* 00189000
* 00190000
* SUBROUTINE NAME: 00191000
* 00192000
* DMSLAFFE (ACTFREE) 00193000
* 00194000
* FUNCTION: 00195000
* 00196000
* FIND AN EMPTY BLOCK IN THE ACTIVE FILE TABLE, OR ADD 00197000
* A NEW BLOCK FROM FREE STROAGE TO THE ACTIVE FILE 00198000
* TABLE, IF NECESSARY, AND PLACE A FILE STATUS TABLE 00199000
* ENTRY (IF GIVEN) INTO THE AFT BLOCK. 00200000
* 00201000
* ATTRIBUTES: 00202000
* 00203000
* NUCLEUS RESIDENT - RE-ENTRANT 00204000
* 00205000
* ENTRY CONDITIONS: 00206000
* 00207000
* 00208000
* R0 MUST POINT TO ACTIVE DISK TABLE. 00209000
* 00210000
* R1 POINTS TO FST ENTRY (OR = 0). 00211000
* 00212000
* R11 MUST POINT TO PARAMETER LIST BELONGING TO CALLER 00213000
* (P-LIST 00214000
* PROVIDED TO DMSBRD, DMSBWR, OR DMSPNT, ETC.). 00215000
* 00216000
* R13 MUST POINT TO A SAVE-AREA OR AT LEAST TEN WORDS 00217000
* (NORMALLY WOULD POINT TO FVS=DISK$SEG AREA). 00218000
* 00219000
* EXIT CONDITIONS: 00220000
* 00221000
* R1 = ADDRESS OF ACTIVE FILE TABLE BLOCK USED OR 00222000
* NEWLY CREATED. 00223000
* 00224000
* R15 =0 (AND CONDITION-CODE = 0). 00225000
* 00226000
* CALLS TO OTHER ROUTINES: 00227000
* 00228000
* DMSFREE 00229000
* 00230000
* EXTERNAL REFERENCES: 00231000
* 00232000
* AFTSECT, ADTSECT, FSTSECT 00233000
* 00234000
* TABLES / WORKAREAS: 00235000
* 00236000
* GETS AN AFT AREA IF NECESSARY. 00237000
* 00238000
* REGISTER USAGE: 00239000
* 00240000
* B12 - BASE 00241000
* B13 - ACTSECT 00242000
* R1 - AFTSECT 00243000
* REST- WORK 00244000
* 00245000
* OPERATION: 00246000
* 00247000
* DMSLAFFE IS CALLED BY DMSBRD, DMSBWR, OR DMSPNT FOR 00248000
* PLACING A 40-BYTE FILE STATUS TABLE ENTRY IN THE 00249000
* ACTIVE FILE TABLE, 00250000
* AFTER A CALL TO DMSLFS OR DMSLFSW TO DETERMINE THE 00251000
* LOCATION OF THE FST ENTRY. (FOR A NEW FILE BEING 00252000
* CREATED BY DMSBWR, R1=0 AT 00253000
* ENTRY INDICATING A NEW FST ENTRY IS ABOUT TO BE 00254000
* CREATED.) 00255000
* 00256000
* DMSLAFFE SCANS THROUGH THE ACTIVE FILE TABLE LOOKING 00257000
* FOR AN EMPTY 00258000
* SLOT, DETERMINED BY THE AFTUSED BIT OF AFTFLG FOR A 00259000
* GIVEN BLOCK BEING 0. IF AN EMPTY BLOCK IS NOT FOUND, 00260000
* A NEW BLOCK IS 00261000
* OBTAINED FROM FREE STORAGE VIA DMSFREE AND CHAINED 00262000
* ONTO THE END 00263000
* OF THE ACTIVE FILE TABLE; AND A BIT (AFTFSF) IS SET 00264000
* TO INDICATE THAT THE BLOCK IS IN FREE STORAGE. 00265000
* 00266000
* AFTER THE EMPTY BLOCK IS FOUND OR CREATED, DMSLAFFE 00267000
* CLEARS THE FIRST 00268000
* 104 BYTES, STORES NECESSARY POINTERS, AND MOVES THE 00269000
* 40-BYTE FST ENTRY (IF PROVIDED) INTO THE SPACE 00270000
* PROVIDED AT AFTFST. 00271000
* 00272000
* THE MODE-LETTER STORED AT AFTM IN THE ACTIVE FILE 00273000
* TABLE IS CAREFULLY CHOSEN FROM THAT OF THE CALLER'S 00274000
* PARAMETER LIST (GIVEN BY R11 AT ENTRY), OR THE ADTM 00275000
* OR ADTMX MODE GIVEN BY THE ACTIVE DISK TABLE. THE 00276000
* STATE FUNCTIONE USES THE SAME ALGORITHM FOR CHOOSING 00277000
* THIS MODE-LETTER. 00278000
* 00279000
* THE RESULT OF THE CHOICE OF MODE-LETTER FACILITATES 00280000
* THE FEATURE OF A READ-ONLY EXTENSION OF A GIVEN DISK. 00281000
* FOR EXAMPLE, IF A C-DISK IS A READ-ONLY EXTENSION OF 00282000
* AN A-DISK AND THE CALLER'S PARAMETER LIST SPECIFIED 00283000
* THE C-MODE, THE MODE STORED WILL BE C; BUT IF THE 00284000
* CALLER SPECIFIED A OR '*', THE MODE STORED WILL BE A. 00285000
* 00286000
* NOTE: DMSLAFFE IS AN ENTRY-POINT IN THE DMSLAF 00287000
* ROUTINE. 00288000
* 00289000
* 00290000
* SUBROUTINE NAME: 00291000
* 00292000
* DMSLAFFT (ACTFRET) 00293000
* 00294000
* FUNCTION: 00295000
* 00296000
* REMOVE AN AFT BLOCK FROM THE ACTIVE FILE TABLE, 00297000
* RETURNING IT TO FREE STORAGE IF APPROPRIATE. 00298000
* 00299000
* ENTRY CONDITIONS: 00300000
* 00301000
* L R15,AACTFRET WHERE AACTFRET=V(DMSLAFFT) 00302000
* BALR R14, R15 00303000
* 00304000
* 00305000
* R1 MUST HOLD THE ADDRESS OF THE AFT BLOCK BEING 00306000
* RETURNED. 00307000
* 00308000
* R13 MUST POINT TO A SAVE-AREA OF AT LEAST TEN WORDS 00309000
* (NORMALLY WOULD POINT TO FVS = DISK$SEG AREA). 00310000
* 00311000
* EXIT CONDITIONS: 00312000
* 00313000
* RETURNED BLOCK WAS IN AFT TABLE 00314000
* 00315000
* R15=0 (AND CONDITION-CODE=0) 00316000
* 00317000
* RETURNED BLOCK WAS NOT IN AFT TABLE 00318000
* 00319000
* R15=1 (AND CONDITION-CODE=2) 00320000
* 00321000
* CALLS TO OTHER ROUTINES: 00322000
* 00323000
* DMSFRET 00324000
* 00325000
* EXTERNAL REFERENCES: 00326000
* 00327000
* AFTSECT 00328000
* 00329000
* TABLES / WORKAREAS: 00330000
* 00331000
* NONE 00332000
* 00333000
* REGISTER USAGE: 00334000
* 00335000
* R12 - BASE 00336000
* R13 - ACTSECT 00337000
* R1 - AFTSECT 00338000
* REST- WORK 00339000
* 00340000
* OPERATION: 00341000
* 00342000
* THE ACTIVE FILE TABLE IS SEARCHED TO FIND THE AFT 00343000
* BLOCK MATCHING THE ADDRESS PROVIDED BY THE CALLER. 00344000
* WHEN IT IS FOUND, THE AFTGLG FLAG-BYTE AND AFTPFST 00345000
* POINTER ARE CLEARED (IT IS NOT NECESSARY TO CLEAR ALL 00346000
* THE OTHER INFORMATION). IF THE AFT 00347000
* BLOCK WAS IN FREE STORAGE, IT IS GIVEN BACK VIA 00348000
* DMSFRET, AND THE CHAIN PATCHED ACCORDINGLY. 00349000
* 00350000
* IF THE AFT BLOCK ADDRESS PROVIDED IN R1 AT ENTRY TIME 00351000
* IS NOT FOUND IN THE ACTIVE FILE TABLE, THIS INDICATES 00352000
* A PROGRAMMING BUG ON THE PART OF THE CALLER. AS A 00353000
* DEBUGGING AID, AN ERROR CODE 1 IS RETURNED. 00354000
* 00355000
* NOTE: DMSLAFFT IS AN ENTRY-POINT IN THE DMSLAF 00356000
* ROUTINE. 00357000
* 00358000
*. 00359000
EJECT 00360000
DMSLAF START 0 00361000
SPACE 00362000
ENTRY ACTLKP P3035 00363000
ACTLKP EQU DMSLAF P3035 00364000
SPACE 00365000
USING *,R15 P3035 00366000
USING ACTSECT,R13 P3035 00367000
STM R12,R5,ACTREGS P3035 00368000
LR R3,R1 COPY POINTER TO PARAMETER LIST 00369000
USING PLSECT,R3 00370000
LA R4,ACTLKP4 (FOR BCR'S) 00371000
LA R5,ACTRET (FOR BCR'S) 00372000
LR R2,R5 DEFAULT R2 TO GO TO "ACTRET" @VA01535 00372100
LTR R1,R0 WAS 'PRESENT' ACTIVE-FILE-TABLE-ENTRY GIVEN? 00373000
BCR 7,R4 BNZ IF YES, GET NEXT ENTRY (IF ANY) AT ACTLKP4 00374000
L R1,ACTAFT LOAD POINTER TO ACTIVE FILE TABLE 00375000
USING AFTSECT,R1 00376000
ACTLKP1 EQU * 00377000
TM AFTFLG,AFTUSED IS ANYTHING THERE AT ALL ? 00378000
BCR 8,R4 'BZ' IF NOT, TRY NEXT ONE. 00379000
CLI PLN,C'*' TEST FOR ASTERISK IN PARAMETER LIST 00380000
BE SETUP1 IF FILENAME = ASTERISK GO SET R2 @VA01535 00381100
CLC PLN(8),AFTN TEST FOR MATCHING FILE NAME 00382000
BCR 7,R4 MOVE TO NEXT AFT BLOCK IF NO MATCH 00383000
CLI PLT,C'*' TEST FOR ASTERISK IN PLACE OF FILE TYPE 00385000
BE SETUP2 IF FILETYPE = ASTERISK GO SET R2 @VA01535 00386100
ACTLKP2 EQU * FILENAME OK; FILETYPE NOT '*' .. @VA03768 00386200
CLC PLT(8),AFTT TEST FOR MATCHING FILE TYPE 00387000
BCR 7,R4 MOVE TO NEXT AFT BLOCK IF NO MATCH 00388000
ACTLKP3 EQU * 00389000
CLI PLM,C'*' TEST FOR ASTERISK IN PLACE OF FILE MODE 00390000
BCR 8,R5 RETURN WITH AFT POINTER IN R1 IF ASTERISK 00391000
CLC PLM(1),AFTM TEST FOR MATCHING FILE MODE 00392000
BCR 8,R2 "BE ACTRET" IF FILENAME AND @VA01535 00393100
* FILETYPE WERE EXPLICITLY SPECIFIED 00393200
* (RETURN WITH AFT POINTER IN R1). 00393300
* OR: "BE CHECKNUM" IF FILENAME AND/OR 00393400
* FILETYPE WAS ASTERISK, TO CHECK THAT 00393500
* MODE NUMBER (IF SPECIFED) IS CORRECT. 00393600
CLI PLM,X'FF' BRANCH IF FILE MODE NOT SPECIFIED 00394000
BCR 8,R5 ... 00395000
CLI PLM,C' ' TEST FOR BLANK IN PLACE OF FILE MODE 00396000
BCR 8,R5 RETURN IF BLANK FILE MODE 00397000
CLI PLM,X'00' TEST FOR ZERO IN PLACE OF FILE MODE 00398000
BCR 8,R5 RETURN WITH AFT POINTER IF ZERO MODE 00399000
CLI PLM,C'(' TEST FOR LEFT PAREN FOR MODE 00400000
BCR 8,R5 RETURN WITH AFT POINTER IF '(' 00401000
ACTLKP4 EQU * 00402000
L R1,AFTPTR LOAD POINTER TO NEXT AFT BLOCK IN CHAIN 00403000
N R1,ADDONLY CHECK ADDRESS OF NEW AFT BLOCK 00404000
BNZ ACTLKP1 KEEP LOOKING IF MORE AFT BLOCK(S). 00405000
B ACTRET1 ERROR 1 IF NOT FOUND. 00406000
SPACE 00406015
SETUP1 LA R2,CHECKNUM FOR FILENAME = ASTERISK, SET R2; @VA03768 00406030
CLI PLT,C'*' FILETYPE ALSO ASTERISK ? @VA03768 00406045
BNE ACTLKP2 NO - HANDLE NORMALLY. @VA03768 00406060
CLI PLM,C'A' WAS THE MODE FROM A TO Z ? @VA03768 00406075
BL ACTLKP3 NO - HANDLE NORMALLY. @VA03768 00406090
CLI PLM,C'Z' CHECK FURTHER ... @VA03768 00406105
BH ACTLKP3 NO - HANDLE NORMALLY. @VA03768 00406120
* FILENAME/FILETYPE BOTH ASTERISK, MODE-LETTER A TO Z: 00406135
L R14,AFTADT REFERENCE THE REAL DISK @VA03768 00406150
USING ADTSECT,R14 ... @VA03768 00406165
CLC PLM(1),ADTM CHECK THE "REAL" DISK MODE @VA03768 00406180
BCR 8,R2 "BE CHECKNUM" IF A "MATCH". @VA03768 00406195
DROP R14 IF NO MATCH, @VA03768 00406210
BR R4 GO DIRECTLY TO ACTLKP4. @VA03768 00406225
SPACE 00406240
SETUP2 LA R2,CHECKNUM FOR FILETYPE = ASTERISK, SET R2 @VA01535 00406250
B ACTLKP3 TO CHECK THE MODE NUMBER LATER. @VA01535 00406300
SPACE 00406350
CHECKNUM EQU * NECESSARY TO CHECK MODE NUMBER: @VA01535 00406400
CLI PLM+1,C' ' TEST FOR BLANK FILE MODE NUMBER @VA01535 00406450
BCR 8,R5 RETURN WITH AFT POINTER IF BLANK @VA01535 00406500
CLC PLM+1(1),AFTM+1 TEST FOR MATCHING FILE MODE NO. @VA01535 00406550
BCR 8,R5 IF MATCH RETURN WITH AFT POINTER @VA01535 00406600
BR R4 NO MATCH - TRY NEXT AFT BLOCK. @VA01535 00406650
SPACE 00406700
DROP R1,R3,R13,R15 00407000
EJECT 00408000
DMSLAFFT DS 0H P3035 00409000
SPACE 00410000
ENTRY DMSLAFFT P3035 00411000
ENTRY ACTFRET P3035 00412000
ACTFRET EQU DMSLAFFT P3035 00413000
SPACE 00414000
USING *,R15 P3035 00415000
USING ACTSECT,R13 P3035 00416000
STM R12,R5,ACTREGS P3035 00417000
DROP R15 00418000
LR R12,R15 ADDRESSABILITY INTO R12 00419000
USING DMSLAFFT,R12 P3035 00420000
LA R2,0(,R1) COPY ADDRESS OF AFT BLOCK 00421000
L R1,ACTAFT START WITH FIRST AFT BLOCK 00422000
USING AFTSECT,R1 00423000
ACTFRT1 EQU * 00424000
CR R2,R1 IS THIS THE BLOCK BEING RETURNED ? 00425000
BE ACTFRT2 BE IF YES. 00426000
LR R3,R1 REMEMBER ADDRESS OF OLD BLOCK 00427000
L R1,AFTPTR POINT TO NEXT AFT BLOCK 00428000
N R1,ADDONLY (ADDRESS BITS ONLY & SET C.C.) 00429000
BNZ ACTFRT1 KEEP CHECKING 00430000
ACTRET1 LM R12,R5,ACTREGS RESTORE REGISTERS 00431000
LA R15,1 ERROR CODE 1 00432000
LTR R15,R15 SET CONDITION-CODE FOR CONVENIENCE OF CALLER 00433000
BR R14 RETURN TO CALLER. 00434000
SPACE 00435000
ACTFRT2 XC AFTFLG(4),AFTFLG CLEAR FLAG & POINTER 00436000
TM AFTPTR,AFTFSF IS THIS SLOT IN FREE STORAGE ? 00437000
BZ ACTRET0 BZ IF NOT (WE'RE ALL DONE). 00438000
MVC AFTPTR+1-AFTSECT(3,R3),AFTPTR+1 PATCH CHAIN 00439000
LA R0,AFTLD LOAD LENGTH OF AFT BLOCK IN DOUBLE WORDS 00440000
DMSFRET DWORDS=(0),LOC=(1),TYPCALL=BALR 00441000
B ACTRET0 00442000
DROP R1,R12,R13 00443000
EJECT 00444000
DMSLAFNX DS 0H P3035 00445000
SPACE 00446000
ENTRY DMSLAFNX P3035 00447000
ENTRY ACTNXT P3035 00448000
ACTNXT EQU DMSLAFNX P3035 00449000
SPACE 00450000
USING *,R15 ADDRESSABILITY 00451000
LTR R1,R1 TEST FOR POINTER 00452000
BZ ACTNXT1 IF NO POINTER FIND FIRST AFT BLOCK 00453000
USING AFTSECT,R1 00454000
L R1,AFTPTR LOAD POINTER TO NEXT AFT BLOCK 00455000
LA R1,0(,R1) (ADDRESS BITS ONLY, FOR CALLER) 00456000
SR R15,R15 SUCCESSFUL 00457000
BR R14 RETURN. 00458000
SPACE 00459000
ACTNXT1 EQU * 00460000
L R1,ACTAFT LOAD POINTER TO FIRST ACTIVE FILE 00461000
SR R15,R15 SUCCESSFUL 00462000
BR R14 RETURN. 00463000
DROP R1,R15 00464000
EJECT 00465000
DMSLAFFE DS 0H P3035 00466000
SPACE 00467000
ENTRY DMSLAFFE P3035 00468000
ENTRY ACTFREE P3035 00469000
ACTFREE EQU DMSLAFFE P3035 00470000
SPACE 00471000
USING *,R15 P3035 00472000
USING ACTSECT,R13 P3035 00473000
STM R12,R5,ACTREGS P3035 00474000
DROP R15 00475000
LR R12,R15 ADDRESSABILITY INTO R12 00476000
USING DMSLAFFE,R12 P3035 00477000
LR R2,R0 COPY ADT POINTER 00478000
LR R3,R1 COPY FST POINTER 00479000
L R1,ACTAFT START WITH CORE-RESIDENT AFT 00480000
USING AFTSECT,R1 ... 00481000
ACTFREE1 TM AFTFLG,AFTUSED IS THERE AN EMPTY SLOT ? 00482000
BZ ACTFREE2 BZ IF YES, USE IT. 00483000
LR R4,R1 REMEMBER OLD AFT BLOCK, 00484000
L R1,AFTPTR POINT TO NEXT AFT BLOCK (IF ANY) 00485000
N R1,ADDONLY ... 00486000
BNZ ACTFREE1 KEEP LOOKING IF THERE IS ONE. 00487000
LA R0,AFTLD LENGTH OF AN AFT-BLOCK IN DOUBLE WORDS 00488000
DMSFREE DWORDS=(0),TYPE=NUCLEUS,TYPCALL=BALR 00489000
DROP R1 (BRIEFLY) 00490000
USING AFTSECT,R4 ... 00491000
IC R5,AFTPTR SAVE OLD FLAG BYTE, 00492000
ST R1,AFTPTR PATCH THE CHAIN - POINT TO NEW BLOCK 00493000
STC R5,AFTPTR PUT BACK OLD FLAG BYTE 00494000
DROP R4 NOW BACK TO NORMAL 00495000
USING AFTSECT,R1 ... 00496000
SR R5,R5 CLEAR POINTER TO NEXT ONE 00497000
ST R5,AFTPTR ... 00498000
MVI AFTPTR,AFTFSF AND INDICATE THIS ONE IS IN FREE STORAGE. 00499000
ACTFREE2 XC AFTSECT(AFTFST-AFTSECT),AFTSECT CLEAR FIRST 104 BYTES, 00500000
ST R3,AFTPFST-1 STORE ADDRESS OF 40-BYTE FST ENTRY 00501000
MVI AFTFLG,AFTUSED AND INIDCATE AFT-ENTRY IN USE 00502000
ST R2,AFTADT STORE ADT POINTER IN AFT 00503000
LTR R3,R3 TEST FOR NO FST BLOCK 00504000
BZ ACTRET BRANCH IF NO FST BLOCK 00505000
MVC AFTFST(FSTL),0(R3) COPY FST-ENTRY TO ACTIVE TABLE 00506000
MVI AFTFB,00 CLEAR FLAG-BYTE IN AFT-BLOCK. 00507000
USING ADTSECT,R2 (REFERENCE ACTIVE-DISK-TABLE) 00508000
USING FSTSECT,R3 (AND FST-TABLE) 00509000
USING PLSECT,R11 REFER TO P-LIST GIVEN TO CALLER 00510000
IC R14,PLM TENTATIVELY CHOOSE MODE IN P-LIST 00511000
CLI PLM,C'A' DID PARAMETER-LIST SPECIFY MODE ? 00512000
BL NOTAZ BL IF NOT. 00513000
CLI PLM,C'Z' (KEEP CHECKING) 00514000
BNH STCR14 BNH IF P-LIST SPECIFIED MODE FROM A TO Z. 00515000
NOTAZ IC R14,ADTM IF NOT, CHOOSE PRIMARY MODE LETTER 00516000
CLI ADTMX,C'A' DOES 'EXTENSION-MODE-LETTER' EXIST ? 00517000
BL STCR14 BL IF NOT (WE'RE ALL SET). 00518000
TM ADTFLG1,ADTFRW IF YES, READ-ONLY OR READ-WRITE ? 00519000
BO STCR14 BO IF READ-WRITE, STAY WITH PRIMARY MODE 00520000
IC R14,ADTMX BUT USE EXTENSION-LETTER IF READ-ONLY DISK 00521000
STCR14 STC R14,AFTM STORE CAREFULLY-CHOSEN MODE-LETTER. 00522000
DROP R2,R3,R11 00523000
ACTRET ST R1,ACTREG1 RETURN WITH VALUE IN R1 00524000
ACTRET0 LM R12,R5,ACTREGS RESTORE REGISTERS 00525000
SR R15,R15 00526000
BR R14 00527000
DROP R1,R12,R13 00528000
EJECT 00529000
*********************************************************************** 00530000
* 00531000
* CONSTANTS AND EXTERNAL ROUTINE LOCATIONS 00532000
* 00533000
*********************************************************************** 00534000
* 00535000
ACTAFT DC V(AFTSTART) ADDRESS OF ACTIVE FILE TABLE 00536000
ADDONLY DC X'00FFFFFF' (TO ISOLATE ADDRESS BITS & SET C.C.) 00537000
SPACE 00538000
LTORG 00539000
SPACE 3 00540000
* 00541000
* ACTLKP FIXED VARIABLE STORAGE 00542000
* 00543000
ACTSECT DSECT 00544000
ACTREGS DS 10F 00545000
ACTREG1 EQU ACTREGS+20 REGISTER 1 00546000
* 00547000
* PARAMETER LIST DSECT 00548000
* 00549000
PLSECT DSECT 00550000
DS D 00551000
PLN DS D FILE NAME 00552000
PLT DS D FILE TYPE 00553000
PLM DS H FILE MODE 00554000
EJECT 00555000
AFT 00556000
ADT 00557000
FSTB 00558000
NUCON 00559000
REGEQU 00560000
END 00561000