INA TITLE 'DMSINA (CMS) VM/370 - RELEASE 6' 00001000 SPACE 2 00002000 *. 00003000 * MODULE NAME: 00010000 * 00011000 * DMSINA (ABBREV) 00012000 * 00013000 * FUNCTION: 00014000 * 00015000 * HANDLES EITHER USER DEFINED SYNONYM ABBREVIATIONS 00016000 * AND/OR SYSTEM DEFINED SYNONYM ABBREVIATIONS FOR 00017000 * COMMAND NAMES. 00018000 * 00019000 * ATTRIBUTES: 00020000 * 00021000 * NUCLEUS, REENTRANT, CALLED VIA BALR R14, R15 00022000 * 00023000 * ENTRY POINTS: 00024000 * 00025000 * DMSINA (ABBREV) 00026000 * | DMSINA1S (FIRSTAB) 00026100 * | DMSINALT (LASTAB) 00026200 * 00027000 * ENTRY CONDITIONS: 00028000 * 00029000 * GPR0,GPR1 = THE TYPED IN SYNONYM FOR WHICH A MATCH IS TO 00030100 * BE FOUND, LEFT JUSTIFIED. 00032000 * 00033000 * EXIT CONDITIONS: 00034000 * 00035000 * NORMAL - 00036000 * GPR15 = 0 00037100 * GPR0,GPR1 = THE MATCH TO THE TYPED IN SYNONYM 00037200 * 00041000 * ERROR 00042000 * GPR15 = 1 - NO MATCH FOUND 00043000 * 2 - MATCH FOUND AND IS EXACTLY THE SAME 00044000 * AS THE ABBREVIATION. 00045000 * 00046000 * CALLS TO OTHER ROUTINES: 00047000 * 00048000 * NONE. 00049000 * 00050000 * EXTERNAL REFERENCES: 00051000 * 00052000 * NUCON - NUCLEUS AREA CONSTANTS 00053000 * | BALRSAVE (IN DMSNUC) 00053100 * | USABRV TABLE (IN DMSNUC) 00053200 * 00054000 * TABLES/WORKAREAS: 00055000 * 00056000 * FIRSTAB - STANDARD CMS ABBREVIATION TABLE 00057000 * USABRV - IDENTIFIES LOCATION, ETC. OF USER DEFINED 00058000 * ABBREVIATIONS, IF ANY 00059000 * 00060000 * NOTES: NONE 00061100 * 00061200 * OPERATION: 00061300 * 00061400 * 1. COMPUTES THE NUMBER OF CHARACTERS IN THE TYPED IN 00061500 * COMMAND SYNONYM (IN GPR0,GPR1). 00061600 * 00061700 * 2. IF A USER-DEFINED SYNONYM TABLE EXISTS, SEARCH IT FOR 00061800 * A MATCH WITH THE TYPED IN NAME. OTHERWISE, GO TO 4. 00061900 * 00062000 * 3. SEARCH USER SYNONYM TABLE FOR MATCH. IF ONE IS FOUND, 00062100 * LOAD IT INTO GPR0,GPR1 AND EXIT WITH RETURN CODE 0, 00062200 * UNLESS ONE OF THE FOLLOWING: 00062300 * -GIVEN SYNONYM SHORTER THAN MINIMUM ALLOWED TRUNCATION - 00062400 * GO BACK AND KEEP SEARCHING THE TABLE. 00062500 * -ABBREVIATION IS NOT ALLOWED ('NOABBREV' FLAG), AND THE 00062600 * GIVEN SYNONYM IS A TRUNCATED VERSION - GO BACK AND 00062700 * KEEP SEARCHING THE TABLE. 00062800 * -THE GIVEN SYNONYM IS THE SAME AS THE REAL COMMAND 00062900 * NAME - SET RETURN CODE 2 AND EXIT. 00063000 * 00063100 * 4. DETERMINE IF THE STANDARD CMS SYNONYM TABLE IS TO BE 00063200 * SEARCHED. IF NOT ('NOABBREV' FLAG OR 'NOSTDSYN' FLAG), 00063300 * EXIT WITH RETURN CODE 1. 00063400 * 00063500 * 5. SEARCH STANDARD CMS SYNONYM TABLE FOR MATCH. IF ONE IS 00063600 * FOUND, LOAD IT INTO GPR0,GPR1 AND EXIT WITH RETURN CODE 0, 00063700 * UNLESS ONE OF THE FOLLOWING: 00063800 * -GIVEN SYNONYM SHORTER THAN MINIMUM ALLOWED TRUNCATION - 00063900 * GO BACK AND KEEP SEARCHING THE TABLE. 00064000 * -GIVEN SYNONYM IS THE SAME AS THE REAL COMMAND 00064100 * NAME - SET RETURN CODE 2 AND EXIT. 00064200 * 00064300 * 6. IF NO ACCEPTABLE MATCH IS FOUND IN EITHER TABLE, EXIT 00064400 * WITH RETURN CODE 1. 00064500 *. 00096000 EJECT 00097000 *********************************************************************** 00098000 * * 00099000 * 'ABBREV' * 00100000 * * 00101000 * CMS ABBREVIATION-CHECKER, WITH STANDARD (DEFAULT) TABLE. * 00102000 * * 00103000 * HANDLES EITHER USER-DEFINED "SYNONYM" ABBREVIATIONS (17 BYTES) * 00104000 * OR STANDARD "SHORT-FORM" ABBREVIATIONS (9 BYTES) OR BOTH. * 00105000 * * 00106000 * 'ABBREV' TO BE CALLED (BY SVCINT) WHEN * 00107000 * A COMMAND 'AS GIVEN' IS 'NOT FOUND'. * 00108000 * * 00109000 * CALLING SEQUENCE ... * 00110000 * * 00111000 * AT ENTRY, R0 & R1 (TOGETHER) MUST CONTAIN AN 8-BYTE QUANTITY * 00112000 * (PRESUMABLY AN ABBREVIATION) FOR WHICH * 00113000 * A FULL 8-BYTE 'MATCH' IS TO BE FOUND. * 00114000 * (E.G. 'A' = 'ASSEMBLE', 'ED' = 'EDIT' ETC.) * 00115000 * * 00116000 * AT ENTRY ..... * 00117000 * (R0 & R1 MUST HOLD 8-BYTE QUANTITY) * 00118000 * L R15,=A(ABBREV) * 00119000 * BALR R14,R15 * 00120000 * * 00121000 * ON RETURN: * 00122000 * IF A 'MATCH' WAS FOUND (E.G. 'ASSEMBLE' FOR 'A'), * 00123000 * R15 = 0, AND THE 8-BYTE 'MATCH' HAS BEEN * 00124000 * SUBSTITUTED IN R0 & R1 FOR ITS ABBREVIATION. * 00125000 * (ALL OTHER REGISTERS ETC. PRESERVED) * 00126000 * * 00127000 * IF NO 'MATCH' IS FOUND, RETURNS WITH R15 = 1. * 00128000 * (ALL OTHER REGISTERS ETC. PRESERVED) * 00129000 * * 00130000 * IF A 'MATCH' IS FOUND, BUT THE 8-BYTE MATCH IS * 00131000 * EXACTLY THE SAME AS THE ABBREVIATION, * 00132000 * RETURNS WITH R15 = 2, AND OTHER REG. PRESERVED * 00133000 * * 00134000 * LOOKS IN USER-DEFINED ABBREVIATION-TABLE (IF ANY) FIRST. * 00135000 * * 00136000 * DOESN'T USE STANDARD TABLE AT ALL IF 'NOABBREV' FLAG 00137100 * OR 'NOSTDSYN' FLAG IS SET. 00137200 * * 00138000 * NOTE - STANDARD (DEFAULT) TABLE EASILY CHANGED BY * 00139000 * CHANGING 'ABRV' CARDS & RE-ASSEMBLING * 00140000 * (ACCORDING TO REQUIREMENTS & JUDGMENT OF ANY INSTALLATION) * 00141000 * * 00142000 * NOTE: THE 'NOSTDSYN' FLAG AND THE USER SYNONYM TABLES 00143100 * ARE SET UP BY THE SYNONYM COMMAND, A TRANSIENT 00143200 * AREA ROUTINE. 00143300 * * 00146000 *********************************************************************** 00147000 EJECT 00148000 MACRO 00151000 ABRV &NAME,&NUM 00152000 DC CL8'&NAME' 00153000 DC AL1(&NUM) 00154000 MEND 00155000 SPACE 2 00156000 DMSINA CSECT MODULE NAME @V305032 00157100 ENTRY ABBREV CALLED BY THIS NAME @V305032 00157200 ENTRY DMSINA1S EXTERNAL NAME FOR 'FIRSTAB' @V305032 00157300 ENTRY DMSINALT EXTERNAL NAME FOR 'LASTAB' @V305032 00157400 * 00162000 * ENTER HERE ... 00163000 USING NUCON,R0 REFERENCE NUCLEUS CONSTANTS 00165000 USING ABBREV,R15 ENTER HERE: @V305032 00166100 ABBREV STM R0,R9,BALRSAVE SAVE ALL REGISTERS WE'LL USE, @V305032 00166200 L R9,AUSABRV REFERENCE REAL 'USABRV' TABLE @V305032 00166300 USING INADSECT,R9 ... @V305032 00166400 * COMPUTE (IN R2) THE NUMBER OF NON-BLANK BYTES (LESS 1) ... 00167000 LA R2,7 START WITH 7, 00168000 LA R3,BALRSAVE(R2) START WITH EIGHTH CHARACTER, @V305032 00169100 BLOOP CLI 0(R3),C' ' IS 'LAST' CHARACTER BLANK ? 00170000 BNE CNTFND BNE IF NOT, WE'VE GOT R2. 00171000 BCTR R3,0 DECREMENT R3 FOR NEXT TIME, 00172000 BCT R2,BLOOP ITERATE DOWN TO 1 CHARACTER, 00173000 CNTFND EQU * R2 NOW HOLDS NO. OF NON-BLANK CHARACTERS LESS 1 .. 00174000 LA R6,1(,R2) GET ACTUAL COUNT IN R6, IN ... @V305032 00175100 SLL R6,24 LEFTMOST BYTE FOR FAST CLM USE @V305032 00176100 LM R3,R5,USABRV4 SET UP R3-R5 AS NEEDED, @V305032 00191100 LTR R3,R3 IS THERE ANY TABLE AT ALL ? 00192000 BZ CHEKFLG BZ IF NOT, CHECK FLAG ... 00193000 LA R8,BXLE1 R8 MUST POINT TO BXLE1, @V305032 00194100 CLCLOOP EX R2,EXCLC DO WE HAVE A MATCH ? @V305032 00194600 BE APMSYN TRANSFER IF APPARENTLY YES. @V305032 00195100 BXLE1 BXLE R3,R4,CLCLOOP ITERATE THRU USER-TABLE. 00198000 * (DROPS THRU BXLE IF NO MATCH FOUND IN USER-TABLE) 00199000 * 00200000 CHEKFLG EQU * CHECK FLAG TO MAKE SURE OK TO USE REGULAR TABLE ... 00201000 TM OPTFLAGS,NOSTDSYN+NOABBREV NO ABBREV'S WANTED ? @V305032 00202100 BNZ ERROR1 IF YES, GIVE UP NOW (ERROR 1). @V305032 00203100 * OK TO USE REGULAR TABLE (SPECIAL FLAG NOT SET) ... 00204000 OKREG LM R3,R5,REGTABA SET UP REGULAR-TABLE ADDRESSES ETC. 00205000 DROP R9 (THRU WITH INADSECT) @V305032 00206100 LA R7,APMABB SET R7 FOR APPARENT MATCH, @V305032 00206200 CH R2,H3 CHECK BYTE-COUNT-LESS-1, @V305032 00206300 BL SET13 TRANSFER IF ABB. IS 1 TO 3 BYTES @V305032 00206400 LR R9,R7 SET R9 IN CASE ABB. = 4 BYTES, @V305032 00206500 BE SET4UP TRANSFER IF ABB. IS 4 BYTES. @V305032 00206600 LA R9,CLM5UP SET R9 FOR ABB. = 5 TO 8 BYTES @V305032 00206700 IC R2,EXTBL-4(R2) GET MODIFIER FOR EXECUTED CLM @V305032 00206800 SET4UP LA R8,BXLE4UP LET R8 POINT TO THE RIGHT BXLE @V305032 00206900 * LOOP TO CHECK ABBREVIATION OF FOUR OR 5-TO-8 BYTES: 00207000 CL4UP CL R0,0(,R3) COMPARE FIRST 4 BYTES @V305032 00207100 BER R9 IF MATCH, GO TO APMABB OR CLM5UP @V305032 00207200 BXLE4UP BXLE R3,R4,CL4UP ITERATE THRU ABBREVIATION TABLE @V305032 00207300 B ERROR1 ERROR 1 IF NOT FOUND. @V305032 00207400 * ABBREVIATION IS 5 TO 8 BYTES AND THE FIRST FOUR MATCH: 00207500 CLM5UP EX R2,EXCLM1 CHECK THE REMAINING BYTE(S), @V305032 00207600 BNER R8 "BNE BXLE4UP" IF NO MATCH. @V305032 00207700 * HERE FOR AN APPARENT MATCH IN STANDARD ABBREVIATION TABLE: 00207800 APMABB CLM R6,8,8(R3) IS GIVEN NUMBER OF BYTES ENOUGH? @V305032 00207900 BLR R8 IF NOT, GO BACK TO SOME BXLE. @V305032 00208000 B CHEKMTCH IF OK, GO TO "CHEKMTCH" ETC. @V305032 00208100 SPACE 00208200 * ABBREVIATION IS 1 TO 3 BYTES: 00208300 SET13 IC R2,EXTBL(R2) GET MODIFIER FOR EXECUTED CLM @V305032 00208400 LA R8,BXLE13 LET R8 POINT TO THE RIGHT BXLE @V305032 00208500 * LOOP TO CHECK 1-TO-3-BYTE ABBREVIATION: 00208600 CLM13 EX R2,EXCLM0 CHECK 1-TO-3-BYTE ABBREVIATION @V305032 00208700 BER R7 "BE APMABB" IF APPARENT MATCH @V305032 00208800 BXLE13 BXLE R3,R4,CLM13 ITERATE THRU ABBREVIATION TABLE @V305032 00208900 * 00209000 * (DROPS THRU BXLE IF NO MATCH IN REGULAR TABLE EITHER) 00209100 * 00209200 ERROR1 LM R0,R9,BALRSAVE RESTORE ALL REGISTERS WE USED, @V305032 00209300 LA R15,ERR1 ERROR NO. 1 @V305066 00209400 LTR R15,R15 SET CONDITION-CODE, @V305032 00209500 BR R14 AND EXIT. 00215000 SPACE 2 00216000 * HERE FOR AN APPARENT MATCH IN SYNONYM TABLE: 00217200 APMSYN CLM R6,8,16(R3) GIVEN NUMBER OF BYTES ENOUGH ? @V305032 00217400 BLR R8 IF NOT, GO BACK TO BXLE1 @V305032 00217600 TM OPTFLAGS,NOABBREV ABBREVIATION ALLOWED? @V305032 00217800 BZ CHEKMTCH BRANCH IF SO @V305032 00218000 CLC 8(8,R3),BALRSAVE FULL SYNONYM GIVEN? @V305032 00218200 BNER R8 'BNE' IF NOT, RETURN TO BXLE1 @V305032 00218400 CHEKMTCH CLC 0(8,R3),BALRSAVE SYNONYM SAME AS REAL NAME? @V305032 00218600 BE ERROR2 BE IF YES (RATHER STRANGE). 00221000 * 00222000 LM R0,R1,0(R3) SUBSTITUTE 'MATCH' FOR @V305032 00223100 * ABBREVIATION, 00223600 LM R2,R9,BALRSAVE+8 RESTORE THE OTHER REGISTERS, @V305032 00224100 SR R15,R15 CLEAR ERROR-CODE, 00225000 BR R14 AND EXIT. 00226000 * 00227000 ERROR2 LM R0,R9,BALRSAVE RESTORE ALL REGISTERS WE USED, @V305032 00228100 LA R15,2 ERROR NO. 2 00229000 LTR R15,R15 SET CONDITION-CODE, @V305032 00229100 BR R14 AND EXIT. 00230000 * 00231000 DS 0F CONSTANTS AND EXECUTED @V305032 00232100 * INSTRUCTIONS: 00232200 EXCLC CLC BALRSAVE(*-*),8(R3) TO CHECK SYNONYMS @V305032 00232300 H3 DC H'03' @V305032 00232400 EXCLM0 CLM R0,*-*,0(R3) CHECK 1ST 4 BYTES FOR A MATCH @V305032 00232500 EXCLM1 CLM R1,*-*,4(R3) CHECK 2ND 4 BYTES FOR A MATCH @V305032 00232600 EXTBL DC AL1(X'08',X'0C',X'0E',X'0F') FOR CLM USE @V305032 00232700 EJECT 00234000 * TABLE GIVING WHEREABOUTS OF USER-DEFINED-ABBREVIATIONS, IF ANY 00235000 * 00236000 * PLEASE KEEP THE FOLLOWING SEVEN AD-CON'S IN ORDER ........ 00237100 * (MUST CORRESPOND TO "LIVE" USABRV TABLE IN DMSNUC) 00237200 INADSECT DSECT ... @V305032 00237300 DC F'0' NO. DBL-WORDS FREE-STORAGE IN @V305032 00237400 * USER-TABLE. 00237500 USABRV4 DC A(*-*) ADDRESS OF 1ST ITEM IN @V305032 00237600 * USER-ABRV-TABLE 00237700 DC F'17' (FOR BXLE) 00241000 DC A(*-*) ADDRESS OF LAST ITEM IN USER-ABRV-TABLE. 00242000 * 00243000 REGTABA DC A(FIRSTAB) REFERENCE 'REGULAR' TABLE ... 00244000 DC F'9' (FOR BXLE) 00245000 DC A(LASTAB) (FOR BXLE) 00246000 * 00247000 DMSINA CSECT REVERT TO CSECT ADDRESSABILITY @V305032 00247100 SPACE 2 00248000 * NOTE - USER-DEFINED ABBREVIATION TABLE (17 BYTES PER ITEM) 00249000 * IS A 'SYNONYM' TABLE, OF THE FOLLOWING FORM (FOR EACH ONE)... 00250000 * DC CL8'CMS-NAME' CMS SYSTEM COMMAND - E.G. ERASE 00251000 * DC CL8'USER-SYN' USER-SYNONYM FOR SAME - E.G. DELETE 00252000 * DC AL1(NUMBER) MINIMUM NO. OF BYTES ACCEPTABLE FOR MATCH 00253000 * 00254000 SPACE 2 00255000 * STANDARD (DEFAULT) CMS ABBREVIATION-TABLE ... 00256000 * (REVISE AND RE-ASSEMBLE AT PLEASURE OF INSTALLATION) 00257000 * 00258000 * THE NUMBER WITH EACH NAME IS THE MINIMUM NUMBER OF BYTES 00259000 * REQUIRED FOR AN ABBREVIATION OF THAT NAME, 00260000 * TO SAFELY IDENTIFY IT WITHOUT AMBIGUITY. 00261000 * 00262000 * FOR EXAMPLE, COULD SPECIFY 2, 3, OR 4 BYTES FOR 'ACCESS' 00263100 * (2 FOR ABSOLUTE MINIMUM, 3 OR 4 IF DESIRED) 00264100 * E.G. ... ABRV ACCESS,2 OR ABRV ACCESS,3 ETC. 00265100 * 00266000 * 00267000 * 'FIRSTAB' MUST PRECEDE FIRST ONE, 'LASTAB' MUST FOLLOW LAST. 00268000 * OTHERWISE, THEY CAN BE IN ANY REASONABLE ORDER 00269000 * (E.G. FREQUENTLY-USED FLAVORS FIRST) 00270000 * 00271000 * NOTE - 9 BYTES FOR EACH ITEM IS THE BRIEFEST THIS CAN BE MADE. 00272000 * 00273000 * EVEN SO, THIS TABLE SHOULD BE KEPT TO A MINIMUM TO SAVE SPACE. 00274000 * 00275000 * NOTE - SOME POSSIBLE ABBREVIATIONS ARE PURPOSELY OMITTED 00276000 * EITHER BECAUSE THE COMMAND IS VERY SHORT OR SELDOM USED, 00277100 * OR FOR GREATER USER SAFETY AGAINST AN ACCIDENTAL ERROR 00278100 * FOR A COMMAND SUCH AS 'FORMAT' OR 'ERASE' WHICH CLEARS 00279100 * USER FILES. 00280100 EJECT 00283000 FIRSTAB EQU * MUST PRECEDE THE FIRST ONE ..... 00284000 DMSINA1S EQU FIRSTAB EXTERNAL NAME FOR 'FIRSTAB' @V305032 00284100 SPACE 2 00285000 ABRV ASSEMBLE,1 A 00286000 ABRV ACCESS,2 AC 00287000 ABRV AMSERV,TWO AM @V305066 00287100 ABRV BASIC,3 BAS BASIC ABBREVIATION @VA08182 00288000 ABRV COBOL,2 CO 00289000 ABRV COMPARE,3 COM 00290000 ABRV COPYFILE,4 COPY 00291000 ABRV DIRMAINT,4 DIRM @VMI0052 00291050 ABRV DOSLKED,FOUR DOSL @V305066 00291100 ABRV EDIT,1 E 00292000 ABRV EXEC,2 EX 00293000 ABRV FETCH,THREE FET @V305066 00294000 ABRV FILEDEF,2 FI 00295000 ABRV GENMOD,1 G 00296000 ABRV GLOBAL,2 GL 00297000 ABRV INCLUDE,2 IN 00298000 ABRV LISTFILE,1 L 00299000 ABRV LOADMOD,5 LOADM 00300000 ABRV MACLIB,3 MAC 00301000 ABRV MODMAP,3 MOD 00302000 ABRV MOVEFILE,4 MOVE 00303000 ABRV OPTION,TWO OP @V305066 00303100 ABRV PLIOPT,FOUR PLIO @V305066 00303200 ABRV PRINT,2 PR 00304000 ABRV PUNCH,2 PU 00305000 ABRV QUERY,1 Q 00306000 ABRV RENAME,1 R 00307000 ABRV RELEASE,3 REL 00308000 ABRV READCARD,4 READ 00309000 ABRV SCRIPT,2 SC 00310000 ABRV SVCTRACE,4 SVCT 00311000 ABRV SYNONYM,3 SYN 00312000 ABRV TYPE,1 T 00313000 ABRV TXTLIB,3 TXT 00314000 ABRV UPDATE,1 U 00315000 ABRV VSBASIC,THREE VSB @V305066 00315100 SPACE 2 00316000 LASTAB EQU *-9 MUST FOLLOW THE LAST ONE. 00317000 DMSINALT EQU LASTAB EXTERNAL NAME FOR 'LASTAB' @V305032 00317100 ERR1 EQU 1 ERROR 1 @V305066 00317200 TWO EQU 2 @V305066 00317300 THREE EQU 3 @V305066 00317400 FOUR EQU 4 @V305066 00317500 EJECT 00318000 NUCON 00319000 EJECT 00320000 REGEQU 00321000 END 00322000