home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / ASMUTL / PC370.ZIP / SEE.DOC < prev    next >
Encoding:
Text File  |  1987-05-03  |  17.1 KB  |  306 lines

  1.  TITLE 'SEE - Screen Editor and Emulator Documentation'
  2.  
  3. Copyright (c) 1987 Donald S. Higgins
  4.  
  5. You are encouraged to copy and share the SEE screen editor and emulator
  6. source program, object program, and documentation on the condition that
  7. the copyright messages are not removed or modified, and that no fee or
  8. consideration is charged.  If you find the SEE package useful and would
  9. like to receive future user group notices, please send $35. to:
  10.  
  11.    Don Higgins
  12.    6365 - 32 Avenue North
  13.    St. Petersburg, Florida 33710
  14.  
  15. If you have suggestions for improvement of this program or make useful
  16. modifications of your own, please send them so I can include them with
  17. the next release (including proper credits) to share with other users.
  18.  
  19. SEE.ALC is a full screen ASCII text editor for PC's with MS-DOS 2.0+ and
  20. at least 256k.  SEE is designed to be keystroke compatible with both
  21. PFS:WRITE and the TURBO PASCAL (ie WORDSTAR like) editors.  SEE supports
  22. text files up to 512k on a 640k system.  Note SEE.ALC itself is about
  23. 90k which some editors can't handle.  To conserve space SEE strips trailing
  24. blanks from each line of text, and replaces 9 leading blanks with a single
  25. tab character. Each line is terminated with a carriage return and line feed.
  26.  
  27. SEE also supports session emulation by optionally creating a file (.KSF)
  28. with all of the session's keystrokes which can be replayed to emulate the
  29. session with full color control.  SEE also supports line and block drawing
  30. with graphic characters in full color.
  31.  
  32. The distribution diskettes or ARC file contains SEE.COM which can be used
  33. to edit the source code SEE.COM.  TO edit an existing ASCII text file:
  34.  
  35.   A>SEE file1
  36.  
  37. E370R20.EXE is dynamically loaded by SEE.COM to execute the 370 code so it
  38. must be accessible on the current path as SEE.COM.  If you wish to run SEE
  39. using the emulator on a separate directory, you can use DEBUG to insert
  40. path in front of emulator name at X"140' in SEE.COM.
  41.  
  42. The default file type is ALC.  (Note with PC/370 you can change the default
  43. in SEE.ALC and reassemble and link it in about 90 seconds on a standard PC.)
  44. If the file doesn't exist, it will create an empty file ready for editing.
  45. If the file does exist, it will be renamed file1.BAK before saving the new
  46. file if it is changed.  Be sure there is room on the same disk for both the
  47. new file and the backup file before spending a lot of time editing a file.
  48. Note SEE.ALC itself requires at least 110k free space before you can save it.
  49.  
  50. To capture all the keystrokes in a session for replay later, type:
  51.  
  52.   A>SEE file1 file2
  53.  
  54. The default file type for file2 is KSF.  If file2 does not exist, it will be
  55. created with all the keystrokes entered during the session which edits file1.
  56. If file2 already exists, SEE will use it as the keyboard input to emulate
  57. the original session.  Note two special keys act different in live editing
  58. versus emulation.  ALT-F1 key causes emulation to stop until a real key is
  59. entered.  ALT-F2 key causes a 1 second wait in emulation mode to slow it
  60. down for visual effects.  Additional controls could be easily added to SEE.
  61.  
  62. SEE is designed to be fast and easy to use.  To change a drive specification
  63. in an autoexec.bat file a sequence of less than 25 characters including the
  64. filename may be required.  For example, assuming autoexec.bat contains:
  65.  
  66. RECORD/COLUMN  1...5...10...15...20
  67.   1            ver
  68.   2            astclock
  69.   3            c:
  70.   4            123
  71.  
  72. The following keystrokes would change drive c to drive a:
  73.  
  74. keystrokes  ascii characters            comments
  75.  
  76.   1-19      see10 autoexec.bat[enter]   start up SEE and display text
  77.  20-21      [arrow down][arrow down]    move down to third line
  78.   22        a                           replace c with a
  79.   23        [esc]                       rename old file and save new file
  80.  
  81. To learn the keystrokes available with SEE, use F1 and F2 to display help
  82. screens.  After reading help screens type any character to return to text
  83. display.
  84.  
  85. To see the capability of SEE and to verify that the version you have is
  86. working correctly on your system, run the batch file RUNDEMO.BAT.  This
  87. file executes the following emulation sessions:
  88.  
  89.   1.  DEMOSEE1.KSF - test both native and alternate keys as defined on F2.
  90.   2.  DEMOSEE2.KSF - test full color character graphics by drawing colored
  91.                      organizational chart boxes and a full color U.S. flag
  92.                      with blinking stars. Press enter to end session.
  93.  
  94. To provide a positive verification of the results of the above emulation
  95. runs, the edit file created during the original session is compared to the
  96. new edit file created during the emulation run.  The RUNDEMO file attempts
  97. to use the MS-DOS compare utility COMP without any drive specified.  If the
  98. COMP program is not available the compare steps will not execute.
  99.  
  100. One of the very unique features of SEE is that the entire 370 assembler
  101. source code is being distributed along with the object code.  Because of
  102. this, the SEE editor can be customized as required.  The SEE.ALC source
  103. program is about 3000 lines and requires no external subroutines.  On a
  104. RAM disk, it assembles in about 60 seconds via the command A370 SEE.
  105. The link edit takes another 10 seconds via the command L370 SEE.  A listing
  106. of the source can be generated via the command A370 SEE/L if you have a
  107. hard disk.  The listing is too big to fit on a 360k floppy disk.
  108. The cross reference option cannot be used since it causes the assembler
  109. symbol table to exceed memory.  There is room for about 30 more labels
  110. before SEE.ALC exceeds the capacity  of the current A370 design.  One way
  111. to resolve the assembler limitation, is to break up SEE into modules,
  112. assemble the modules separately, and then link them together.
  113. However, the current single module form of SEE made the development and
  114. debugging process easier over the last 3 months.
  115.  
  116. SEE has several special keys which may need additional explanation.  The
  117. ALT-F3 key enters PC/370 debug mode where you can display the 370 registers
  118. via the R command, dump memory via the D command, trace instructions, etc.
  119. To return to the SEE editor, type Q.  Since the default is to kill all trace
  120. ids and disable the PC/370 interactive debug interrupt, you must either link
  121. SEE with the debug option D, or press a key during loading of the SEE program
  122. to get into PC/370 debug at the beginning of SEE where you can select ids to
  123. save and trace.
  124.  
  125. The ALT-F4 key toggles an internal audit mode which was very useful during
  126. debugging and may be useful to others making changes to SEE.  In audit mode
  127. the critical pointers and control blocks are verified for consistency after
  128. each operation that modifies them.  For large text files, these audits may
  129. take several seconds so be patient.  Via the audit mode, data corruption can
  130. be detected immediately after it occurs rather than later such as when a
  131. save is attempted.  The following block diagram shows the critical blocks
  132. and their relationships:
  133.  
  134.  ******************************************************************
  135.  * MS-DOS   64k segment                                           *
  136.  ******************************************************************
  137.  * SEE.COM  512k segment (code and data in 370 address space)     *
  138.  *                                                                *
  139.  *       SCB screen control block                                 *
  140.  *      ************************* <<<<< ASCB pointer to screen    *
  141.  *   X>>*SCBADDR DS A addr LB   *       control block with 25     *
  142.  *   ^  *SCBPREV DS A prev LB   *       lines of text             *
  143.  *   ^  *SCBNEXT DS A next LB   *                                 *
  144.  *   ^  *SCBLINE DS CL80 text   *                                 *
  145.  *   ^  ************************* <<<<< R5 relative index to      *
  146.  *   ^  *SCBADDR DS A addr LB   *       current row in ASCB       *
  147.  *   ^  *SCBPREV DS A prev LB   *       times X'100'              *
  148.  *   ^  *SCBNEXT DS A next LB   *       (X'0000' to X'1700')      *
  149.  *   ^  *SCBLINE DS CL80 text   *                                 *
  150.  *   ^  *************************       R6 relative column (0-79) *
  151.  *   ^                                  R7 address of SCB for row *
  152.  *   ^                                                            *
  153.  *   ^                         GLBLAST  DS A last    LB >>>>>>>X  *
  154.  *   X<<<<<<<<<<<<<<<<<<<<<<<< GLBCUR   DS A current LB >>>>>X v  *
  155.  *    (matches SCBADDR for     GLBFIRST DS A first   LB >>>> v v  *
  156.  *     row 0 at all times)                                 v v v  *
  157.  *                                                         v v v  *
  158.  *                                                         v v v  *
  159.  *  (Dynamic memory allocated via SVC 10)                  v v v  *
  160.  *                                                         v v v  *
  161.  *    LB line control block                                v v v  *
  162.  *    ***************************                          v v v  *
  163.  * 0  * LBPREV DS A prev LB     *<<<<<<<<<<<<<<<<<<<<<<<<<<X v v  *
  164.  * X<<* LBNEXT DS A next LB     *                            v v  *
  165.  * v  * LBLINE DS CL80 text     *                            v v  *
  166.  * v  ***************************                            v v  *
  167.  * v      ^                                                  v v  *
  168.  * v      ^                                                  v v  *
  169.  * X>>***************************                            v v  *
  170.  *    * LBPREV DS A prev LB     *<<<<<<<<<<<<<<<<<<<<<<<<<<<<X v  *
  171.  * X<X* LBNEXT DS A next LB     *                              v  *
  172.  * v  * LBLINE DS CL80 text     *                              v  *
  173.  * v  ***************************                              v  *
  174.  * v      ^                                                    v  *
  175.  * v      ^                                                    v  *
  176.  * X>>***************************                              v  *
  177.  *    * LBPREV DS A prev LB     *<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<X  *
  178.  * 0  * LBNEXT DS A next LB     *                                 *
  179.  *    * LBLINE DS CL80 text     *                                 *
  180.  *    ***************************                                 *
  181.  *                                                                *
  182.  *    (note lower right number on status line is ratio of         *
  183.  *     active LB's to maximum LB's which will fit in extended     *
  184.  *     memory. AFREELB pointer maintains queue of unused LB's.)   *
  185.  *                                                                *
  186.  ******************************************************************
  187.  * E370R20.EXE PC/370 emulator loaded in high 64k segment         *
  188.  ******************************************************************
  189.  
  190. The key things that are verified by the audit mode routines are as follows:
  191.  
  192.   1.  The row (R5) and column (R6) relative pointers are within valid range.
  193.   2.  The SCB address (R7) corresponds to current relative row (R5).
  194.   3.  The SCBADDR in row zero matches GLBCUR.
  195.   4.  The SCBPREV in each SCB matches SCBNEXT in previous SCB etc.
  196.   5.  Starting with LB at GLBFIRST, verify forward and backward chains
  197.       for all LB's in extended memory.  The total LB count is also
  198.       verified.
  199.  
  200. Do not leave audit mode on for normal editing since it significantly slows
  201. down the editor.
  202.  
  203. The label (F5), duplicate (F6), and delete key (del) all work together.  When
  204. ever a block is active, the BLK indicator is on.  Be sure to turn the block
  205. indicator off via F5, F6, or delete key.  If the block indicator is not
  206. off and  the (del) key is hit to delete a character, it will delete the block
  207. instead.  Note since the box graphics mode indicator shares the same space on
  208. the status line, turning on graphics will turn off the block indicator.
  209.  
  210. The search (F7) key will search for up to a 15 character key.  Use F8 to repeat
  211. search.  If a replacement key is specified, it will only be replaced if it
  212. fits on current line.  Search can be interrupted by any key.  The current line
  213. number is updated every 100 lines during search.
  214.  
  215. The color selection key (F9) is tricky but powerful.  The attribute byte shown
  216. on the message line consists of four fields; the blink bit, the background
  217. color bits (RGB), the intensity bit, and the foreground color bits (RGB).
  218. The default attribute is set to B'00010111' or X'17' which can be interpreted as
  219. no blink, no red background, no green background, blue background, no intensity,
  220. and red, green, and blue foreground (ie white foreground).  This is the
  221. PFS:WRITE default.  The TURBO PASCAL editor default is yellow on black
  222. B'00001110' or X'0E'.  The attribute can be entered as a two digit hex number
  223. or the arrows can be used to step through all the possible color and blink
  224. combinations (all 256 of them).  Once the desired attribute is selected, press
  225. enter to return to the screen with the new attribute.  Note that unfortunately
  226. the attributes of each character are not stored in the file and when the screen
  227. is erased and updated again, individual character attributes used on the screen
  228. are lost.  However, the emulator option allows recreation of any screen with all
  229. the colors used during the original session.  This capability can be used to
  230. generate full color screen dialogs.
  231.  
  232. In addition to color, the box graphics or line graphics capability allows
  233. creation of screens with organization charts and line diagrams such as the
  234. one above.  I did not use color and I selected printable characters via
  235. SHFT-F10 in order for this file to be printable on any ASCII printer.  The
  236. default box graphic characters when F10 is turned on is double line graphic
  237. characters which look neat on the screen but can't be printed on many printers.
  238. When F10 is pressed, the BOX indicator comes on and the insert mode is turned
  239. off.  In BOX mode, the arrows allow drawing of boxes and lines with correct
  240. corners based on the current and next direction of arrows.  With a little
  241. practice, it is easy to draw things and to add color to highlight different
  242. parts.  However, the color is lost unless the keystroke file is being created
  243. during the session.  Note in BOX mode, keystrokes are not queued up as they
  244. are in normal text mode.  This is to prevent overshooting the end of a line
  245. when holding down one of the arrow keys.
  246.  
  247. The status line contains the following fields:
  248.  
  249.   1.  STATMSG  - 20 character message field used to display the current
  250.                  function and to echo requested input.
  251.   2.  STATFILE - name of the file being edited with path (15 char. shown).
  252.   3.  STATREC  - current line number.
  253.   4.  STATCOL  - current cursor column
  254.   5.  STATCAP  - caps key indicator
  255.   6.  STATINS  - insert mode indicator (SEE always starts with INS off)
  256.   7.  STATNUM  - numeric mode indicator
  257.   8.  STATBLK  - labeled block mode indicator / box graphics mode indicator
  258.   9.  STATPCT  - percent utilization of available memory
  259.  
  260. As a starting point for anyone who wishes to add a new key function, the
  261. following minimum steps are required:
  262.  
  263.   1.  Overlay byte in KEYTAB which corresponds to the value of the new key
  264.       with an index to the corresponding address in KRTAB.
  265.       (All ASCII keys are in the range 0-127, and all extended keys are
  266.       mapped into 128-255 by forcing the high order bit on.)
  267.       Since the index values are multiples of 4, up to 63 keys can be
  268.       handled with this scheme.
  269.  
  270.   2.  Insert address constant in KRTAB which points to the actual key
  271.       routine.
  272.  
  273.   3.  Code the key routine with the following assumptions:
  274.  
  275.       a.  R14 has return address (You can use KRSV14 to save it.)
  276.       b.  R5  has relative row times X'100'.
  277.       c.  R6  has relative column.
  278.       d.  R7  has address of SCB corresponding to current row.
  279.       e.  GLBCUR    has extended memory address of LB for row 0 on screen.
  280.       f.  GLBLAST   has extended memory address of last LB.
  281.       g.  Useful routines include:
  282.           1.)  SETCUR - reset cursor based on (R5,R6) and update status
  283.                line if position has changed since last call.
  284.           2.)  PUTMSG - display 20 character message passed via R1.
  285.       h.  If the function you add, modifies any data in the SCB's, be
  286.           sure to turn on the SCBMOD and SCRMOD flags to insure that
  287.           the update and save routines recognize a file change occurred.
  288.       i.  Assume nothing works and keep a backup copy of the editor and
  289.           any test files you are using.
  290.  
  291.   4.  Add key definition to F2 screen without exceeding 24 lines.
  292.  
  293.   5.  Test all changes very carefully since this program should be
  294.       considered complex.  The interaction between key routines and
  295.       the maintenance of the screen and memory control blocks during
  296.       scrolling, block operations, etc. is tricky to say the least.
  297.       Use the audit mode to verify that the new routine does not
  298.       destroy currency of the screen and extended memory data bases.
  299.  
  300. For release 2.0 of PC/370, the SEE editor was modified to use dynamic
  301. memory in the 370 address space instead of MS-DOS allocated extended
  302. memory accessed via the cross memory MVCS and MVCP moves.  The only other
  303. change was to start up editor in insert mode for new files.
  304.  
  305.  
  306.