TRM TITLE 'DMKTRM (CP) VM/370 - RELEASE 6' 00001000 ISEQ 73,80 00002000 *. 00003000 * MODULE NAME - 00004000 * 00005000 * DMKTRM 00006000 * 00007000 * FUNCTION - 00008000 * 00009000 * TO IDENTIFY A 2741 TERMINAL AS EITHER 2741P (PTTC/EBCD) 00010000 * OR 2741C ("CORRESPONDENCE") FROM THE FIRST USER COMMAND. 00011000 * 00012000 * ATTRIBUTES - 00013000 * 00014000 * REENTRANT, PAGEABLE, CALLED VIA SVC 00015000 * 00016000 * ENTRY POINTS - 00017000 * 00018000 * DMKTRMID 00019000 * 00020000 * ENTRY CONDITIONS - 00021000 * 00022000 * GPR 0 = BYTE-COUNT OF INPUT LINE 00023000 * GPR 1 = ADDRESS OF TERMINAL INPUT LINE 00024000 * GPR 8 = ADDRESS OF TERMINAL RDEVBLOK 00025000 * GPR 11 = ADDRESS OF USER'S VMBLOK 00026000 * GPR 12 = MODULE BASE REGISTER 00027000 * GPR 13 = ADDRESS OF STANDARD SAVE AREA 00028000 * 00029000 * EXIT CONDITIONS - 00030000 * 00031000 * RDEVTYPE (IN RDEVBLOK) SET TO 'TYP2741P' OR 'TYP2741C' 00032000 * AND FLAG RDEVIDNT TURNED ON IF TERMINAL WAS SUCCESSFULLY 00033000 * IDENTIFIED. 00034000 * 00035000 * CALLS TO OTHER ROUTINES - 00036000 * 00037000 * NONE 00038000 * 00039000 * EXTERNAL REFERENCES - 00040000 * 00041000 * NONE 00042000 * 00043000 * TABLES / WORK AREAS - 00044000 * 00045000 * RDEVBLOK 00046000 EJECT 00047000 * REGISTER USAGE - 00048000 * 00049000 * GPR 1 = ADDRESS OF FIRST NON-BLANK WORD IN USER COMMAND 00050000 * GPR 8 = ADDRESS OF TERMINAL RDEVBLOK 00051000 * GPR 12 = BASE REGISTER 00052000 * GPR 13 = ADDRESS OF STANDARD SAVE AREA 00053000 * 00054000 * GPR 0, 2, 3, 4, 5 = WORK REGISTERS 00055000 * 00056000 * GPR 6-7, 9-11, 14-14 ARE NOT USED 00057000 * 00058000 * NOTES - 00059000 * 00060000 * NONE 00061000 * 00062000 * OPERATION - 00063000 * 00064000 * 1. GIVEN RAW INPUT LINE VIA R0-R1, SCANS FOR FIRST NONBLANK 00065000 * CHARACTER STRING. (ERROR RETURN IF NOT FOUND). 00066000 * 00067000 * 2. DETERMINES NUMBER OF BYTES (LESS 1) IN NONBLANK STRING 00068000 * (ERROR RETURN IF THERE WERE MORE THAN 8 BYTES). 00069000 * OR'S IN HEX 80'S TO TREAT AS UPPER CASE. 00070000 * 00071000 * 3. CHECKS NUMBER OF BYTES INPUTTED AGAINST A LIMITED NUMBER 00072000 * OF RESERVED-WORDS FOR LEGITIMATE "FIRST COMMAND" 00073000 * (REFER TO TABLE AT LABEL FIRST1 FOR A COMPLETE LIST) 00074000 * FOR 2741P (PTTC/EBCD) TERMINAL. 00075000 * 00076000 * 4. IF STEP 3 FAILS, REPEATS TEST FOR 2741C 00077000 * ("CORRESPONDENCE") TERMINAL. 00078000 * 00079000 * 5. IF STEP 3 OR 4 SUCCEEDED, STORES RDEVTYPE OF 00080000 * "TYP2741P" OR "TYP2741C" IN TERMINAL RDEVBLOK, 00081000 * AND EXITS TO CALLER. 00082000 * 00083000 * 6. IF ALL TESTS FAIL (OR CHARACTER STRING MISSING OR 00084000 * MORE THAN 8 BYTES) EXIT TO CALLER. 00085000 * 00086000 *. 00087000 EJECT @V4075A0 00087100 COPY OPTIONS @V4075A0 00087200 EJECT @V4075A0 00087300 EJECT 00088000 *********************************************************************** 00089000 * 00090000 * DMKTRMID 00091000 * 00092000 *********************************************************************** 00093000 SPACE 00094000 DMKTRM CSECT 00095000 SPACE 00096000 USING PSA,R0 00097000 USING RDEVBLOK,R8 00098000 USING SAVEAREA,R13 00099000 SPACE 00100000 DC CL8'DMKTRM' MODULE IDENTIFIER. 00101000 SPACE 00102000 DMKTRMID RELOC 00103000 SWITCH MAKE SURE WE ARE ON THE IO PROCESSOR @V4075A0 00103100 LTR R0,R0 INPUT COUNT MUST BE .GE. ONE 00104000 BNP TRMEXIT IF NOT, LEAVE 00105000 LA R3,1 R3 = 1 (FOR 'AR' & 'SR' USE) 00106000 TRM1ST CLI 0(R1),BLNK SCAN FOR FIRST NON-BLANK CHARACTER 00107000 BE BLANKFND THIS ONE'S A BLANK @VA03612 00108000 CLI 0(R1),BLANK COULD IT BE AN UPPER CASE BLANK? @VA03612 00109000 BNE TRM1STOK NO - GOOD SHOW WHEN NON-BLANK FND@VA03612 00110000 BLANKFND AR R1,R3 ADVANCE TO NEXT CHARACTER @VA03612 00111000 BCT R0,TRM1ST ITERATE TILL WE FIND IT. 00112000 B TRMEXIT BAD NEWS IF NOTHING THERE - EXIT 00113000 TRM1STOK LR R2,R1 START WHERE 1ST BYTE IS 00114000 TRM2ND CLI 1(R2),BLNK NOW SCAN FOR A BLANK CHARACTER 00115000 BE TRM2NDOK GOOD SHOW WHEN BLANK FOUND @VA03612 00116000 CLI 1(R2),BLANK COULD IT BE AN UPPER CASE BLANK? @VA03612 00117000 BE TRM2NDOK YES -- GOOD SHOW @VA03612 00118000 AR R2,R3 ADVANCE TO NEXT BYTE, 00119000 BCT R0,TRM2ND KEEP LOOKING 00120000 SR R2,R3 SUBTRACT ONE IF WE DROPPED THRU BCT 00121000 TRM2NDOK SR R2,R1 LESS WERE WE STARTED = BYTE-COUNT LESS 1 00122000 C R2,F7 MUST BE 7 OR LESS 00123000 BH TRMEXIT IF NOT, USER TYPED IN 9 NON-BLANK CHARS. 00124000 EX R2,EXUPR 'OR' IN 'UPPER CASE' BITS 00125000 LA R0,RDEVPTTC SET FOR 2741P (PTTC/EBCD) 00126000 LA R3,FIRST1 SET FOR BXLE LOOP FOR 2741P 00127000 LA R4,8 ... 00128000 LA R5,LAST1 ... 00129000 TRMLOOP1 EX R2,EXCLC LOOK FOR LEGAL COMMAND 00130000 BE TRMGOOD GOOD SHOW IF WE FOUND IT. 00131000 BXLE R3,R4,TRMLOOP1 KEEP LOOKING THRU TABLE OF COMMANDS. 00132000 * 00133000 LA R0,RDEVCORR IF FAILED, ASSUME CORRESPONDENCE TERMINAL 00134000 LA R3,FIRST2 ... 00135000 LA R5,LAST2 ... 00136000 TRMLOOP2 EX R2,EXCLC LOOK AGAIN FOR LEGAL COMMAND 00137000 BE TRMGOOD GOOD SHOW IF WE'VE GOT IT. 00138000 BXLE R3,R4,TRMLOOP2 KEEP LOOKING. 00139000 B TRMEXIT AND GO EXIT. 00140000 * 00141000 TRMGOOD STC R0,RDEVTMCD STORE SUCCESSFUL TERMINAL CODE 00142000 OI RDEVFLAG,RDEVIDNT INDICATE TERMINAL IS IDENTIFIED 00143000 NI RDEVTFLG,X'FF'-RDEVATOF TURN ON EXCLAIMATION POINT 00144000 * 00145000 TRMEXIT EXIT EXIT TO CALLER. 00146000 * 00147000 EXUPR OC 0(*-*,R1),UBLANKS TO CONVERT TO 'UPPER CASE' 00148000 EXCLC CLC 0(*-*,R1),0(R3) COMPARE WITH KNOWN LEGAL COMMANDS 00149000 EJECT 00150000 * LEGITIMATE "FIRST COMMAND" FOR 2741P (PTTC/EBCD) TERMINALS: 00151000 SPACE 00152000 FIRST1 DS 0D 00153000 DC AL1(L),AL1(O),AL1(G),AL1(I),AL1(N),3X'00' LOGIN 00154000 DC AL1(L),AL1(O),AL1(G),AL1(O),AL1(N),3X'00' LOGON 00155000 DC AL1(D),AL1(I),AL1(A),AL1(L),4X'00' DIAL 00156000 DC AL1(D),AL1(I),AL1(S),AL1(C),AL1(O),AL1(N),AL1(N),X'00' *00157000 DISCONN 00158000 DC AL1(M),AL1(S),AL1(G),5X'00' MSG 00159000 DC AL1(M),AL1(E),AL1(S),AL1(S),AL1(A),AL1(G),AL1(E),X'00' *00160000 MESSAGE 00161000 DC AL1(H),AL1(E),AL1(L),AL1(P),4X'00' HELP 00162000 DC AL1(L),AL1(O),AL1(G),AL1(O),AL1(U),AL1(T),2X'00' LOGOUT 00163000 DC AL1(L),AL1(O),AL1(G),AL1(O),AL1(F),AL1(F),2X'00' LOGOFF 00164000 DC AL1(S),AL1(L),AL1(E),AL1(E),AL1(P),3X'00' SLEEP 00165000 DC AL1(C),AL1(P),6X'00' CP 00166000 DC AL1(@ASTRSK),7X'00' * 00167000 LAST1 EQU *-8 00168000 SPACE 2 00169000 * LEGITIMATE "FIRST COMMAND" FOR 2741C ("CORRESPONDENCE") TERMINALS: 00170000 SPACE 00171000 FIRST2 DS 0D 00172000 DC AL1(LL),AL1(OO),AL1(GG),AL1(II),AL1(NN),3X'00' 00173000 DC AL1(LL),AL1(OO),AL1(GG),AL1(OO),AL1(NN),3X'00' 00174000 DC AL1(DD),AL1(II),AL1(AA),AL1(LL),4X'00' 00175000 DC AL1(DD),AL1(II),AL1(SS),AL1(CC$),AL1(OO),AL1(NN),AL1(NN)*00176000 ,X'00' 00177000 DC AL1(MM),AL1(SS),AL1(GG),5X'00' 00178000 DC AL1(MM),AL1(EE),AL1(SS),AL1(SS),AL1(AA),AL1(GG),AL1(EE),*00179000 X'00' @VA02313 00180000 DC AL1(HH),AL1(EE),AL1(LL),AL1(PP),4X'00' 00181000 DC AL1(LL),AL1(OO),AL1(GG),AL1(OO),AL1(UU),AL1(TT),2X'00' 00182000 DC AL1(LL),AL1(OO),AL1(GG),AL1(OO),AL1(FF),AL1(FF),2X'00' 00183000 DC AL1(SS),AL1(LL),AL1(EE),AL1(EE),AL1(PP),3X'00' 00184000 DC AL1(CC$),AL1(PP),6X'00' @VA02313 00185000 DC AL1(@@ASTRSK),7X'00' 00186000 LAST2 EQU *-8 00187000 SPACE 2 00188000 UBLANKS DC 8AL1(X'80') 00189000 EJECT 00190000 * HEX EQUIVALENTS OF "RAW" UPPER CASE CHARACTERS 00191000 * FOR 2741P (PTTC/EBCD) TERMINAL: 00192000 * 00193000 A EQU X'E2' 00194000 B EQU X'E4' 00195000 C EQU X'E7' 00196000 D EQU X'E8' 00197000 E EQU X'EB' 00198000 F EQU X'ED' 00199000 G EQU X'EE' 00200000 H EQU X'F0' 00201000 I EQU X'F3' 00202000 J EQU X'C3' 00203000 K EQU X'C5' 00204000 L EQU X'C6' 00205000 M EQU X'C9' 00206000 N EQU X'CA' 00207000 O EQU X'CC' 00208000 P EQU X'CF' 00209000 Q EQU X'D1' 00210000 R EQU X'D2' 00211000 S EQU X'A5' 00212000 T EQU X'A6' 00213000 U EQU X'A9' 00214000 V EQU X'AA' 00215000 W EQU X'AC' 00216000 X EQU X'AF' 00217000 Y EQU X'B1' 00218000 Z EQU X'B2' 00219000 @ASTRSK EQU X'90' 00220000 EJECT 00221000 * HEX EQUIVALENTS OF "RAW" UPPER CASE CHARACTERS 00222000 * FOR 2741C ("ATS" = "CORRESPONDENCE") TERMINAL: 00223000 * 00224000 AA EQU X'CF' 00225000 BB EQU X'B7' 00226000 CC$ EQU X'AF' CC$ (CAN'T USE "CC" OR "CCC") 00227000 DD EQU X'AA' 00228000 EE EQU X'A9' 00229000 FF EQU X'E7' 00230000 GG EQU X'E2' 00231000 HH EQU X'B2' 00232000 II EQU X'CC' 00233000 JJ EQU X'E1' 00234000 KK EQU X'AC' 00235000 LL EQU X'B1' 00236000 MM EQU X'C3' 00237000 NN EQU X'A5' 00238000 OO EQU X'D1' 00239000 PP EQU X'E8' 00240000 QQ EQU X'ED' 00241000 RR EQU X'CA' 00242000 SS EQU X'D2' 00243000 TT EQU X'A0' 00244000 UU EQU X'A6' 00245000 VV EQU X'C6' 00246000 WW EQU X'D7' 00247000 XX EQU X'A3' 00248000 YY EQU X'F3' 00249000 ZZ EQU X'95' 00250000 @@ASTRSK EQU X'8E' 00251000 * 00252000 BLNK EQU X'01' LOWER-CASE BLANK 00253000 BLANK EQU X'81' UPPER-CASE BLANK 00254000 EJECT 00255000 COPY RBLOKS 00256000 COPY SAVE 00257000 COPY DEVTYPES 00258000 COPY EQU 00259000 PSA 00260000 END 00261000