MOD TITLE 'DMSMOD (CMS) VM/370 - RELEASE 6' 00001000
SPACE 2 00002000
*. 00003000
* 00004000
* 00005000
* 00006000
* MODULE NAME 00007000
* 00008000
* DMSMOD 00009000
* 00010000
* FUNCTION 00011000
* 00012000
* GENMOD. TO CREATE A FILE WHICH IS A CORE IMAGE COPY 00013000
* OF LOADED OBJECT CODE 00014000
* LOADMOD. LOAD A FILE WHICH IS IN CORE IMAGE FORM. 00015000
* 00016000
* ATTRIBUTES 00017000
* 00018000
* NUCLEUS RESIDENT, REENTRANT 00019000
* 00020000
* ENTRY POINTS 00021000
* 00022000
* DMSMOD - FOR BOTH GENMOD AND LOADMOD COMMANDS 00023000
* 00024000
* ENTRY CONDITIONS 00025000
* 00026000
* GPR1 - A(PLIST) 00027000
* GPR15- A(DMSMOD) 00028000
* 00029000
* PLIST- CL8'GENMOD' 00030000
* CL8'FILENAME' 00031000
* <CL8'MODULE'> 00032000
* <CL8'FILEMODE'> 00033000
* <CL8'('> 00034000
* <CL8'OPTION'> FOR EACH OPTION 00035000
* OPTIONS- 00036000
* MAP/NOMAP 00037000
* NOSTR/STR 00038000
* FROM ENTRY 00039000
* TO ENTRY 00040000
* XL8'FF' 00041000
* 00042000
* OR 00043000
* 00044000
* CL8'LOADMOD' 00045000
* CL8'FILENAME' 00046000
* <CL8'MODULE'> 00047000
* <CL8'FILEMODE'> 00048000
* XL8'FF' 00049000
* 00050000
* EXIT CONDITIONS 00051000
* 00052000
* GENMOD- 00053000
* 00054000
* NORMAL GPR15=0 00055000
* ERROR GPR15=ERROR CODE 00056000
* 00057000
* ERROR MESSAGES RC 00058000
* 00059000
* 003E INVALID OPTION 24 00060000
* 005E NO (FROM|TO) ENTRY SPECIFIED 24 00061000
* 021E ENTRY POINT NOT FOUND 40 00062000
* 032E INVALID FILETYPE 24 00063000
* 037E DISK 'MODE' IS READ/ONLY 36 00064000
* 040E NO FILES LOADED 40 00065000
* 070E INVALID PARAMETER 24 00066000
* 084E INVALID OPTION USE 24 00067000
* 105S ERROR WRITING FILE ON DISK 100 00068000
* 00069000
* LOADMOD- 00070000
* 00071000
* NORMAL GPR15=0 00072000
* ERROR GPR15=ERROR CODE 00073000
* 00074000
* ERROR MESSAGES RC 00075000
* 00076000
* 001E NO FILENAME SPECIFIED 24 00077000
* 002E FILE NOT FOUND 28 00078000
* 032E INVALID FILETYPE 24 00079000
* 070E INVALID PARAMETER 24 00080000
* 104S ERROR READING FILE ON DISK 100 00081000
* 109S VIRTUAL STORAGE CAPACITY EXCEEDED 104 00082000
* 114E NOT LOADED, DOS/OS MISMATCH 40 00083000
* 116S LOADER TABLE OVERFLOW 104 00084000
* 00085000
* CALLS TO OTHER ROUTINES 00086000
* 00087000
* DMSERS 00088000
* DMSBWR 00089000
* DMSFNS 00090000
* DMSFREB 00091000
* DMSSMNSB 00092000
* DMSERR 00093000
* DMSSTT 00094000
* DMSBRD 00095000
* 00096000
* EXTERNAL REFERENCES 00097000
* 00098000
* FVS 00099000
* 00100000
* TABLES/WORKAREAS 00101000
* 00102000
* PSA - USED FOR DISK PLIST 00103000
* 00104000
* REGISTER USAGE 00105000
* 00106000
* GPR10 - FVS 00107000
* GPR13 - PSA 00108000
* GPR12 - BASE 00109000
* REST - WORK 00110000
* 00111000
* OPERATION 00112000
* 00113000
* GENMOD- 00114000
* 00115000
* GENMOD ISSUES THE START (NO) COMMAND TO FINISH LOADING OF 00116000
* OBJECT PROGRAMS. NEXT ERASE THE OLD MODULE IF IT EXISTS. 00117000
* THE START AND ENDING LOCATIONS ARE DETERMINED FROM THE 00118000
* USER OPTIONS 'TO' AND 'FROM' OR BY DEFAULT. THE DEFAULT 00119000
* START IS THE ADDRESS OF THE FIRST LOADER TABLE NAME, THE 00120000
* DEFAULT END IS THE CURRENT SETTING OF LOCCNT IN NUCON. 00121000
* AN EIGHTY BYTE RECORD IS WRITTEN AS THE FIRST RECORD OF THE 00122000
* THE MODULE. THIS RECORD CONSISTS OF THE NUCON LOADER INFORMA- 00123000
* TION. NEXT THE TEXT INFORMATION IS WRITTEN TO THE MODULE 00124000
* FILE IN VARIABLE SIZE RECORDS UP TO 65535 BYTES. IF THE 00125000
* MODULE IS NOT FOR A TRANSIENT ROUTINE AND NOMAP WAS NOT 00126000
* SPECIFIED THE LOADER TABLE IS WRITTEN AS THE LAST MODULE 00127000
* FILE RECORD. CLOSE THE NEW MODULE FILE AND RETURN TO THE 00128000
* CALLER. 00129000
* 00130000
* LOADMOD- 00131000
* 00132000
* LOADMOD CHECKS FOR THE EXISTENCE OF THE REQUESTED MODULE 00133000
* THEN READS THE TEXT INFORMATION INTO THE LOCATIONS SET 00134000
* UP WHEN THE MODULE WAS CREATED. THE MODULE NAME IS 00135000
* STORED IN THE APPROPRIATE NUCON LOCATION. IF THERE IS 00136000
* A LOADER TABLE RECORD IN THE MODULE IT IS READ INTO 00137000
* THE LOADER TABLE LOCATION IN STORAGE. SELECTED LOADER 00138000
* INFORMATION IS STORED IN NUCON. RETURN TO CALLER 00139000
*. 00140000
EJECT 00141000
DMSMOD START 0 00142000
USING *,R12 00143000
USING FREEST,R13 WORK AREA 00144000
USING NUCON,R0 00145000
LR R12,R15 ADDRESSIBILITY 00146000
LR R2,R1 PROTECT R1 00147000
LR R11,R14 SAVE RETURN ADDRESS 00148000
L R10,AFVS ADDR. OF FVSECT 00149000
USING FVSECT,R10 00150000
MVC DSKLIN(44),DSKLIS DISK PARAMETER LIST TO FREE STORAGE 00151000
SR R9,R9 CLEAR LOADMOD BUFFER REG. 00152000
CLI 0(R2),C'L' IS COMMAND LOADMOD 00153000
BE GOREAD YES 00154000
EJECT 00155000
*********************************************************************** 00156000
* 00157000
* GENMOD - CREATE A LOAD MODULE 00158000
* 00159000
*********************************************************************** 00160000
SPACE 00161000
LH R8,TBENT NO. OF LDR TBL ENTRIES 00162000
CH R8,=H'2' ANY LOADER TABLE ENTRIES 00163000
BNH ERR040E NO, NOTHING LOADED 00164000
CLC AUSRAREA+1(3),LOCCNT+1 HAS LOCATION COUNTER BEEN MOVED 00165000
BE ERR040E NO, NOTHING LOADED 00166000
ST R9,BUFF CLEAR FLAG AREA @V305032 00167000
NI LDRFLAGS+1,255-X'80' DEFAULT TO NOSTR OPTION 00168000
MVI MODFLGS,CLEAR CLEAR ALL GENMOD/LOADMOD FLAGS @V305066 00169000
* (DEFAULTING TO 'MAP' AND 'OS' OPTIONS) 00170000
LA R1,STARTLIS CALL START (NO) TO COMPLETE LOAD 00171000
SVC 202 00172000
DC AL4(*+4) 00173000
LA R2,8(0,R2) GET TO MODULE NAME 00174000
CLI 0(R2),X'FF' END OF PLIST 00175000
BE ERASE YES, CONTINUE V0415 00176000
GENMOD01 CLI 0(R2),C'(' IS THERE A MODULE NAME 00177000
BE ERASE NO, MUST USE DEFAULT NAME V0415 00178000
MVC DSKLIN+8(8),0(R2) YES, MOVE NAME TO DISK PLIST 00179000
LA R2,8(0,R2) GET PAST MODULE NAME 00180000
CLI 0(R2),C'(' OPTIONS NEXT 00181000
BE ERASE YES, DON'T LOOK FOR MODE 00182000
CLI 0(R2),X'FF' IS FILE MODE SPECIFIED 00183000
BE ERASE NO, ERASE OLD MODULE 00184000
CLC 0(8,R2),=CL8'MODULE' IS FILE TYPE MODULE 00185000
BNE ERR032E NO, ERROR 00186000
LA R2,8(0,R2) POINT TO MODE LOCATION V0415 00187000
CLI 0(R2),C'(' OPTIONS NEXT ? V0415 00188000
BE ERASE YES, USE DEFAULT MODE V0415 00189000
CLI 0(R2),X'FF' END OF PLIST V0415 00190000
BE ERASE YES, USE DEFAULT MODE V0415 00191000
MVC DSKLIN+24(2),0(R2) MOVE IN SPECIFIED MODE V0415 00192000
LA R2,8(0,R2) GET PAST MODE V0415 00193000
CLI DSKLIN+24,C'*' THIS MEANS USE DEFAULT @VA02568 00194000
BE ERASE MAKE IT AN 'A1' FILE @VA02568 00195000
CLI DSKLIN+24,C' ' SAME IF NO LETTER @VA02568 00196000
BE ERASE GIVEN AT ALL @VA02568 00197000
CLI DSKLIN+25,C' ' IF NO NUMBER, SAY ONE @VA02568 00198000
BNE ERASE1 OR LET IT GO @VA02568 00199000
MVI DSKLIN+25,C'1' HAVE TO GIVE A MODE NO @VA02568 00200000
B ERASE1 LET STATE FIND INVALIDS @VA02568 00201000
ERASE MVC DSKLIN+24(2),AONE USE DEFAULT FILE MODE 00202000
ERASE1 SR R5,R5 INITIALIZE R5 TO ZERO 00203000
L R6,LOCCNT INIT. R6 TO DEFAULT START ADDR. 00204000
CLI 0(R2),C'(' ANY OPTIONS 00205000
BE EXEC1 YES, PROCESS THEM 00206000
CLI 0(R2),X'FF' END OF PARAMETERS 00207000
BNE ERR070E NO, ERROR 00208000
B DEFAULTS USE DEFAULT 'FROM' AND 'TO' 00209000
EXEC1 LA R2,8(0,R2) GET TO 1ST (NEXT) USER OPTION 00210000
LA R1,OPT ADDR. OF OPTION TABLE 00211000
LA R3,OPTNO NUMBER OF LEGAL OPTIONS 00212000
CLI 0(R2),X'FF' END OF USER OPTIONS 00213000
BE DEFAULTS YES, VERIFY R5 AND R6 00214000
CLI 0(R2),C')' END OF OPTIONS ? 00215000
BE DEFAULTS YES 00216000
OPTIONB CLC 0(8,R2),0(R1) COMPARE USER TO LEGAL OPTION 00217000
BE EXEC THIS IS IT 00218000
LA R1,12(0,R1) NEXT LEGAL OPTION IN TBL 00219000
BCT R3,OPTIONB CHECK AGAINST ALL LEGAL OPTIONS 00220000
B ERR003E OPTION ERROR 00221000
EXEC EX 0,8(R1) TAKE APPROPRIATE ACTION 00222000
B EXEC1 DO NEXT OPTION 00223000
FROM LA R2,8(0,R2) GET TO NAME 00224000
LA R3,OPT IN CASE OF ERROR 00225000
BAL R15,SEARCH LOOK FOR NAME IN LDR TBL 00226000
TM DSKLIN+8,X'FF' IS DEFAULT MODULE NAME TO BE USED 00227000
BNO FROM1 NO, LEAVE PLIST NAME 00228000
MVC DSKLIN+8(8),0(R4) USE 'FROM' NAME AS MODULE NAME 00229000
FROM1 L R5,12(,R4) PUT ITS ADDR IN R5 00230000
LA R5,0(,R5) CLEAR HI BYTE 00231000
B EXEC1 DO NEXT OPTION 00232000
TO LA R2,8(0,R2) GET 'TO' NAME 00233000
LA R3,OPT+12 IN CASE OF ERROR 00234000
BAL R15,SEARCH LOOK FOR IT IN LDR TBL 00235000
L R6,12(,R4) PUT ITS ADDR IN R6 00236000
LA R6,0(0,R6) CLEAR HI BYTE 00237000
B EXEC1 DO NEXT OPTION 00238000
DEFAULTS TM MODFLGS,NOMAPFLG IS NOMAP OPTION ON? @VA02871 00239000
BZ DEFAULT1 NO, CONTINUE TO NEXT DEFAULT @VA02871 00240000
SR R8,R8 CLEAR LDR TBL COUNT @VA02871 00241000
DEFAULT1 LTR R5,R5 WAS 'FROM' SPECIFIED? @VA02871 00242000
BNE STM34 YES, WRITE FIRST RECORD 00243000
TM DSKLIN+8,X'FF' USE DEFAULT MODULE NAME 00244000
BO TO2 YES, DON'T SCAN LDR TBL 00245000
LH R0,TBENT NO OF LDR TBL ENTRIES 00246000
L R5,ALDRTBLS TOP OF LDR TBL 00247000
LA R5,0(0,R5) CLEAR HI BYTE 00248000
LA R7,20 SIZE OF EACH ENTRY 00249000
COMP1 SR R5,R7 1ST (NEXT) ENTRY 00250000
CLC DSKLIN+8(8),0(R5) IS THIS THE MODULE NAME 00251000
BE TO1 YES, USE ITS ADDR 00252000
BCT R0,COMP1 LOOK AT NEXT ENTRY 00253000
TO2 L R5,ALDRTBLS TOP OF LDR TBL 00254000
SH R5,=H'60' POINT TO THIRD ENTRY 00255000
TM DSKLIN+8,X'FF' USE DEFAULT MODULE NAME ? 00256000
BNO TO1 NO, LEAVE DISK PLIST AS IS 00257000
MVC DSKLIN+8(8),0(R5) YES, USE FIRST LDR TBL NAME 00258000
TO1 L R5,12(0,R5) LOAD ITS ADDR IN R5 00259000
LA R5,0(0,R5) CLEAR HI BYTE 00260000
STM34 LA R1,DSKLIN GET DISK PLIST 00261000
LR R15,R6 CHECK MODULE DEFINITION 00262000
SR R15,R5 R15 NOW HAS LENGTH 00263000
BNP ERR084E IF NOT POSITIVE THEN ERROR 00264000
L R15,ASTATEW CHECK FOR FILE (ON R/W DISK) @V305032 00265000
BALR R14,R15 00266000
BNZ MODSTER SOME ERROR 00267000
L R15,AERASE ADDR OF ERASE 00268000
BALR R14,R15 ERASE THE OLD MODULE 00269000
NOERASE C R5,AUSRAREA LOCATION AT START OF USER AREA? @VA09142 00270000
BNE TESTSTR NO @VA09142 00271000
TM BUFF,X'80' YES, WAS NOSTR SPECIFIED 00272000
BO TESTSTR YES @VA09142 00273000
OI BUFF,X'40' NO, INDICATE STRINIT CALL 00274000
TESTSTR EQU * 00274700
TM BUFF,X'40' STR OPTION REQUESTED? @VA09142 00275400
BNO STM56 NO 00276000
OI LDRFLAGS+1,X'80' YES, SET REAL STRINIT FLAG 00277000
STM56 STM R5,R6,FRSTLOC SET 1ST AND LAST LOCATIONS OF MODULE 00278000
C R5,ADTRANS IS IT IN TRANSIENT AREA 00279000
BNE STBUFF NO 00280000
SR R8,R8 YES, INDICATE NO LOAD MAP ON MODULE 00281000
TM LDRFLAGS,SYSTEM WAS "SYSTEM" OPTION SPECIFIED ? @V305032 00282000
BZ STBUFF NO - DO IT THE OLD WAY. @V305032 00283000
TM BUFF,STRINIT WAS STRINIT CALL REQUESTED ? @V305066 00284000
BNZ STBUFF YES - DO IT THE OLD WAY. @V305032 00285000
LA R1,DSKLIN NO - POINT TO WRBUF P-LIST, @V305032 00286000
MVI DSKLIN+FVEQU,FIX MAKE TRANSIENT MODULE FIXED @V305066 00287000
B WSETR3 GO SET R3 AND WRBUF THE MODULE. @V305032 00288000
STBUFF LA R0,10 GET BUFFER FOR FIRST RECORD 00289000
DMSFREE DWORDS=(0),TYPCALL=BALR 00290000
LR R9,R1 R9 IS BUFFER ADDRESS 00291000
ST R9,DSKLIN+28 PUT IN PLIST 00292000
MVC 0(80,R9),STRTADDR MOVE LOADER INFORMATION TO BUFFER 00293000
STH R8,TBENT-STRTADDR(R9) SAVE LDR TABLE COUNT 00294000
MVC DSKLIN+32(4),=XL4'50' SET TO WRITE 80 BYTES 00295000
LA R1,DSKLIN ADDR. OF WRITE PLIST 00296000
L R15,AWRBUF ADDR. OF WRBUF 00297000
BALR R14,R15 WRITE FIRST RECORD OF MODULE 00298000
BNZ WRTERR WRITE ERROR 00299000
WSETR3 L R3,F65535 MAX WRBUF SIZE IN R3 @V305032 00300000
SR R6,R5 LENGTH OF TEXT INFORMATION 00301000
WLOOP STM R5,R6,DSKLIN+28 STORE ADR. AND LENGTH IN WRITE PLIST 00302000
CR R6,R3 IS COUNT TOO BIG 00303000
BNH OKW NOT TOO BIG 00304000
ST R3,DSKLIN+32 IF TOO BIG, SUBSTITUTE MAX. SIZE 00305000
OKW L R15,AWRBUF 00306000
BALR R14,R15 WRITE SECOND RECORD 00307000
BNZ ERR105S WRITE ERROR 00308000
AR R5,R3 INCREMENT STARTING ADDR. 00309000
SR R6,R3 COMPUTE REMAINING LENGTH 00310000
BP WLOOP BP IF R4 > 0, WRITE SOME MORE 00311000
LTR R4,R8 SHOULD LDR TBLS BE WRITTEN 00312000
BZ FINMOD NO, FINIS MODULE 00313000
MH R4,=H'20' COMPUTE SIZE OF LDR TBL 00314000
L R3,ALDRTBLS TOP OF LDR TBL 00315000
LA R3,0(0,R3) CLEAR HI BYTE 00316000
SR R3,R4 BOTTOM OF LDR TBL 00317000
STM R3,R4,DSKLIN+28 ADR. AND LENGTH OF LDR TBL 00318000
L R15,AWRBUF 00319000
BALR R14,R15 WRITE LDR TBL TO MODULE 00320000
BNZ ERR105S WRITE ERROR 00321000
B FINMOD FINIS THE MODULE 00322000
MODSTER CH R15,=H'28' FILE NOT FOUND 00323000
BE NOERASE YES, OMIT ERASE CALL 00324000
B EXIT SOME OTHER ERROR 00325000
WRTERR CH R15,=H'12' WAS DISK READ ONLY 00326000
BE ERR037E YES 00327000
B ERR105S SOME OTHER WRITE ERROR 00328000
SPACE 00329000
AONE DC C'A1' DEFAULT MODE FOR OLD AND NEW MODULE 00330000
EJECT 00331000
*********************************************************************** 00332000
* 00333000
* LOADMOD - CHECK FOR MODULE THEN READ IT IN 00334000
* 00335000
*********************************************************************** 00336000
SPACE 00337000
GOREAD MVC DSKLIN+8(8),8(R2) MOVE MODULE NAME TO PLIST 00338000
CLI 8(R2),X'FF' ANY MODULE NAME SPECIFIED 00339000
BE ERR001E NO, ERROR 00340000
LR R7,R2 REMEMBER "R1 AT INPUT" @V305032 00341000
CLI 16(R2),X'FF' END OF PARAMETERS 00342000
BE GOREAD1 YES 00343000
LA R2,16(0,R2) GET PAST NAME 00344000
CLC 0(8,R2),=CL8'MODULE' IS FILE TYPE MODULE 00345000
BNE ERR032E NO, ERROR 00346000
CLI 8(R2),X'FF' IS A MODE SPECIFIED 00347000
BE GOREAD1 NO 00348000
MVC DSKLIN+24(2),8(R2) MOVE MODE TO PLIST 00349000
CLI 16(R2),X'FF' END OF PARAMETERS 00350000
BNE ERR070 NO, ERROR 00351000
GOREAD1 CLI DSKLIN+8,C'*' WAS * TYPED AS COMMAND NAME 00352000
BE ERR002E YES, THAT'S NOT RIGHT 00353000
LA R1,DSKLIN SET PLIST REG 00354000
L R15,ASTATE CHECK FOR FILE 00355000
BALR R14,R15 00356000
BNZ LMODSTER STATE ERROR 00357000
L R1,28(R1) GET A(FST COPY) 00358000
MVC DSKLIN+24(2),24(R1) SET MODE IN PLIST 00359000
CLI FVSFSTFV,FIX IS MODULE FIXED ? @V305066 00360000
BE FIXDTRAN YES - IT MUST BE TRANSIENT. @V305032 00361000
LA R0,10 GET AN INPUT BUFFER 00362000
DMSFREE DWORDS=(0),TYPCALL=BALR 00363000
LR R9,R1 USE R9 AS BUFFER ADDR 00364000
ST R9,DSKLIN+28 SET IN PLIST 00365000
LA R1,DSKLIN ADDR OF READ PLIST 00366000
L R15,ARDBUF READ FIRST RECORD 00367000
BALR R14,R15 00368000
BNZ ERR104S ERROR 00369000
TM MODFLGS,MDPCALL CALLING FROM DMSMDP ? @VA07083 00370000
BZ CONTINUE @VA07083 00371000
CLC H0,TBENT-STRTADDR(R9) ARE THERE LOADER TABLES ? @VA07083 00372000
BE ERROR18E @VA07083 00373000
CONTINUE EQU * @VA07083 00374000
L R6,0(R9) GET STARTING ADR OF THIS MODULE 00375000
LM R3,R4,4(R9) GET 1ST AND LAST LOCATIONS 00376000
L R15,=V(SUBFLAG) GET SUBSET FLAG 00377000
TM 0(R15),X'01' IS SUBSET BIT ON 00378000
BZ SUBOK NO, DON'T CHECK LOAD LOCATION 00379000
C R3,AUSRAREA COMPARE LOAD LOC WITH USER AREA 00380000
BL SUBOK OK IF LOADING BELOW USER AREA 00381000
LA R5,32 WOULD OVERLAY VALID TEXT @VA05074 00382000
B FINMOD1 CLOSE FILE THEN EXIT @VA05074 00383000
LMODSTER CH R15,=H'28' FILE NOT FOUND 00384000
BE ERR002E YES, TYPE MESSAGE 00385000
B EXIT SOME OTHER ERROR 00386000
SUBOK C R3,ADTRANS DOES MODULE GO TO TRANSIENT AREA 00387000
BNE STR6 NO 00388000
BAL R14,DOSOSUB1 CHECK FOR DOS/OS "MISMATCH" @V305032 00389000
MVC LASTTMOD,DSKLIN+8 REMEMBER WHICH MODULE IN TRANS AR. 00390000
B LM34 CONTINUE 00391000
SPACE 00392000
* MODULE IS "FIXED" - IT SHOULD BE TRANSIENT WITH "SYSTEM" OPION: 00393000
* ERROR-CHECK IT (AGAINST USER ERRORS); THEN IF IT LOOKS OK, READ IT 00394000
* INTO THE TRANSIENT AREA VIA TWO CALLS TO "RDTK" (DON'T NEED RDBUF): 00395000
* 00396000
FIXDTRAN DS 0H @VA07908 00396500
TM MODFLGS,MDPCALL CALLED FROM DMSMDP @VA07908 00397000
BO ERROR18E YES, DONT HAVE MAP @VA07908 00397500
LA R15,LRECL1 ONE LOGICAL RECORD @VA07908 00398000
CH R15,FVSFSTIC EQUAL @VA08626 00398500
BNE ERROR11 IF NOT, CALL IT ERROR 11. @V305032 00399000
L R7,FVSFSTIL NOW GET MODULE BYTE-COUNT IN R7 @V305032 00400000
C R7,=F'8192' CAN'T BE MORE THAN 8192 BYTES @V305032 00401000
BH ERROR8 IF NOT, CALL IT ERROR 8. @V305032 00402000
LA R1,DSKLST POINT TO "RDTK" P-LIST @V305032 00403000
L R3,ADTRANS ADDRESS INTO R3 @V305032 00404000
SR R4,R4 "0" MEANS READ FIRST CHAIN LINK @V305032 00405000
LA R5,FVSFSTCL POINT TO FIRST CHAIN LINK @V305032 00406000
L R6,FVSFSTAD POINT TO ACTIVE DISK TABLE @V305032 00407000
STM R3,R6,DSKLOC STORE DSKLOC/RWCNT/DSKADR/ADTADD @V305032 00408000
L R15,ARDTK CALL "RDTK" TO READ THE FIRST @V305032 00409000
BALR R14,R15 CHAIN LINK (INTO TRANSIENT AREA) @V305032 00410000
BNZ ERR100TR HOPEFULLY SHOULDN'T GET ERROR. @V305032 00411000
LR R4,R7 NOW GET MODULE BYTE-COUNT IN R4 @V305032 00412000
MVC REGSAV3(22),80(R3) MOVE 11 BLK NUMBERS (ENOUGH @V305032 00413000
* FOR BIGGEST POSSIBLE TRANSIENT MODULE) 00414000
LA R5,REGSAV3 POINT TO WHERE WE MOVED THEM @V305032 00415000
STM R4,R5,RWCNT STORE NEW RWCNT AND DSKADDR @V305032 00416000
L R15,ARDTK CALL "RDTK" AGAIN TO READ IN @V305032 00417000
BALR R14,R15 THE ACTUAL TRANSIENT MODULE @V305032 00418000
BNZ ERR100TR HOPEFULLY SHOULDN'T GET ERROR. @V305032 00419000
MVC LASTTMOD,DSKLIN+8 REMEMBER WHICH MOD IN TRANSAR @V305032 00420000
OI PROTFLAG,PRFTSYS SET PROTECTION FLAG-BIT, @V305032 00421000
AR R4,R3 LET R4 = LAST LOCATION LOADED @V305032 00422000
STM R3,R4,FRSTLOC "SHOW" 1ST & LAST LOCATIONS, @V305032 00423000
B EXIT2 AND GO EXIT (WE'RE ALL DONE). @V305032 00424000
SPACE 00425000
STR6 C R4,FREELOWE WILL FREE STORAGE BE OVERLAID ? @V305032 00426000
BH ERR109S YES, ERROR. @V305032 00427000
BAL R14,DOSOSUB2 CHECK FOR DOS/OS "MISMATCH" @V305032 00428000
MVC LASTLMOD(8),DSKLIN+8 SAVE NAME OF LAST LOAD MOD. IN USER 00429000
ST R6,STRTADDR SET STARTING ADDR 00430000
MVC LOCCNT(4),LOCCNT-STRTADDR(R9) SET LOCATION COUNTER 00431000
LH R8,TBENT-STRTADDR(R9) LDR TBL COUNT 00432000
LTR R8,R8 IS IT ZERO (NOMAP) 00433000
BZ NOCOUNT YES, DON'T STORE IN NUCON 00434000
STH R8,TBENT PLACE NEW COUNT IN NUCON 00435000
SR R0,R0 GET NUMBER OF PAGES OF LDRTBLS @VA02323 00436000
IC R0,ALDRTBLS FROM LEFT-MOST BYTE OF "LDRTBL" @VA02323 00437000
MH R0,=H'204' X 204 (204 ENTRIES/PAGE) @VA02323 00438000
CR R8,R0 @VA02323 00439000
BH ERR116S REFERENCE TABLE OVERFLOW @VA02323 00440000
NOCOUNT OI LDRFLAGS,X'04' SET NOERASE TO PROTECT LOAD MAP 00441000
LM34 MVC FRSTLOC(8),FRSTLOC-STRTADDR(R9) SET 1ST AND LAST LOCATIO 00442000
L R5,F65535 MAX RECORD SIZE FOR RDBUF 00443000
SR R4,R3 GET LENGTH OF TEXT 00444000
RLOOP STM R3,R4,DSKLIN+28 PUT ADR AND LENGTH IN READ PLIST 00445000
CR R4,R5 SEE IF COUNT TOO BIG FOR RDBUF 00446000
BNH OKR NOT TOO BIG 00447000
ST R5,DSKLIN+32 IF TOO BIG SUBSTITUTE MAX. 00448000
OKR L R15,ARDBUF READ IN SOME TEXT 00449000
BALR R14,R15 00450000
BNZ ERR104S ERROR 00451000
AR R3,R5 INCREMENT STARTING ADR 00452000
SR R4,R5 REMAINING COUNT 00453000
BP RLOOP BP IF R4 > 0, READ SOME MORE 00454000
LH R4,TBENT-STRTADDR(R9) NO. OF LDR TBL ENTRIES 00455000
MH R4,=H'20' MULTIPLY BY 20 00456000
LTR R4,R4 ANY LDR TBL 00457000
BZ CHKSTR NO LDR TABLE, CHECK STR OPTION V0009 00458000
L R3,ALDRTBLS TOP OF LOADER TBL 00459000
LA R3,0(0,R3) CLEAR HI BYTE 00460000
SR R3,R4 LDR TBL LOCATION IN STORAGE 00461000
STM R3,R4,DSKLIN+28 SET PLIST 00462000
L R15,ARDBUF 00463000
BALR R14,R15 READ IN LDR TBLS 00464000
LR R14,R15 @VA13683 00464500
N R14,=A(X'FFFFF7') @VA13683 00465000
BNZ ERR104S READ ERROR 00466000
CHKSTR TM LDRFLAGS+1-STRTADDR(R9),X'80' STRINIT CALL REQUESTEV0009 00467000
BNO CHKSYS NO 00468000
L R15,=V(SUBFLAG) GET SUBSET FLAG @VA07612 00468200
TM 0(R15),X'01' ARE WE IN SUBSET MODE @VA07612 00468400
BO CHKSYS YES, SKIP STORAGE INIT @VA07612 00468600
STRINIT TYPCALL=BALR 00469000
* IF THE 'SYSTEM' OPTION WAS SPECIFIED ON THE GENMOD COMMAND, THEN 00470000
* WE MUST SET THE APPROPRIATE SYSTEM BIT IN PROTFLAG. 00471000
CHKSYS EQU * 00472000
L R3,4(R9) GET FIRST STORAGE LOCATION 00473000
C R3,ADTRANS EQUALS START OF TRANSIENT AREA? 00474000
LA R1,PRFUSYS R1 <- USER SYSTEM BIT 00475000
BNE *+8 SKIP IF USER ROUTINE 00476000
LA R1,PRFTSYS R1 <- TRANSIENT SYSTEM BIT 00477000
EX R1,CHKSYSO TURN ON SYSTEM FLAG 00478000
TM LDRFLAGS-STRTADDR(R9),SYSTEM IS IT A SYSTEM MODULE? 00479000
BO FINMOD YES - GO FINISH UP. @V305032 00480000
EX R1,CHKSYSX IF NOT, TURN OFF FLAG AGAIN 00481000
* CONTINUE TO "FINMOD" ... 00482000
SPACE 00483000
* NOW FINISH UP (FOR EITHER 'LOADMOD' OR 'GENMOD') ... 00484000
FINMOD SR R5,R5 CLEAR "RETURN CODE" @V305032 00485000
FINMOD1 LA R1,DSKLIN PLIST FOR FINIS @V305032 00486000
L R15,AFINIS 00487000
BALR R14,R15 FINIS FILE 00488000
BNZ ERR105S BRANCH IF ERROR 00489000
LR R15,R5 OK - PRESERVE "RETURN CODE" @V305032 00490000
EXIT LTR R1,R9 WAS A BUFFER AQUIRED 00491000
BZ EXIT1 NO 00492000
LR R5,R15 PROTECT RETURN CODE 00493000
LA R0,10 SIZE OF BUFFER 00494000
DMSFRET DWORDS=(0),LOC=(1),TYPCALL=BALR 00495000
LR R15,R5 RESTORE RETURN CODE 00496000
EXIT1 LM R3,R4,FRSTLOC "SHOW" FIRST & LAST LOCATIONS @V305032 00497000
EXIT2 LR R14,R11 RESTORE RETURN CODE, @V305032 00498000
LTR R15,R15 SET CONDITION-CODE, AND @V305032 00499000
BR R14 EXIT 00500000
SPACE 00501000
CHKSYSO OI PROTFLAG,*-* BIT FILLED IN BY "EX" @V305032 00502000
CHKSYSX XI PROTFLAG,*-* BIT FILLED IN BY "EX" @V305032 00503000
EJECT 00504000
SEARCH CLI 0(R2),X'FF' IS THERE A NAME 00505000
BE ERR005E NO, ERROR 00506000
CLI 0(R2),C')' 00507000
BE ERR005E 00508000
LH R0,TBENT NO. OF LOADER TBL ENTRIES 00509000
L R4,ALDRTBLS TOP OF LDR TBL 00510000
LA R4,0(0,R4) CLEAR HI BYTE 00511000
LA R7,20 SIZE OF EACH ENTRY 00512000
COMP SR R4,R7 1ST (NEXT) ENTRY 00513000
CLC 0(8,R2),0(R4) SAME AS USER'S NAME 00514000
BE BCT0 YES , VALIDATE ITS EXISTENCE P3083 00515000
BCT 0,COMP TRY NEXT 00516000
B ERR004E ERROR IF NOT FOUND 00517000
BCT0 L R7,12(0,R4) GET THE ENTRY ADDRESS P3083 00518000
LA R7,0(0,R7) CLEAR HI BYTE P3083 00519000
LTR R7,R7 IS IT ZERO P3083 00520000
BCR 7,R15 NO, RETURN TO CALLER P3083 00521000
B ERR004E YES, IT DOES NOT EXIST P3083 00522000
EJECT 00523000
*********************************************************************** 00524000
* 00525000
* ERROR MESSAGES 00526000
* 00527000
*********************************************************************** 00528000
SPACE 00529000
ERR001E DMSERR TEXT='NO FILENAME SPECIFIED',LET=E,NUM=1,TYPCALL=BALR 00530000
LA R15,24 ERROR CODE 00531000
B EXIT 00532000
ERR002E CLC SPFENCE(4),16(R2) SPECIAL RETURN FOR SVCINT 00533000
BE LA1528 YES 00534000
LA R2,DSKLIN+8 ADDR OF FILE NAME 00535000
DMSERR TEXT='FILE ........ MODULE NOT FOUND', X00536000
LET=E,NUM=2,SUB=(CHARA,(R2)),TYPCALL=BALR 00537000
LA1528 LA R15,28 ERROR CODE 00538000
B EXIT RETURN 00539000
ERR003E DMSERR TEXT='INVALID OPTION ........', X00540000
NUM=3,LET=E,SUB=(CHARA,(R2)),TYPCALL=BALR 00541000
LA R15,24 00542000
B EXIT 00543000
SPACE 00544000
ERR005E DMSERR TEXT='NO ''........ ENTRY'' SPECIFIED',NUM=5, X00545000
LET=E,SUB=(CHAR8A,(R3)) 00546000
LA R15,24 00547000
B EXIT 00548000
SPACE 00549000
ERR032E DMSERR TEXT='INVALID FILETYPE ........',LET=E,NUM=032, X00550000
SUB=(CHARA,(R2)),TYPCALL=BALR 00551000
LA R15,24 00552000
B EXIT 00553000
SPACE 00554000
ERR004E DMSERR TEXT='ENTRY POINT ........ NOT FOUND', X00555000
LET=E,NUM=21, X00556000
SUB=(CHARA,(R2)),TYPCALL=BALR 00557000
LA R15,40 00558000
B EXIT 00559000
SPACE 00560000
ERR037E LR R3,R15 SAVE ERROR CODE 00561000
LA R2,DSKLIN+24 MODE ADDR. IN R2 00562000
DMSERR TEXT='DISK ''..'' IS READ/ONLY',NUM=37, X00563000
LET=E,SUB=(CHARA,(R2)),TYPCALL=BALR 00564000
LA R15,36 RETURN CODE 00565000
B EXIT 00566000
SPACE 00567000
ERR040E DMSERR TEXT='NO FILES LOADED',NUM=40,LET=E,TYPCALL=BALR 00568000
LA R15,40 00569000
B EXIT 00570000
ERROR18E DMSERR TEXT='NO LOAD MAP AVAILABLE',LET=E,NUM=18, X00571000
TYPCALL=BALR 00572000
LA R15,40 ERROR CODE @VA07083 00573000
B EXIT @VA07083 00574000
SPACE 00575000
ERR070 LA R2,16(0,R2) POINT TO INVALID PARM 00576000
ERR070E DMSERR TEXT='INVALID PARAMETER ''........''',NUM=70, X00577000
LET=E,SUB=(CHAR8A,(R2)) 00578000
LA R15,24 00579000
B EXIT 00580000
ERR084E DMSERR TEXT='INVALID USE OF FROM AND TO OPTIONS',LET=E,NUM=84 00581000
LA R15,24 00582000
B EXIT 00583000
SPACE 00584000
ERROR11 LA R15,ERR11 FIXED MODULE NOT ONE RECORD @V305066 00585000
B ERR100TR TREAT AS EQUIVALENT RDBUF ERROR. @V305032 00586000
* 00587000
ERROR8 LA R15,ERR8 FIXED MODULE > 8192 BYTES @V305066 00588000
* TREAT AS EQUIVALENT RDBUF ERROR: 00589000
ERR100TR EQU * ERROR READING FIXED TRANSIENT MODULE: @V305032 00590000
XC LASTTMOD(8),LASTTMOD CLEAR NAME OF TRANSIENT @V305032 00591000
* MODULE; CONTINUE TO "ERR104S": 00592000
ERR104S LR R3,R15 SAVE RETURN CODE 00593000
LA R2,DSKLIN+8 ADDR. OF FILENAME 00594000
DMSERR TEXT=('ERROR ''..'' READING FILE ', V0314X00595000
'''..................'' FROM DISK'), V0314X00596000
NUM=104,LET=S,TYPCALL=BALR, V0314X00597000
SUB=(DEC,(R3),CHAR8A,(R2)),MF=(E,MSG) V0314 00598000
LA R15,100 RETURN CODE 00599000
B EXIT 00600000
ERR105S LR R3,R15 SAVE RETURN CODE 00601000
LA R2,DSKLIN+8 ADR. OF FILE NAME 00602000
DMSERR TEXT='ERROR .. WHILE WRITING FILE .................. ONX00603000
DISK',LET=S,NUM=105,SUB=(DEC,(R3),CHAR8A,(R2)), X00604000
MF=(E,MSG),TYPCALL=BALR 00605000
LA R15,100 RETURN CODE 00606000
B EXIT 00607000
SPACE 00608000
SPACE 00609000
SPACE 00610000
ERR109S DMSERR TEXT='STORAGE EXCEEDED',LET=S,NUM=109,TYPCALL=BALR 00611000
LA R15,104 RETURN CODE 00612000
B EXIT 00613000
ERR116S DMSERR TEXT='LOADER TABLE OVERFLOW',LET=S,NUM=116,TYPCALL=BALR 00614000
LA R15,104 @VA02323 00615000
B EXIT @VA02323 00616000
SPACE 2 00617000
* CHECK A (VARIABLE) TRANSIENT MODULE FOR A POSSIBLE DOS/OS "MISMATCH": 00618000
DOSOSUB1 TM LDRFLAGS-STRTADDR(R9),SYSTEM "SYSTEM" MODULE ? @V305032 00619000
BOR R14 YES - IT'S OK TO LOADMOD IT. @V305032 00620000
* NO - CHECK LIKE ANY OTHER MODULE: 00621000
* CHECK A MODULE FOR A POSSIBLE DOS/OS "MISMATCH": 00622000
DOSOSUB2 CLM R7,M8,=AL1(COMM) ISSUED AS A COMMAND ? @VM03147 00623000
BLR R14 NO (AS FUNCTION) - ASSUME OK. @V305032 00624000
CLM R7,M8,=AL1(EX) OR FROM EXEC ? @VM03147 00625000
BHR R14 NO (AS FUNCTION) - ASSUME OK. @V305032 00626000
* IF LOADMOD ISSUED FROM TERMINAL, AN EXEC FILE, OR FROM DMSITS, CHECK 00627000
* FOR MISMATCH BETWEEN THE MODULE AND THE PRESENT CMS/DOS ENVIRNOMENT: 00628000
TM MODFLGS-STRTADDR(R9),MODGNALL "ALL" FLAG SET ? @V305032 00629000
BOR R14 YES - IGNORE POSSIBLE MISMATCH. @V305032 00630000
TM MODFLGS-STRTADDR(R9),MODGNDOS "DOS" FLAG SET ? @V305032 00631000
BO CHKDOSNC YES - CHECK DOS FLAG IN NUCLEUS. @V305032 00632000
TM DOSFLAGS,DOSMODE+DOSSVC WE SHOULDN'T BE IN DOS @V305032 00633000
BZR R14 IF NOT, WE'RE OK. @V305032 00634000
ER114A LA R3,ACTIVE SIGNAL DOS ENVIRONMENT ACTIVE @V305032 00635000
B ER114MSG AND GO GIVE ERROR MESSAGE. @V305032 00636000
CHKDOSNC TM DOSFLAGS,DOSMODE+DOSSVC DOS - FLAGS MUST BE SET @V305032 00637000
BOR R14 OK IF YES - RETURN TO CALLER. @V305032 00638000
* ERROR IF YES - CONTINUE TO "ER114B": 00639000
ER114B LA R3,NOTACT "DOS ENVIRONMENT NOT ACTIVE" @V305032 00640000
ER114MSG LA R2,DSKLIN+8 POINT TO THE MODULE'S FILENAME @V305032 00641000
DMSERR MF=(E,'SYS'),TEXTA=DOSMSGL,LET=E,NUM=114, @V305032X00642000
SUB=(CHAR8A,(R2),CHARA,(R3)),TYPCALL=BALR @V305032 00643000
LA R5,RC40 SET RETURN CODE = 40, @V305066 00644000
B FINMOD1 GO CLOSE FILE AND THEN EXIT. @V305032 00645000
DOSMSGL DC AL1(L'DOSMSG) @V305032 00646000
DOSMSG DC C'''....................'' NOT LOADED; CMS/DOS ENVIRONMEX00647000
NT ..........' NOT ACTIVE | ACTIVE @V305032 00648000
SPACE 00649000
NOTACT DC C'NOT ACTIVE',CL4' ' @V305032 00650000
ACTIVE EQU NOTACT+4 @V305032 00651000
EJECT 00652000
ADTRANS DC V(TRANSAR) ADDRESS OF TRANSIENT AREA 00653000
DS 0F 00654000
DSKLIS EQU *-8 00655000
DC X'FF',7X'40' SET FOR DEFAULT FNAME V0415 00656000
DC CL8'MODULE' FTYPE 00657000
DC CL2'* ' FMODE 00658000
DC XL2'00' ITEM NO. 00659000
DC 4C'*' MAKE * IN FNAME OR FTYPE INVALID @VA14823 00660000
* FIELD CONTAINS BUFFER ADDR ON RETURN FROM STATE @VA14823 00660500
DC A(80) LENGTH OF FIRST RECORD 00661000
DSKFV DC CL2'V' VARIABLE FILE = DEFAULT @V305032 00662000
DC H'1' NO. OF ITEMS 00663000
DC F'0' NO. OF BYTES READ 00664000
SPACE 00665000
FVEQU EQU DSKFV-DSKLIS DISP OF FV FLAG FROM WRBUF PLIST @V305032 00666000
SPACE 00667000
DS 0F 00668000
STARTLIS DC CL8'START' 00669000
DC CL8'(' 00670000
DC CL8'NO' 00671000
SPFENCE DC X'FF00000000' SPECIAL FENCE FOR NO ERROR MESSAGE 00672000
SPACE 00673000
DS F 00674000
H0 DC H'0' @VA07083 00675000
OPT DC CL8'FROM' 00676000
B FROM 00677000
DC CL8'TO' 00678000
B TO 00679000
DC CL8'NOMAP' 00680000
OI MODFLGS,NOMAPFLG NOMAP OPTION WANTED @VA02871 00681000
DC CL8'MAP' P3029 00682000
NI MODFLGS,255-NOMAPFLG MAP OPTION WANTED @VA02871 00683000
DC CL8'STR' 00684000
OI BUFF,X'40' INDICATE STRINIT CALL AT LOADMOD TIME 00685000
DC CL8'NOSTR' 00686000
OI BUFF,X'80' INDICATE NO STRINIT CALL WANTED 00687000
DC CL8'SYSTEM' 00688000
OI LDRFLAGS,SYSTEM INDICATE SYSTEM MODULE 00689000
DC CL8'OS' MODULE USES OS AND/OR CMS MACROS @V305032 00690000
NI MODFLGS,255-MODGNDOS ENSURE "DOS" FLAG RESET @V305032 00691000
DC CL8'DOS' MODULE USES "DOS" MACROS @V305032 00692000
OI MODFLGS,MODGNDOS SET "DOS" FLAGBIT @V305032 00693000
DC CL8'ALL' ALL MACROS IN MODULE PRESUMED OK @V305032 00694000
OI MODFLGS,MODGNALL SET "ALL" FLAGBIT @V305032 00695000
OPTEND EQU * 00696000
OPTNO EQU (OPTEND-OPT)/8 00697000
SYSTEM EQU X'01' 00698000
CLEAR EQU X'00' CLEAR FLAGS @V305066 00699000
STRINIT EQU X'40' STRINIT REQUEST @V305066 00700000
FIX EQU C'F' FIXED MODULE @V305066 00701000
LRECL1 EQU 1 ONE LOGICAL RECORD @V305066 00702000
ERR11 EQU 11 FIXED MODULE NOT 1 RECORD @V305066 00703000
ERR8 EQU 8 FIXED MODULE > 8192 BYTES @V305066 00704000
RC40 EQU 40 RETURN CODE = 40 @V305066 00705000
M8 EQU 8 HIGH BIT FOR CLM/ICM/STCM USE @VM03147 00706000
COMM EQU X'0C' ISSUED FROM COMMAND @VM03147 00707000
EX EQU X'0E' ISSUED FROM EXEC @V305066 00708000
LTORG 00709000
SPACE 00710000
FREEST DSECT 00711000
BUFF DS 2F 00712000
DSKLIN DS 11F 00713000
MSG DMSERR MF=L,MAXSUBS=2 00714000
EJECT 00715000
NUCON 00716000
REGEQU 00717000
FVS 00718000
END 00719000