Stored on: VT.TXT Author: Paul Mennen Date: 3-Mar-84 Contents: Description of VT.TEC and H19.TEC Teco Screen Editors CONTENTS A.) Abstract 2 B.) Files supplied 2 C.) Introduction 3 D.) Squishing the macros 3 E.) Installation 4 F.) Special Notation 5 G.) Key usage on the VT-100 6 H.) Key usage on the H19 7 I.) The Insert Mode 8 J.) Use of the Special Function Keys 8 K.) Other Important Commands 9 L.) The Command Repeat Feature 10 M.) Additional Cursor Positioning Commands 10 N.) Additional File Manipulation Commands 10 O.) Additional Deletion Commands 11 P.) Additional Insertion Commands 11 Q.) Margin Control Commands 11 R.) Miscellaneous Commands 12 S.) Notes on the use of the Command Key 12 T.) Patching TECO for use with TSX+ 13 2 A.) ABSTRACT This package consists of two TECO macros which provide the TECO user with the convenience of a full screen editor with a clean user interface, while retaining the full power and generality of TECO. One of the macros requires a VT-100 compatible terminal and the second macro requires a Heath H19 or a Zenith Z19 terminal. The macros are well commented, which makes them more easily adapted to other terminals or other special requirements. These macros have been fully tested under the following configurations: a) RT-11SJ version 4 with TECO-11 version 36 b) TSX+ version 3.1 with TECO-11 version 36 c) RSX-11M version 4.0 with TECO-11 version 35 However, it should also run with most RT-11 and RSX releases and with other operating systems which support TECO-11. Requires TECO-11 version 35 or later. Supplied in RT-11 format, but instructions for converting it to RSX format via FILEX are included. A 13 page manual is included. B.) FILES SUPPLIED VT.TEC - for use with any VT-100 or VT-100 compatible terminal VTINI.TEC - used to start VT.TEC (must be renamed TECO.INI) H19.TEC - for use with Heath H19 or Zenith Z19 terminals H19INI.TEC - used to start H19.TEC (must be renamed TECO.INI) VT.TES - commented version of VT.TEC VTINI.TES - commented version of VTINI.TEC H19.TES - commented version of H19.TEC H19INI.TES - commented version of H19INI.TEC EB.COM - command file for TSX+ EB.TEC - called by EB.COM NEW.COM - command file for TSX+ NEW.TEC - called by NEW.COM SQU.TEC - squish teco macro VT.TXT - this text file 3 C.) INTRODUCTION These macros were written to provide the TECO user with the convenience of a full screen editor without taking away any of TECO's impressive flexibility to which we have become accustom. VT.TEC will work with any VT-100 or VT-100 compatible terminal. The VT-100 is used in the VT-52 compatibility mode to simplify the escape sequences required. VT.TEC will automatically switch the terminal to VT-52 mode when it initializes and will switch the terminal back to ANSII mode when it exits. H19.TEC uses the Heath mode which is a superset of the VT-52 compatibility mode. H19.TEC will automatically switch the terminal to Heath mode. The terminal is left in Heath mode when the macro exits. Here is a comparison of VT.TEC and H19.TEC with VTEDIT.TEC the well known TECO macro which inspired me to write this package. 1.) Contains most of the features found in VTEDIT 2.) Runs faster 3.) Easier to learn (I think) 4.) Well commented. Makes it easy to modify, and serves as a useful example of Teco programming. 5.) Some new features (e.g. justify, fill, 15 character move function) 6.) A version for the popular H19 terminal. This version, in fact, runs better than VT.TEC because of the insert mode of the H19. D.) SQUISHING THE MACROS The commented versions of these macros (TES files) may be run, but this is not recommended, since they run much much slower than the squished versions (TEC files). If you want to make any changes in these macros, you should edit the TES file and then squish it (using SQU.TEC) to create the TEC file. For example, to squish VT.TES to create VT.TEC, use this procedure: .RUN TECO *EISQU$$ (run the squish macro) ........... ? N (answer the 7 questions as follows) ........... ? Y ........... ? Y ........... ? Y ........... ? N ........... ? Y ........... ? N File <*.TEC> VT.TES (enter name of file to be squished) (now wait for "*" - many minutes) *EWVT.TEC$$ (save the squished version) *EX$$ (exit teco) . Since the TEC files are included in the distrubition, the average user will not need to know about the above procedure. 4 E.) INSTALLATION a.) RT-11 1.) If you have a VT-100: Copy VTINI.TEC of the distribution to DK:TECO.INI Copy VT.TEC of the distribution to SY:VT.TEC If you have a H19 or Z19 Copy H19INI.TEC of the distribution to DK:TECO.INI Copy H19.TEC of the distribution to SY:H19.TEC 2.) type: SET EDIT TECO (this command should be in your STARTS.COM) SET TT SCOPE (this command should be in your STARTS.COM) 3.) type: EDIT/INSPECT filename (to inspect a file) EDIT/CREATE filename (to create a new file) EDIT filename (to edit existing file; do a backup) note: I have not been able to get this macro to run under RT11FB. If anyone knows what the problem is please let me know. b.) TSX+ 1.) Do steps 1 and 2 above 2.) Patch TECO.SAV as described in section T (page 13) 3.) Copy EB.COM, EB.TEC, NEW.COM, NEW.TEC to DK: 4.) type: EB filename (to edit existing file; do a backup) NEW filename (to create a new file) note: The characters typed from ED.TEC and NEW.TEC cause TSX to run TECO in single character activation mode. This assumes that the TSX lead-in character is the standard default (decimal 29). If you have changed the lead-in character you must change ED.TEC and NEW.TEC to reflect this change. 5 c.) RSX-11M 1.) Since the distribution floppy is in RT-11 format, you must use FILEX to transfer the files to your default UIC as follows: >FLX SY:=DXn:*.*/RT [or DYn] 2.) If you have a VT-100 or VT-100 compatible terminal, rename SY:VTINI.TEC to SY:TECO.INI. If you have an H19 or Z19 terminal, rename SY:H19INI.TEC to SY:TECO.INI. 3.) type: >TEC filename a.) If filename does not exist, a new file is created. b.) If filename exists, an edit backup is done. c.) If filename is not specified (i.e. blank), then an edit backup is done to the same file used during the previous editing session. If you are using DCL, and it doesn't pass unrecognized commands to MCR, then you must invoke teco with: >MCR TEC filename or >EDIT/TEC filename F.) SPECIAL NOTATION 1.) Angle brackets <> are used to denote a single keystrike, for example: a.) means to strike the escape key b.) means to strike A with the control key depressed c.) means to strike the key labeled "TOP" (keypad 1) 2.) A lower case n is used to signify an arbitrary decimal integer to be typed on the keyboard. 6 G.) KEY USAGE ON THE VT-100 The auxiliary keypad of the VT-100 should be identified as in the following chart when this editor is in use. The best approach is to attach labels to a keypad overlay or to the key tops directly. |--------|--------|--------|--------| | | | | | | SAVE | CMND | UNSAVE | END | | | | | LINE | | | | | | |--------|--------|--------|--------| | | | | | | OPEN | PAGE | PAGE | 24 | | | | SEARCH | UP | | | | | | |--------|--------|--------|--------| | | | | | | UP | DEL | DEL | 24 | | LINE | CHAR | LAST | DOWN | | | | | | |--------|--------|--------|--------| | | | | | | TOP | BOTTOM | START | | | | | OF LINE| | | | | | | |--------|--------|--------| SEARCH | | | | | | DOWN | SEARCH | | | LINE | AGAIN | | | | | | |-----------------|--------|--------| The four arrow keys are used by the editor and are referred to as , , , . The only other key which has a special editing function is the delete key (DEL on most keyboards) which will have a similar function to the way this key is used in most DEC software. This key is referred to as . 7 H.) KEY USAGE ON THE H19 The auxiliary keypad of the H19 should be identified as in the following chart when this editor is in use. The best approach is to attach labels to a keypad overlay or to the key tops directly. |--------|--------|--------| | | | | | OPEN | PAGE | PAGE | | | | SEARCH | | | | | |--------|--------|--------| | | | | | UP | DEL | DEL | | LINE | CHAR | LAST | | | | | |--------|--------|--------| | | | | | TOP | BOTTOM | START | | | | OF LINE| | | | | |--------|--------|--------| | | | | | DOWN | SEARCH | SEARCH | | LINE | AGAIN | | | | | | |--------|--------|--------| Also, the following strip should be put above the top row of keys to identify their use (this identifies keys f1 thru white box): 24-UP UP DOWN LEFT RIGHT 24-DOWN SAVE COMND UNSAVE Also the back space key must be labeled as . The only other key which has a special editing function is the delete key (DEL on most keyboards) which will have a similar function to the way this key is used in most DEC software. This key is referred to as . 8 I.) THE INSERT MODE The editor is always in the insert mode, meaning that to insert a character into the text buffer, simply type the character. This is not true for most special characters. Thus typing or does not insert an or into the buffer. If this was desired, the enter quote function (described later) should be used. While entering text into the buffer, the text on the same line and to the right of the cursor, will briefly disappear from view, to make room for the new text being entered. This may take a little getting used to, however, notice that immediate feedback is always given after each keystrike, so that you will recognize typos as soon as you enter them. The 300 loop delay which occurs before a screen update could be adjusted up or down to be more comfortable for very slow or very fast typists. J.) USE OF THE SPECIAL FUNCTION KEYS Moves cursor to the first character of the line above the current line. (current line means line where the cursor is) Moves cursor one line up. Does not change column position unless necessary. (this is the up arrow key on the VT-100) Moves cursor to the first character of the line below the current line. Moves cursor one line down. Does not change column position unless necessary. (this is the down arrow key on the VT-100) Moves the cursor to the next character in the buffer. Moves the cursor to the previous character in the buffer. <24-UP> Same as hitting the key 24 times. Moves the cursor backwards by one screens worth of text. <24-DOWN> Same as hitting the key 24 times. Advances the cursor by one screens worth of text. Moves the cursor to the end of the current line. Moves the cursor to the beginning of the current line. Deletes the character on the cursor. Deletes the character to the left of the cursor. Use the delete key after typing an incorrect character into the text. Moves the cursor to the first character of the current page. Moves the cursor to the last character of the current page. 9 You will be prompted for a character string to be searched. Searches for the string specified during the last . Same as except page boundaries will be crossed if necessary to find the search string. Open up the space needed for a new line to be entered. Positions cursor at the beginning of the new line. You will be prompted for a TECO command. First time: Clear save buffer, then insert all characters from cursor to end of line int save buffer. Next time: Append the current line to the end of save buffer. Insert save buffer into the text buffer in front of the cursor. If the last save or search operation was a search, then delete the number of characters used in that search string. If the last save or search operation was a save, then delete the number of characters found in the save buffer. Some examples to clarify above: 1.) To copy 3 lines starting at cursor to the top of the current page: 2.) To move 3 lines starting at the cursor to the top of the current page: 3.) To search for "XYZ&1" which is not on the current page: XYZ&1 4.) To delete the first occurrence of "XQQ": XQQ or :FSXQQ K.) OTHER IMPORTANT COMMANDS Removes 1 line of text starting at the cursor Removes 1 word of text starting at the cursor Moves the cursor forward 1 word Moves the cursor backward 1 word X Updates output file and ends the editing session The commands listed so far are adequate for most editing tasks, and I recommend that you read the rest of this manual after trying out the editor using the commands described above. 10 L.) THE COMMAND REPEAT FEATURE Generally, to repeat any of the editing commands, it is most convenient to hit the appropriate key the desired number of times. However sometimes it is move convenient to use the repeat feature built into most of the commands. To use this feature, type followed by the repeat count (in decimal), followed by the command which you want to repeat. Of the commands above, the repeat feature can be used with the following commands: , , , , , , <24-UP>, <24-DOWN>, , , , , , , , , , Examples: 7 copy 7 lines to the bottom of the page 4 XYZ search for the 4th occurrence of "XYZ" 5 advance thru 5 pages of text 35 remove 35 lines of text M.) ADDITIONAL CURSOR POSITIONING COMMANDS Moves cursor forward 15 characters. same as 15 Moves cursor backward 15 characters. N.) ADDITIONAL FILE MANIPULATION COMMANDS Append a page of text from the input file to the edit buffer. The form feed will remain in the buffer to separate the pages. Use n to append n pages. Backs up the text file and moves the cursor to the beginning of the file. i.e. closes output file and does an edit backup. 2 yanks a page into the text buffer. i.e. clear buffer, then do a command. n yanks n-1 pages into the text buffer. Note that because of the n-1 usage, by itself does nothing. This was done to combat the highly destructive power of the yank command. 11 O.) ADDITIONAL DELETION COMMANDS Deletes all characters from the cursor to the end of the line, but does not delete the at the end of the line. Use n to delete n lines beginning at the cursor, but not including the last . Delete the characters from the beginning of the current line to the cursor position. This command is most useful when you decide to retype the whole line on which you are editing. P.) ADDITIONAL INSERTION COMMANDS Insert a form feed (page separator) into the text. Insert the text deleted by the last , , , or command. This command is often used to put back text which was accidentally deleted. The following sequence could be used to move the 5 words starting at the cursor to the top of the page: 5 Inserts the last search argument into the buffer n E Inserts the character with ascii code n into the buffer. E Inserts the character specified by into the buffer. For example, if you want to enter a into the buffer, you can't type since that is a text deletion command, therefore you must type E . Since 25 is the ascii code for , another way to accomplish this is 25 E (see previous command). Q.) MARGIN CONTROL COMMANDS n M Set right margin to n. (Default is 78) F Insert or delete carriage returns as needed to make the current line as full as possible within the right margin limit. (i.e. Fill). n F will fill until n lines of text are generated. I Insert spaces between words of the current line until the line reaches the right margin. (i.e. Justify) n I will justify n lines of text. K Eliminate the extra spaces in the current line. This can be used to reverse the justify operation. n K will unjustify n lines of text. 12 R.) MISCELLANEOUS COMMANDS Do not use this key. If struck enough times in succession, Teco will exit without saving the edited text. Toggles the "see-all" mode. When the see-all mode is on, all characters are viewable including tabs, carriage returns, and all other special characters. The display symbols used for each special character varies somewhat with different VT-100 emulators, but you will quickly learn to recognize the special characters normally used. This mode is useful if you want to be able to distinguish tabs from spaces and such anomalies as spaces at the end of a line. This mode is initialized to off. Exits this macro. The normal Teco prompt (*) will appear. Executes the last teco command which was entered via the key. n will execute the teco command n times. Displays a brief command summary. (very useful for beginners) S.) NOTES ON THE USE OF THE COMMAND KEY All searches which are entered via normal teco commands (i.e. using the command key) should be colon modified searches. You may leave out the colon, but then if the search fails, teco will exit from the screen editor, at which point you would have to type EITECO.INI$$ to get back into the scope editor. For example, the command: 7<:FSA1$A2$>$$ will change 7 occurrences of A1 to A2 without bombing if the search fails. You may use any Q register except Q2 thru Q9 in teco commands entered via the command key. 13 T.) PATCHING TECO FOR USE WITH TSX+ There is a TSX incompatibility relating to the terminal configuration word, which requires a patch to TECO to allow the macros to work properly. If you have version 36 of TECO you should be able to patch it using SIPP as follows: .RUN SIPP *TECO.SAV Segment? 4 Base? 23326 Offset? 1232 Segment Base Offset Old New 000004 023326 001232 004167 12701 000004 023326 001234 002060 100000 000004 023326 001236 010124 ^Y If you have a different version of TECO, or the above sequence does not agree with the Old values shown, then the following information will be useful in accomplishing the patch. TECO uses the RT-11 terminal status word to decide if the terminal in use is a scope terminal and sets the bits in the ET flag accordingly. If the terminal is not a scope terminal, than TECO will ignore all occurances of the scope watch functions used by VT.TEC and H19.TEC. Section 3.1.6 of the RT-11 software support manual suggest the following code for obtaining the terminal status word (TTCNFG). MOV @#30,R0 MOV -(R0),STATUS TECO (Ver 36) gets the terminal status as follows: MOV @#30,R2 SUB #2,R2 ; get pointer to TTCNFG JSR R1,GTVAL ; put TTCNFG word into R1 MOV R1,STATUS ... GTVAL: SUB @#54,R2 ; make pointer relative to RMON .GVAL #AREA,R2 MOV R0,(SP) ; .GVAL result ends up in R1 RTS R1 Although this code works properly for RT-11, it does not work under TSX. The SIPP commands shown above, simply replaces the above "JSR R1,GTVAL" instruction with a "MOV #100000,R1. This patch forces TECO to always see a value of 100000 for TTCNFG so that TECO will always think it is using a scope terminal. The location of the above code can easily be found by using SIPP to search for all occurances of the number "30". As long as a scope terminal is being used, the patched version works corectly under RT-11 or TSX.