Documentation for VT-200 Set up (VT200SET) Written by Mark Northrup on 9/11/85 Miller Brewing Company 3939 West Highland Blvd. Milwaukee, WI 53201 Documentation for VT-200 Set up (VT200SET) Page 2 1. Introduction This module was designed to down load pre-set commands to the VT-200 terminal. The first position in the file (VT200SETU.PRM) must be either a semi-colon or the first digit of the function key number as defined in the "VT-200 Programmers Pocket Guide" page 39, and page 83 of the "VT-200 Programmer Reference Manual". If the first character is not a semi-colon the first three characters must have the form "nn/" where nn=the function key value, i.e. Function key 6 has a value of 17. After the "/" the command line that is to be displayed when that key is pressed, this program translates the string into the hex pairs required by the VT-200. A tilde (~) will be translated into a carriage return, all other symbols will be translated directly into their hex pair equivalent (including semi-colons that are not in position 1). To use the defined keys, press the shift key and the function key simultaneously and the value of that key will be displayed, if a carriage return (indicated by a "~" (tilde) in the file VT200SETU.PRM) was placed in the string it will execute. As usual no warranty, expressed or implied, is made by the submitter, DECUS, or Digital Equipment Corporationas to the accuracy of this document or the functioning of the described software and related material, and no responsiblity is assumed by these parties in connection therewith. The software, files and documentation is submitted "as is", for use at the users risk. And "if any of your IM Force should be caught or killed the Secretary will disavow any knowledge of your actions..."*. 2. BEGIN This section is the main loop of the program. It will load pointers clean buffers, get records, and convert them to hexadecimal strings for down loading to the VT-200. It will also test for buffer overflow, and file errors. Should there be a file error other than end-of-file, this routine treats them as fatal, copies the I/O error code to register 5, and exits with an IOT. REGISTER DEFINITION R0 ADDRESS OF FILE DESC. BLOCK R1 NUMBER OF BYTES TO BE CLEARED R2 ADDRESS OF BUFFER TO BE CLEARED R3 R4 _______________ * From an old "Mission Impossible" episode, it just seemed to go with the rest. Documentation for VT-200 Set up (VT200SET) Page 3 R5 Points to VARDAT that is used to initialize func. keys 3. CPYEXT Insert end of record marker in VARDAT buffer, that is required by the VT-200, send it to the users terminal, close the file and exit. 4. SIZERR When the key definitions contain more data than can be put into a VT-200, this routine issues the following message "Too much data for key definition buffer, passing what we can! Last record to be analyzed is as follows:" followed by the last record read from the file VT200SETU.PRM. After notifying the user we then try to recover by downloading as much as the VT-200 will permit. 5. CLNBUF We allow a record to be variable length, due to this we must zero out the record buffer before we get each new record. REGISTER DEFINITION R0 ADDRESS OF FILE DESC. BLOCK R1 NUMBER OF BYTES TO BE CLEARED R2 ADDRESS OF BUFFER TO BE CLEARED 6. CNVSTR Verifies that the string is in the legal range (column 1 must begin with a ";", "1", "2", or "3"), if it is not we branch to ERRREC, ignore the rest of the record and issue a message. If the string begins with a semi-colon we will not get into this routine because BEGIN tests for that character before we get to this routine (a semi-colon in column 1 is a comment). We then convert each byte into its hexadecimal equivalent, unless it is a tilde (~). A tilde will be translated into a carriage return (hex 0D). REGISTER DEFINITION R0 Address of input buffer from file Documentation for VT-200 Set up (VT200SET) Page 4 R1 High order nibble of byte from the file buffer R2 Low order nibble of byte from the file buffer R3 R4 R5 Address of output buffer, to define function keys 7. ERRREC This routine is entered when an invalid key assignment has been made its function is to display this error message; "Invalid function key number ignoring this definition, continuing..." and the current record. It then recovers, and returns doing no further processing. 8. HEXCON A table to be used by calculated offset to obtain hexadecimal values for the most or least significant portion of the ASCII byte under consideration. 9. VARDAT This is the main buffer area for the data going to the VT-200. Any way I calculated the buffer size it came out to (512. + (3 bytes for function key code number and a /) * 15 definable keys)) 557. bytes, but when I tested this program I found that 573. bytes worked so we used it! 10. SPILBF Because the maximum number of bytes converted to hexadecimal allowed per record is 512 plus three leading control characters, we must provide a spill area so we won't get a memory protect violation. 11. VT200SETU.PRM The rules for this file are that column 1 must begin with a ";", "1", "2", or "3". Function key values are found on page 39 of the "VT-200 Programmer Pocket Guide", and page 83 of the "VT-200 Programmer Reference Manual". Each Documentation for VT-200 Set up (VT200SET) Page 5 Record can be a maximum of 256. characters. A "~" (tilde) will be translated into a carriage return. The example below is a sample of a record with a comment to be translated by VT200SET. ; Sets Function key F11 to do a PIP for generic work 23/PIP~ INDEX BEGIN . . . . . . . . . . . . . . . . . 2, 3 CLNBUF . . . . . . . . . . . . . . . . 3 CPYEXT . . . . . . . . . . . . . . . . 3 ERRREC . . . . . . . . . . . . . . . . 3, 4 Function key . . . . . . . . . . . . . 2, 4 HEXCON . . . . . . . . . . . . . . . . 4 I/O error code . . . . . . . . . . . . 2 Invalid function key number ignoring this definition, continuing... 4 IOT . . . . . . . . . . . . . . . . . . 2 Last record to be analyzed is as follows: 3 semi-colon . . . . . . . . . . . . . . 2, 3 SIZERR . . . . . . . . . . . . . . . . 3 SPILBF . . . . . . . . . . . . . . . . 4 tilde . . . . . . . . . . . . . . . . . 2, 3, 5 Too much data for key definition buffer, passing what we can! 3 VARDAT . . . . . . . . . . . . . . . . 3, 4 VT-200 . . . . . . . . . . . . . . . . 2, 3, 4 VT-200 Programmer Pocket Guide . . . . 4 VT-200 Programmer Reference Manual . . 2, 5 VT-200 Programmers Pocket Guide . . . . 2 VT200SET . . . . . . . . . . . . . . . 5 VT200SETU.PRM . . . . . . . . . . . . . 2, 3, 4 CONTENTS 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 2. BEGIN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 3. CPYEXT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 4. SIZERR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 5. CLNBUF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 6. CNVSTR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 7. ERRREC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 8. HEXCON . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 9. VARDAT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 10. SPILBF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 11. VT200SETU.PRM . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 INDEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . I-1