.TITLE CCLCMD INITIAL COMMAND DECODER (TECO.TEC) .IDENT /V02.04/ .SBTTL INITIAL COMMAND DECODER (TECO.TEC) ; ; Comments added by Phil Stephensen-Payne 6-NOV-1980 ; .ENABL LC .NLIST BEX .NLIST BIN .RADIX 10 .PSECT PURE,RO,D ; TECO starts up via the code in TECINI. This sets up the various flags, ; currently as follows:- ; ET flag = 132 if terminal set to lower-case, 128 otherwise ; ED flag = 1 ; EU flag = -1 if terminal set as CRT, 0 otherwise ; Register 1 (numeric part) contains contents of TE.INI (I think) ; Filename buffer contains the MCR command line ; Text buffer contains the contents of CCLCMD (this lot) ; It then executes the (TECO) code in the buffer INITC in TECOIO. Usually ; this moves the contents of the filename buffer to Register Z and the ; contents of the text buffer to Register Y, kills the text buffer and tries ; to execute the file TECO.TEC. After that it excutes whatever code ; is in Register Y. ; ; For the user attempting to understand this initialization macro (which ; is the equivalent of several (uncommented) pages of code, I have tried ; to split it up into logical sections with comments where possible on what ; is occurring. I have changed none of the code from the original V35 ; distribution (it is too dangerous) so the following notes on nomenclature ; might be useful:- ; ; All the ASCII strings are delimited by ? which, obviously, is ; not going to occur frequently in the text. When it is required in the text ; it appears as <63>. ; All control characters (e.g. ^A for typing out a message) are ; represented by their numeric equivalent (^A=<1>, ^X=<24>, etc.). Other ; special characters are also presented as their numeric equivalents, ; especially (escape = <27>) and | (vertical bar = <124>). ; Rxtxt, Rxnum, Rxlen are short forms for the contents of the text ; storage area of Register x, the contents of the number storage area of ; Register x and the length of the text in Register x respectively. ; ; I have also attempted to indent the text to emphasize conditional ; code - though this is not always possible ; ; There are also several common structures in the following code ; probably worth discussing here, rather than individually:- ; ; 1. Store/restore all flags. ; The idea here is to save the initial state of various flags (which ; might have been determined at task-build time, and then reset them to ; the mode the user wants to operate in during the course of the macro. ; The first example of this occurs early on in the text as:- ; ; ?10U0[0?<4> <24>?U0[00?<24> ?EDU0[0ED&4ED? ?EUU0[0-1EU? ?ESU0[00ES? ; ?ETU0[032768#32#8#1,0ET? ; which saves the radix and sets it to decimal, the search flag and sets it ; to 'non case-sensitive', the case flagging flag and sets it to no ; case flagging, the search verification flag and sets it to -1, and the ; type out flag and sets it to a weird combination. Later, to restore ; the initial values, the user merely inserts:- ; ; ?]0Q0ET? ?]0Q0ES? ?]0Q0EU? ?]0Q0ED? ?]0Q0?<24> ?]0Q0?<18> ; which pops all the values off the stack. ; ; 2. Search for & remove switches. ; ; This version allows the specification of switches such as /NOINI ; which may be optionally be preceded by one or more spaces or tabs and ; may be abbreviated to as little as three characters. The method adopted ; for detecting and removing these switches is as follows:- ; ; ?:FS^ES/NOI?<27><27>?"SO/NOINI?<27>?' ; search for and delete for /NOI preceded by spaces & tabs & if ; found branch to /NOINI ; ?J:FS/NOI?<27><27>?"S? ; return to top and search for and delete /NOI with no spaces, and ; if successful drop through to /NOINI ; ?!/NOINI!::FSN?<27><27>?"S::FSI?<27><27><27>?'? ; if next character is N delete it and, if it was and the next character ; is I delete that as well (i.e. handle /NOI, /NOIN and /NOINI). ; ?::FS^ES?<27><27>?"S0A"AI ?<27>?''? ; in any case delete any trailing spaces or tabs and if there were ; some and the next character is now alphabetic re-insert a single space ; ?Q1#4096U1'? ; set a bit in a flag to say that we found /NOINI and end the ; conditional that started at the /NOINI label ; ; Changes: (All code marked (**Phil**)) ; 7-Nov-80 For RSX-11M if VTEDIT/GTEDIT not in user account ; it is also looked for in LB:[1,2] ; 7-Nov-80 If TECO.INI is not in user account it is looked ; for elsewhere as for VTEDIT/GTEDIT ; 7-Nov-80 Change default extension for MUNG files to .MUN. ; If MUNG file not found in user account, search for ; it elsewhere as for VTEDIT/GTEDIT. ; ; CCLCMD:: .ASCII ?!TECO.TEC V02.04!? ; Version Ident .ASCII ?[90,0X9[00,0X0[20,0X2? ; Save & clear some registers .ASCII ?10U0[0?<4><24>?U0[00?<24>?EDU0[0ED&4EDEUU0[0-1EU? .ASCII ?ESU0[00ESETU0[032768#32#8#1,0ET? ;Save flags .ASCII ?Q1U00U1[10,0X1? ; Stuff R1num in R0num & save R1 .ASCII ?Q0+1"E32768U0'? ;If flag was -1 reset to 32768 .ASCII ?32768"E:EITECO?<27> ; If Flag 32768 try to invoke TECO.TEC .ASCII ?"S]1Q0#32768U1[1JODONE?<27>?''? ; This seems irrelevant & unworkable? .ASCII ?Z"EGZ0,0XZ'? ; If buffer empty get RZtxt ; (command line) and clear RZtxt .ASCII ?J::FS^ES?<27><27><27> ; Clear any spaces & tabs at start .ASCII ?ZJ-:S^ES?<27>?"S.-Z"EFR?<27>?''? ; Clear any spaces & tabs at end .ASCII ?Z"EODONE?<27> ; If buffer now empty branch to DONE .ASCII ?'Q0&32767U10,0X10,0X9? ; Store R0num (less 32768 bit) in R1num ; Clear R1txt and R9txt .ASCII ?J:FS^ES/NOI?<27><27>?"SO/NOINI?<27>?'? .ASCII ?J:FS/NOI?<27><27>?"S? ; Search for & delete /NOINI .ASCII ?!/NOINI!::FSN?<27><27>?"S::FSI?<27><27><27>?'? .ASCII ?::FS^ES?<27><27>?"S0A"AI ?<27>?''Q1#4096U1'? .ASCII ?Q1&4096"E? ; If 'Noini' bit set then .ASCII ?HX0HKEPEAEF:EGINI?<27> ; Store buffer in R0txt & do Operating ;System specific function null on RSX ; and returns failure indicator) .ASCII ?"SG*J::FS$?<27><27> .ASCII ?"SHX1HK:ER^EQ1?<27> .ASCII ?"SYHX1HKECG1? .ASCII <124><1>?%Can't find initialization file "?<1> .ASCII ?:G1?<1>?"?<13><10><1>?''? .ASCII ?0,0X1? .ASCII <124>?0,0X1? ; Clear out R1txt .ASCII ?-1EJ-5"E? ; For VMS compatibility mode only .ASCII ?EN*.*?<27>?:EN?<27>?"S? .ASCII ?G*JS[?<27>?R0KFS.?<27>?]?<27>?JS]?<27>?0,.X1HK''? .ASCII ?:ER^EQ1TECO.INI?<27> ; Try to read TECO.INI .ASCII ?"SYHX9HKECG90,0X9? ; If OK read it in & close any output .ASCII ?OINIOK?<27> ; If OK goto INIOK (**Phil**) .ASCII ?''? ; Start of Extra code (**Phil**) .ASCII ?:EGLIB?<27>?"S? ; Another Op Sys specific thing (fails on RSX) .ASCII ?G*?<25>?X1?<25>?K? .ASCII <124><21>?1?<27>?'? ; Else (RSX) clear out R1txt .ASCII ?:Q1"E? ; If R1txt empty .ASCII ?-1EJ-1"E?<21>?1LB:[1,2]?<27>?'? ; For RSX-11M insert LB:[1,2] into R1txt (**Phil**) .ASCII ?-1EJ-4"E?<21>?1$?<27>?'? ; For RSTS/E insert $ into R1txt .ASCII ?-1EJ-7"E?<21>?1SY:?<27>?'? ; For type 7 insert SY: .ASCII ?-1EJ-5"E?<21>?1SYS$LIBRARY:?<27>?''? ; For VMS insert SYS$LIBRARY .ASCII ?:Q1"N:ER^EQ1TECO.INI?<27>?"SYHX9HKECG90,0X9''? ; Again try to invoke it .ASCII ?!INIOK!? .ASCII ?-1EJ-1"E 0,0X1'? ; For RSX-11M clear out R1 (**Phil**) ; End of Extra code (**Phil**) .ASCII ?ER?<27>?EW?<27> ; Reset to primary input & output .ASCII ?Z"NZJ.U0G1I=?<27>?G0Q0JZX9ZK? ; If buffer non-empty, put R1txt ; and r0txt separated by = in R9txt .ASCII ?]1]0Q0ET]0Q0ES]0Q0EU]0Q0ED]0Q0?<24>?]0Q0?<18>?]2? ; Restore all flags & registers .ASCII ?HX0HK? ; Store text buffer in R0txt & clear it .ASCII ?G9JS=?<27>?0,.-1X90,.K? ; Get R9txt before = in text buffer .ASCII ?M0? ; Execute R0txt (TECO.INI) .ASCII ?+0U90,0X0? ;Store any returned value in R9num & clear R0txt .ASCII ?[20,0X210U0[0?<4><24>?U0[00?<24>?EDU0[0ED&4EDEUU0[0-1EU? .ASCII ?ESU0[00ESETU0[032768#32#8#1,0ET? ; Save & reset flags .ASCII ?[1G9?<25>?X1?<25>?K0,0X9Q9U1? ; Copy R9txt & R9num to R1 .ASCII ?J::FS^ES?<27><27><27>?ZJ-:S^ES?<27>?"S.-Z"EFR?<27>?''? ; Clear leading & trailing tabs & spaces .ASCII ?Z"EOSCOPES?<27>?'? ; If buffer now empty goto SCOPES .ASCII <124>?G0''? ; Else (buffer empty) get R0txt .ASCII ?J:FS^ES/NOM?<27><27>?"SO/NOMEMORY?<27>?'J:FS/NOM?<27><27> .ASCII ?"S!/NOMEMORY!::FSE?<27><27>?"S::FSM?<27><27>?"S::FSO?<27><27> .ASCII ?"S::FSR?<27><27>?"S::FSY?<27><27><27>?''''::FS^ES?<27><27> .ASCII ?"S0A"AI ?<27>?''Q1#4U1'? ; Look for, flag & delete /NOMEMORY .ASCII ?J:FS^ES/NOC?<27><27>?"SO/NOCREATE?<27>?'? .ASCII ?J:FS/NOC?<27><27>?"S!/NOCREATE!::FSR?<27><27>?"S::FSE?<27><27> .ASCII ?"S::FSA?<27><27>?"S::FST?<27><27>?"S::FSE?<27><27><27>?''''? .ASCII ?::FS^ES?<27><27>?"S0A"AI ?<27>?''Q1#256U1? ; Look for, flag & delete /NOCREATE .ASCII ?'-1EJ-4"N? ; If not on RSTS/E .ASCII ?J::STE?<27>?"S<0A"AC>'::S^ES@?<27>?"S0KIMUNG ?<27>?'''? ; If buffer starts TExxx @, replace with MUNG .ASCII ?J::FSMU?<27><27>?"S<0A"AD>'::FS^ES?<27><27><27> ; If buffer starts MUxxx delete it & spaces/tabs .ASCII ?0U2? ; Initialize R2num to zero (**Phil**) .ASCII ?-1EJ-5"E? ; For RSTS/E only .ASCII ?J::FS"?<27><27>?"S::FS^ES?<27><27><27>?''? .ASCII ?ZU0J:S/?<27>?"S? ; Store buffer length in R0num & look for / .ASCII ?R.-Q0"L.U0''? ; If found store its offset in R0num instead .ASCII ?J:S^ES?<27>?"S.-Q0"L.U0''? ; Look for spaces & if before offset ; in R0num store their offset there instead .ASCII ?J?;.U1Q1-1J-:S[?<27>?"S:S]?<27>?"S .U2 .-Q1"GF<'''? ; Look for a comma, and if found see if it ; is bracketted by [ & ] and if so repeat for next comma .ASCII ?Q1-1J-:S?"S:S>?<27>?"S .U2 .-Q1"GF<'''? ; If not see if bracketted by <> .ASCII ?Q1-1J-:S(?<27>?"S:S)?<27>?"S .U2 .-Q1"GF<'''? ; If not see if bracketted by () .ASCII ?Q1-1J.-1-Q0"LD.U0'? ; Else if comma before R0num, ; delete it & reset R0num .ASCII ?0;>? ; Exit loop .ASCII ?Q0J<-.;-1A-32"N-1A-9"N0;''-D>? ; Delete any spaces/tabs ; immediately preceding offset R0num .ASCII ?.U0 J:S.?<27>?"S .-Q0"L Q0J OX?<27>?''Q0J I.MUN?<27>?!X!? ; If no extension, insert .MUN (**Phil**) .ASCII ?0,.X0::S^ES?<27><27>?0,.K? ;store buffer to current (macro name) ; in R0 & kill it plus any following spaces/tabs .ASCII ?:Q0"E?<1><63>?How can I MUNG nothing?<63><13><10><1><3><3>?'? ; If buffer empty output error and exit .ASCII ?Q2"N? ; Was a directory given? (**Phil**) .ASCII ?EI^EQ0?<27>?JODONE?<27> ; If so execute R0txt as file & goto DONE ; Start of Extra code (**Phil**) .ASCII <124>?:EI^EQ0?<27>?"SJODONE?<27> ; Else only try it provisionally .ASCII <124>?:EGMUN?<27>?"S? ; Else Op Sys specific thing (fails on RSX) .ASCII ?G*?<25>?X1?<25>?K? .ASCII <124><21>?1?<27>?'? ; Else (RSX) clear out R1txt .ASCII ?:Q1"E? ; If R1txt empty .ASCII ?-1EJ-1"E?<21>?1LB:[1,2]?<27>?'? ; For RSX-11M insert LB:[1,2] into R1txt (**Phil**) .ASCII ?-1EJ-4"E?<21>?1$?<27>?'? ; For RSTS/E insert $ into R1txt .ASCII ?-1EJ-7"E?<21>?1SY:?<27>?'? ; For type 7 insert SY: .ASCII ?-1EJ-5"E?<21>?1SYS$LIBRARY:?<27>?''? ; For VMS insert SYS$LIBRARY .ASCII ?EI^EQ1^EQ0?<27>?JODONE?<27> ; Again try to read it .ASCII ?''? ; End of Extra code (**Phil**) .ASCII ?'? .ASCII ?J:FS^ES/GT?<27><27>?"SO/GTEDIT?<27>?'J:FS/GT?<27><27>?"S? .ASCII ?!/GTEDIT!::FSE?<27><27>?"S::FSD?<27><27>?"S::FSI?<27><27> .ASCII ?"S::FST?<27><27><27>?'''::FS^ES?<27><27>?"S0A"AI ?<27>?''? .ASCII ?Q1#64U1'? ; Look for, flag & delete /GTEDIT .ASCII ?J:FS^ES/VT?<27><27>?"SO/VTEDIT?<27>?'J:FS/VT?<27><27>?"S? .ASCII ?!/VTEDIT!::FSE?<27><27>?"S::FSD?<27><27>?"S::FSI?<27><27> .ASCII ?"S::FST?<27><27><27>?'''::FS:H?<27><27>?"S::FSO?<27><27> .ASCII ?"S::FSL?<27><27>?"S::FSD?<27><27><27>?''Q1#32U1'::FS:S?<27><27> .ASCII ?"S::FSE?<27><27>?"S::FSE?<27><27>?"S::FSA?<27><27> .ASCII ?"S::FSL?<27><27>?"S::FSL?<27><27><27>?''''Q1#16U1'::FS:H?<27><27> .ASCII ?"S::FSO?<27><27>?"S::FSL?<27><27>?"S::FSD?<27><27><27>?''? .ASCII ?Q1#32U1'::FS^ES?<27><27>?"S0A"AI ?<27>?''Q1#1U1'? ; Look for, flag & delete /VTEDIT<:xxx> .ASCII ?J:FS^ES/SC?<27><27>?"SO/SCROLL?<27>?'J:FS/SC?<27><27>?"S? .ASCII ?!/SCROLL??!::FSR?<27><27>?"S::FSO?<27><27>?"S::FSL?<27><27> .ASCII ?"S::FSL?<27><27><27>?'''::FS:?<27><27>?"S\U2FR?<27><124>?0U2'? .ASCII ?::FS^ES?<27><27>?"S0A"AI ?<27>?''Q1#128U1'? ; Look for, flag & delete /SCROLL<:n> ; Store n (or 0 if not given) in R2num .ASCII ?J::FSTE?<27><27>?"S<0A"AD>'::FS^ES?<27><27><27> ; If buffer starts TExxx delete it & following spaces/tabs .ASCII ?J:FS^ES/IN?<27><27>?"SO/INSPECT?<27>?'J:FS/IN?<27><27>?"S? .ASCII ?!/INSPECT!::FSS?<27><27>?"S::FSP?<27><27>?"S::FSE?<27><27> .ASCII ?"S::FSC?<27><27>?"S::FST?<27><27><27>?''''? .ASCII ?::FS^ES?<27><27>?"S0A"AI ?<27>?''Q1#2U1'? ; Look for flag & delete /INSPECT .ASCII ?J:FS^ES/FI?<27><27>?"SO/FIND?<27>?'J:FS/FI?<27><27>?"S? .ASCII ?!/FIND!::FSN?<27><27>?"S::FSD?<27><27><27>?'? .ASCII ?::FS^ES?<27><27>?"S0A"AI ?<27>?''Q1#8U1'? ; Look for, flag & delete /FIND .ASCII ?J<27>?;>? ; Delete all spaces/tabs in the buffer .ASCII ?Q1&4#Z"E? ; If /NOMEMORY bit not set & buffer empty .ASCII ?:EGMEM?<27>?"SG*J::FS$?<27><27>?"SF?<124>?'? ; (not on RSX) .ASCII <124>?Z"E? ; Else if buffer empty .ASCII ?-1EJ-1"E 0,0X1'? ; For RSX-11M clear out R1 (**Phil**) .ASCII ?:Q1"E-1EJ-5"E? ; If R1len zero & on VMS .ASCII ?EN*.*?<27>?:EN?<27>?"SG*JS[?<27>?R0K? .ASCII ?FS.?<27>?]?<27>?JS]?<27>?0,.X1HK'''? .ASCII ?:Q9"E0EJ+100\JDG1ITECF?<27>?ZJI.TMP?<27> ; If R9len zero build file name from R1txt, TECF, ; job number & .TMP .ASCII ?-1EJ-4"EI<60>/MODE:#3000?<27> ; If RSTS/E append mode .ASCII <124>?-1EJ-7"NI;1/-CR?<27>?''? ; Else add ;1/-CR .ASCII ?HX9HK'? ; Store result in R9txt .ASCII ?G9'? ; Get R9txt .ASCII ?HX0HKEPEAEF:ER^EQ0?<27> ; Store filename in R0 & try to ; open as secondary file .ASCII ?"SYL."N-1A-10"E-D''."N-1A-13"E-D''ZKHX0HKECG0'? ; If OK, read in first line, delete any CRLF on ; it, delete rest of buffer & store in R0txt, ; close file & get R0txt back in buffer .ASCII ?ER?<27>?EW?<27>?0,0X0'? ; Reset to primary input/output ; & kill R0txt .ASCII ?J<27>?;>? ; Delete any spaces/tabs .ASCII ?J:FS/FI?<27><27>?"S::FSN?<27><27>?"S::FSD?<27><27><27>?'? .ASCII ?Q1#8192#8U1'? ; Look for, flag and delete /FIND .ASCII ?Z"NQ1#32768#16384U1''? ; If buffer not empty set bits .ASCII ?Q1&16384"N? ; If something to edit .ASCII ?Q1&2"E? ; and /INSPECT not specified .ASCII <1>?Edi?<1> ; Output 'Edi' .ASCII <124><1>?Inspec?<1>?'? ; Else output 'Inspec' .ASCII <1>?ting file? ; followed by 'ting file' .ASCII ? "?<1>?HT?<1>?"?<13><10><1>?'? ; and filename .ASCII ?Z"E? ; If buffer empty .ASCII ?Q1&2"EOSCOPES?<27>?'? ; and /INSPECT not given, goto SCOPES .ASCII <1><63>?How can I inspect nothing?<63><13><10><1><3><3>?'? ; Else output message and exit .ASCII ?Q1&2"E? ; If /INSPECT not given .ASCII ?J:S=?<27>?"S? ; Look for = in buffer .ASCII ?0,.-1X00,.KZU0HX2HK:Q2"N? ; If found store first name ; in R0txt, second in R2txt and see if R2len non-zero .ASCII ?:ER^EQ2?<27>?"UG2HX0HKONOTFND?<27>?''? ; If not try to open second file, and if that fails ; get its name and goto NOTFND .ASCII ?:Q0"NEW^EQ0?<27>?'? ;if R0len non-zero, open first ; file for output .ASCII ?Q0"NQ1#2048U1'OREMEM?<27>?''? ; If R0num non-zero, set bit in R1num & goto REMEM .ASCII ?HX0HK? ; Save text buffer in R0txt & delete it .ASCII ?Q1&2"E? ; Else (no = in buffer) if /INSPECT not given .ASCII ?:EB^EQ0?<27>?"S? ; Attempt to open file as Edit Backup .ASCII ?Q1#2048U1OREMEM?<27>?'? ; If OK set bit & goto REMEM .ASCII ?Q1&256"NQ1&32768"EONOTFND?<27>?''? ; Else (file open failed) if no automatic file ; creation on open failure goto NOTFND .ASCII <1>?%Can't find file "?<1>?:G0?<1>?"?<13><10><1> ; Else say can't find file .ASCII ?Q1&32768"E?<1>?%Creating new file?<13><10><1>?OCREATE?<27> ; If filename given, say creating it & goto CREATE .ASCII <124><1>?%Ignoring TECO's memory?<13><10><1> .ASCII ?Q1#8192U10,0X0OREMEM?<27>?''? ; If name from memory, say ignoring memory, set ; bit 8192 and goto REMEM .ASCII ?:ER^EQ0?<27>?"S? ;Else (/INSPECT) try to open for read .ASCII ?Q1#2048U1OSCOPES?<27>?'? ; If OK, set bit 2048 & goto SCOPES .ASCII ?!NOTFND!?<1><63>?Can't find file "?<1>?:G0?<1>?"?<63><13><10><1> .ASCII <3><3>?'? ;Output message and exit .ASCII ?J::FSMA?<27><27>?"S<0A"AD>'::FS^ES?<27><27><27> ; If buffer starts MAxxx, delete that & any ; following tabs/spaces .ASCII ?J<27>?;>? ;Delete all tabs/spaces in buffer .ASCII ?Z"E?<1><63>?How can I MAKE nothing?<63><13><10><1><3><3>?'? ; If buffer empty output message and exit .ASCII ?Z-4"EJ::SLOVE?<27>?"S?<1>?Not war?<63><13><10><1>?''? ; If buffer contains only LOVE give corny message .ASCII ?HX0HK? ; Stuff name in R0txt & clear buffer .ASCII ?!CREATE!EW^EQ0?<27>?OREMEM?<27>?'? ; Open given file for output & goto REMEM .ASCII <1>?%??Unrecognized command "?<1>?HTHK?<1>?"?<13><10><1>?OSCOPES?<27> ; Anything else is unrecognized - goto SCOPE .ASCII ?!REMEM!Q1&8192"NOWRITE?<27>?'? ; If 8192 bit set goto NOWRITE .ASCII ?Q1&(32768#4)"NOSCOPES?<27>?'? ; If /NOMEMORY, or came from memory, goto SCOPES .ASCII ?:Q0"EOSCOPES?<27>?'? ; If R0txt empty goto SCOPES .ASCII ?!WRITE!:EGMEM?<27>?"S? ; Do Op Sys specific thing (fails on RSX) .ASCII ?ZJG*?<19>?C::FS$?<27><27>?"UZK:EGMEM ^EQ0?<27><27> .ASCII <124>?ZX9ZKF?<124>?'? .ASCII <124>?:Q9"E? ; Else (RSX) if Q9txt is empty .ASCII ?-1EJ-1"E 0,0X1'? ; For RSX-11M clear out R1 (**Phil**) .ASCII ?:Q1"E-1EJ-5"E? ; and if R1txt empty & on VMS .ASCII ?EN*.*?<27>?:EN?<27>?"SZJ.U0G*Q0JS[?<27>?RQ0,.KFS.?<27> .ASCII ?]?<27>?Q0JS]?<27>?Q0,.X1Q0,ZK'''? .ASCII ?G1?<25>?X9?<25>?K? ; Move R1txt to R9txt .ASCII ?:?<21>?9TECF?<27>?0EJ+100\.-2,.:X9-3D:?<21>?9.TMP?<27> ; Append TECFnn.TMP as before .ASCII ?-1EJ-4"E:?<21>?9<60>/MODE:#3000?<27> .ASCII <124>?-1EJ-7"N:?<21>?9;1/-CR?<27>?'''? ; Add Mode or /CR as before .ASCII ?EA:EW^EQ9?<27>?"SG0?<25>?PW?<25>?K'EFEW?<27>?'? ; Open for output, if OK output R0txt, close file ; and reset to primary output file .ASCII ?!SCOPES!? .ASCII ?Q1&64"NET&1024"E? ; If GTEDIT requested but screen not refresh .ASCII <1>?%You don't have a refresh scope?<13><10><1>?Q1#64-64U1''? ; Output message and remove request for GTEDIT .ASCII ?Q1&1"N? ; If VTEDIT requested .ASCII ?ET&512"E? ; but screen not interactive .ASCII <1>?%Your terminal is not an interactive scope?<13><10> .ASCII <1>?Q1#1-1U1? ; Output message and remove VTEDIT request .ASCII <124>?0,3:W?<27> ; Else (screen interactive) set off SEEALL .ASCII ?Q1&16"N-1,3:W?<27>?'? ; If SEEALL requested, set in on again .ASCII ?0,5:W?<27>?Q1&32"N-1,5:W?<27>?'''? ; If HOLD requested set it on, else set it off .ASCII ?Q1&(64#1)"EOYANK?<27>?'? ; If neither VTEDIT nor GTEDIT ; required goto YANK .ASCII ?Q1&64"N?<21>?9GTE?<27> ; If GTEDIT requested put GTE in R9txt .ASCII <124><21>?9VTE?<27>?'? ; else put VTE in R9txt .ASCII ?:EG^EQ9?<27>?"S? ; Do Op Sys specific thing (fails on RSX) .ASCII <21>?1?<27>?G*?<25>?X9?<25>?K? .ASCII <124>?:?<21>?9DIT?<27> ; Else (RSX) append DIT to R9txt .ASCII ?:Q1"E-1EJ-5"EEN*.*?<27>?:EN?<27>?"SZJ.U0G*Q0JS[?<27> ; If R1txt empty and on VMS then ... .ASCII ?RQ0,.KFS.?<27>?]?<27>?Q0JS]?<27>?Q0,.X1Q0,ZK''''? .ASCII ?:Q9"N:EI^EQ1^EQ9?<27>?"S? ; If R9txt not empty, try to ; execute named file as Indirect command file .ASCII ?Q1#2048-2048U1OYANK?<27>?''? ; If OK clear 2048 bit & goto YANK .ASCII ?:EGLIB?<27>?"S? ; Another Op Sys specific thing (fails on RSX) .ASCII ?G*?<25>?X1?<25>?K? .ASCII <124><21>?1?<27>?'? ; Else (RSX) clear out R1txt .ASCII ?:Q1"E? ; If R1txt empty .ASCII ?-1EJ-4"E?<21>?1$?<27>?'? ; For RSTS/E insert $ into R1txt .ASCII ?-1EJ-1"E?<21>?1LB:[1,2]?<27>?'? ; For RSX-11M insert LB:[1,2] into R1txt (**Phil**) .ASCII ?-1EJ-7"E?<21>?1SY:?<27>?'? ; For type 7 insert SY: .ASCII ?-1EJ-5"E?<21>?1SYS$LIBRARY:?<27>?''? ; For VMS insert SYS$LIBRARY .ASCII ?Q1&64"N?<21>?9GTEDIT?<27> ; If GTEDIT requested insert GTEDIT .ASCII <124><21>?9VTEDIT?<27>?'? ; Else insert VTEDIT .ASCII ?:Q1"N:EI^EQ1^EQ9?<27>?"SQ1#2048-2048U1OYANK?<27>?''? ; Again try to invoke it .ASCII <1>?%The ?<1>?:G9?<1>? macro is not available?<13><10><1> ; Say GTEDIT/VTEDIT not available .ASCII ?!YANK!Q1&2048"NY'? ; If Yank bit set do a yank .ASCII ?JQ1&8"N? ; If /FIND specified .ASCII <1>?Finding position marker...?<13><10><1> ; Output message .ASCII ?EW?<27>?G*?<25>?X0?<25>?K? ; Reset to primary output, get filespec of output ; file and stuff it in R0txt .ASCII ?-1?<24> ; Set search flag to identical match .ASCII ?:Q0"N:FN?<126><126>?/\?<126><126><13><10><27><27>?U0? ; If R0len not zero (output file specified) do ; non-destructive search & put result in R0num .ASCII <124>?:F_?<126><126>?/\?<126><126><13><10><27><27>?U0'? ; Else (no output file) do destructive search .ASCII ?0?<24> ; Reset search flag .ASCII ?Q0"U?<1><63>?Position marker not found?<63><13><10><1><3><3>?''? ; Output message and terminate .ASCII ?Q1&128"N? ; If /SCROLL specified .ASCII ?ET&512"E? ; but terminal not interactive .ASCII <1>?%Your terminal is not an interactive scope?<13><10><1> ; Output message .ASCII <124>?Q2"E? ; Else (terminal is interactive) if scroll number zero .ASCII ?2:W/4U2'? ; Set scroll number to quarter of screen .ASCII ?Q2,7:W? ; Set scroll lines .ASCII ?-Q2"N?<1>?%Your terminal doesn't support scrolling?<13><10><1>?'''? ; If no scroll lines output message .ASCII ?!DONE!]1]0Q0ET]0Q0ES]0Q0EU]0Q0ED]0Q0?<24>?]0Q0?<18>?]2]0]90,0XY? ; Restore all saved flags & registers CCLCML == .-CCLCMD .EVEN .END