home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / forth / compiler / fpc / doc / chapter4.txt < prev    next >
Text File  |  1989-10-29  |  31KB  |  687 lines

  1. CHAPTER 4.   PROGRAMMING TOOLS
  2.  
  3.  
  4.  
  5.  
  6. In this chapter we will discussed the most useful utility words which are
  7. either unique in F-PC or have different behavior than those in F83.  We
  8. assume that the user is familiar with F83 so that those words adopted
  9. unmodified from F83 are not presented.  Reference material such as Inside
  10. F83  and F83 Reference Manual  by C. H. Ting are useful in obtaining an
  11. overview on F83.  Dr. Ting's companion F-PC Technical Reference Manual is
  12. is devoted to the internal structure of F- PC.
  13.  
  14.  
  15. 4.1.    DUMP
  16.  
  17.  
  18. The dump utility gives you a formatted hex dump with the ASCII text
  19. corresponding to the bytes on the right hand side of the screen.  Data
  20. and addresses are displayed in hex, with 16 bytes to a line.  Both the
  21. segment and offset addresses are displayed for easy reference.
  22.  
  23. DUMP displays memory in the Code Segment, where code, strings, and other
  24. data are stored. XDUMP displays memory in the List Segment, where colon
  25. definitions are stored.  YDUMP displays memory in the Head Segment.
  26. These dump utilities are derived from the generic dump function LDUMP,
  27. which displays a range of memory from a memory segment whose segment
  28. address is given on the stack with an offset address and byte count.
  29. DUMP, XDUMP, and YDUMP set DUMPSEG to the corresponding segment and then
  30. do LDUMP.
  31.  
  32. DUMP, XDUMP and YDUMP change DUMPSEG to cs:, es:, and ys:, respectively.
  33. Their behavior takes a little bit of getting use to, but they allow you
  34. to navigate through the entire segmented memory space.  XDUMP is unique
  35. in that it takes a segment pointer and a count as parameters.  It is made
  36. so that you will able to dump colon definitions beyond the 64K boundary.
  37.  
  38.         DUMP    ( address  length -- )          Dump Code segment
  39.         LDUMP   ( segment offset length -- )    Dump any segment
  40.         XDUMP   ( relative-segment length -- )  Dump List segment
  41.         YDUMP   ( offset length -- )            Dump Head segment
  42.  
  43. DU displays 64 bytes in the dump segment and increments the memory
  44. address by 64 so that you can continue dumping the next 64 bytes with
  45. another DU.
  46.  
  47.  
  48. 4.2.    THE DEBUGGER
  49.  
  50.  
  51. The F-PC debugger is very similar to the F83 debugger.  Some features
  52. have been added to enhance its operation.  The decompiled source for the
  53. current definition being debugged is displayed while debugging.  A
  54. typical command sequence might be as follows:
  55.  
  56.         DEBUG   WORDS <return>
  57.  
  58. which sets up the debugger so that WORDS will be debugged as soon as it
  59. is executed.  DEBUG only sets the debugger up to debug a word.  The
  60. debugging process does not start until the word is executed.  A new
  61. debugging command DBG is added, which caused the following word to be
  62. executed and debugged immediately.  The command sequence is:
  63.  
  64.         DBG <word_name> <return>
  65.  
  66. It is much easier to use and makes much of the intricate behavior of the
  67. F83 DEBUG transparent to the user.
  68.  
  69. Once in the debugger, you will be shown a special debugger display.  The
  70. decompiled source code is shown in the top half of the screen.  The
  71. debugging information is shown in the bottom window.  At this point,
  72. pressing return will cause the word highlighted to be executed, and the
  73. debugger will print the stack after execution, and step to the next word
  74. in the list and wait for a command.
  75.  
  76. Notice the fields in the bottom debugging window.  The number on the left
  77. is the address in memory where the debugger is currently working.  The
  78. next field is the word the debugger is about to execute.  The next symbol
  79. "?>" is a marker pointing to what will be the printed stack contents
  80. after we press <return>.  The bar of text shown in the middle of screen
  81. is the command menu:
  82.  
  83. C-cont, D-done, F-forth, N-nest, Q-quit, S-skipto,  U-unnest, X-source-on/off
  84.  
  85. These are the commands you can use in the debugger.  Their detailed
  86. functions are as follows:
  87.  
  88.         C-cont          Trace continuously until a key is pressed.
  89.         D-done          Stop debugging and enter the browser.  Press F10
  90.                         to return.
  91.         F-forth         Allow entry of Forth command lines until <return>
  92.                         is pressed on an empty line.
  93.         N-nest          Nest into the ":" definition we were about to
  94.                         execute. Only works on ":"   definitions, and
  95.                         deferred words.
  96.         Q-quit          Quit the debugger, and unpatch next.
  97.         S-skipto        Using + or - to skip to the desired word.  Press
  98.                         <return> to continue debugging from there.
  99.         U-Unnest        Unnest the current definition to the next higher
  100.                         level.
  101.         X-source-on/off Toggle on and off the source code display and
  102.                         devote the whole screen for debugging.
  103.  
  104. You will have noticed that the upper portion of the screen is filled with
  105. the source code of the word you are currently debugging.  This is to make
  106. it easier to follow the debug process.  You may want to turn off the
  107. source display, if it interferes the debugging process, by using the X
  108. command while debugging or used SRCOFF before debugging:
  109.  
  110.         SRCOFF  Turn off the source display
  111.         SRCON   Turn on the source display
  112.  
  113. The default state is SRCON. 
  114.  
  115. During debugging, only the topmost 4 numbers on the data stack are
  116. displayed, with the total depth of stack shown in square brackets.  This
  117. is designed so that all debugging text fits in one line.  As .S is used
  118. to display the stack contents, its behavior is modified from the .S in
  119. F83, which displays all items on the data stack.  Sometimes it is
  120. inconvenient to have the bottom of the stack hidden from you, you can
  121. change the contents of variable MAX.S to the desired number of stack
  122. items to be shown.  MAX.S has a default value of 4.
  123.  
  124.  
  125. 4.3.    VALUES: CONSTANTS AS VARIABLES
  126.  
  127.  
  128. "Constants aren't; variables won't". 
  129.  
  130. A set of operators has been included for manipulating data values stored
  131. in the parameter fields in constants and variables.  Constants are faster
  132. at run time than variables.  You can improve performance in critical
  133. operations taking advantage of them.  Since variables are more often
  134. fetched than stored, using a constant to store a variable provides a
  135. somewhat more readable source by eliminating lots of @'s.  In order to
  136. preserve the appearance of constants with their values not modifiable,
  137. F-PC defines a new type of data called VALUE.  VALUE is an alias of
  138. CONSTANT, with the stated intention that their values are to be changed
  139. at run-time.
  140.  
  141. Here is a list of words which manipulate the contents of a value from the
  142. keyboard or in colon words:
  143.  
  144.         =: <name>       ( n -- )   Store integer to value. It looks nice.
  145.         !> <name>       ( n -- )   Store integer into value. Identical to =:
  146.         @> <name>       ( -- n )   Return contents of a value.
  147.         +!> <name>      Increment value-name by integer
  148.         INCR> <name>    Increment value-name by one
  149.         DECR> <name>    Decrement value-name by one
  150.         ON> <name>      Store -1 into value-name
  151.         OFF> <name>     Store 0 into value-name
  152.  
  153. These operators are written in assembly, so they are very fast.  The name
  154. following these value operators should be defined with VALUE.  However,
  155. these operators will work on constants, variables, and even deferred
  156. words, but you will have to take responsibility of the consequences.
  157.  
  158. Variable-constants or VALUE's are very useful in passing data among many
  159. program modules. One module sets the value in a constant or VALUE and
  160. many other modules can use it.  As VALUE's, constants and variables are
  161. global in Forth, you have to watch them very carefully in a large
  162. program.  Changing the value of a constant can be deadly if you are not
  163. aware of its consequences.  Use this tool with caution.
  164.  
  165. The constants -1, 0, 1, 2, and 3 defined in F83 are eliminated in F-PC
  166. because in F-PC literals are much faster than constants.  In-line
  167. literals are faster than constants and values in F-PC, because (LIT) is
  168. simply:
  169.  
  170.         CODE (LIT)   LODSW   ES:   1PUSH   END-CODE
  171.  
  172. However, excessive use of literal numbers will make code very difficult
  173. to understand.  It is much preferred to name the constants and values to
  174. help documenting your intentions.
  175.  
  176.  
  177. 4.4.    HELP WORDS
  178.  
  179.  
  180. F-PC provides the standard F83 decompiler command SEE.  SEE has been
  181. modified to display a decompiled source that is in most cases very
  182. similar to the original source on disk.  This capability does not come
  183. free.  The price we pay in F-PC is that every word must have a unique
  184. address in the Code segment, even when the words have identical code,
  185. such as IF, UNTIL, and WHILE, which all compile the same ?BRANCH.  The
  186. unique code addresses enable the decompiler to identify and recover the
  187. proper names to be displayed.  The debugger DEBUG and DBG also uses this
  188. decompiler to display the definition under examination.
  189.  
  190. REF is the inverse of SEE.  
  191.  
  192.         REF <wordname>
  193.  
  194. searches through all colon words defined in the dictionary and displays
  195. the names of words which contains <wordname>.  This tool is very useful
  196. in analyzing where a word is used and how often it is used in any
  197. application.
  198.  
  199. The help mechanism in F-PC 3.5 is much more polished and powerful than
  200. that in F83 and F-PC 2.25, because of the hypertext based browser.
  201. Whenever help is requested, the editor is invoked and the system is put
  202. into the browsing mode.  If a word name is given after a HELP word, a
  203. .HLP text file is opened and the text about the word is display in the
  204. editor window.  The user can then use the browser to move around looking
  205. at source code or help text.
  206.  
  207. The principal help command in F-PC 3.5 is BROWSE.  VIEW is made an alias
  208. of BROWSE to maintain F83 compatibility.  B and V are also aliases of
  209. BROWSE for convenience.
  210.  
  211.         BROWSE <wordname>
  212.  
  213. opens the .SEQ file in which <wordname> was defined and displays the
  214. source code of <wordname>.
  215.  
  216.         HELP <wordname>
  217.  
  218. opens the companion .HLP file to the .SEQ file in which a word is defined
  219. and displays the help message in the HLP file associated with <wordname>.
  220. It assumes that the help file exists; otherwise, an error message will be
  221. displayed.
  222.  
  223. Used without a word name, HELP enters the editor's browsing mode and
  224. displays the root help screen of the hypertext help system to assist you
  225. start ing the investigation of F-PC.  While you are browsing a file,
  226. position the cursor on any word and press <return> or F9.  The source
  227. code of this word will be displayed.  If you want to see the help text
  228. about a word, press Alt-H.
  229.  
  230. WORDS behaves identically to that in F83 when used normally to display
  231. the names of definitions in the context vocabulary.  It is enhanced in
  232. F-PC such that if the following string is not a valid name in the context
  233. vocabulary, it will use the string as a substring template and prints the
  234. names of all definitions in all vocabularies, whose name contains the
  235. substring. Two substrings can be attached to WORDS.  Many special strings
  236. can be used after WORDS to show different classes of Forth words. For
  237. example,  WORDS *.*  causes all words in all vocabularies to be
  238. displayed.
  239.  
  240. The behavior of these very useful help words is summarized as follows:
  241.  
  242.     BROWSE <wordname>   Drop into the browsing mode in editor and display the
  243.                         source of <wordname>.
  244.     B                   Shorthand for BROWSE.
  245.     ED <wordname>       Drop into the editing mode in editor, display the
  246.                         source of <wordname> and ready for editing.
  247.     E                   Shorthand for ED.
  248.     HELP                Drop into the editor and display system help message.
  249.     HELP <wordname>     Display help message associated with  <wordname>.
  250.     H                   Shorthand for HELP.
  251.     REF <wordname>      Display all words which compile ,wordname>.
  252.     SEE <wordname>      Decompile <wordname>.
  253.     VIEW <wordname>     Alias of BROWSE.
  254.     V                   Shorthand for VIEW.
  255.     WORDS               Display words in the context vocabulary.
  256.     WORDS xyz           Display all words containing the substring 'xyz'.
  257.     WORDS xy  ab        Display all words containing both 'xy' and 'ab'.
  258.     WORDS *.*           Display all words in F-PC.
  259.     WORDS :.*           Display all colon words.
  260.     WORDS code.*        Display all code words.
  261.     WORDS constant.*    Display all constants.
  262.     WORDS defer.*       Display all deferred words.
  263.     WORDS total.*       Display number of words.
  264.     WORDS udefer.*      Display all user deferred words.
  265.     WORDS uvariable.*   Display all user variables.
  266.     WORDS value.*       Display all value words.
  267.     WORDS variable.*    Display all variables.
  268.  
  269.  
  270. 4.5.    DATE AND TIME
  271.  
  272.  
  273. A complete set of time and date manipulation words has been included in
  274. F-PC.  They call appropriate DOS service functions to provide the
  275. requested services.  The words for getting and setting the date and time
  276. are as follows:
  277.  
  278.         GETDATE        ( -- d1 )        Return d1 a 32 bit binary date
  279.                                         from the operating system. Bytes
  280.                                         in d1 are arranged as
  281.                                         year/month/day/day-of-week.
  282.         SETDATE        ( d1 -- )        Given the binary date d1, set the
  283.                                         system clock to that date.
  284.         GETTIME        ( -- d1 )        Return d1 with bytes arranged in
  285.                                         the order hr/min/sec/100th- sec
  286.                                         from the operating system.
  287.         SETTIME        ( d1 -- )        Given the binary time d1, set the
  288.                                         system clock to that time.
  289.         .DATE          ( -- )           Print to the screen the current date, in the
  290.                                         format MM/DD/YY, where MM is
  291.                                         month, DD is day, and YY is year.
  292.                                         Y-M-D sets the format to
  293.                                         YY-MM-DD, and D.M.Y sets it to
  294.                                         DD.MM.YY.
  295.         .TIME           ( -- )          Print to the screen the current
  296.                                         time, in the format HH:MM:SS.HR,
  297.                                         where HH is in hours, MM in
  298.                                         minutes, SS in seconds, and HR
  299.                                         in hundredths of a second.
  300.  
  301. A special word set is defined in F-PC for measuring elapsed time for real
  302. time experiments and for characterization of program performance.
  303.  
  304.         TIMER <name>    TIMER performs the Forth words following on the
  305.                         same command line, and when they finish
  306.                         execution, TIMER prints the elapsed time required
  307.                         for their execution.
  308.         TIME-RESET      Reset the accumulated time value in the double
  309.                         variable STIME to zero, in effect resetting the
  310.                         current elapsed time to zero.
  311.         .ELAPSED        Print the time elapsed since the last TIME_RESET.
  312.  
  313. TIMER-RESET is used at the beginning of a sequence of operations you want
  314. to time.  The word .ELAPSED is used at the end of the operations to print
  315. the elapsed time since the last TIME- RESET.
  316.  
  317. The following words are used to change different fields in the timer: 
  318.  
  319.         TENTHS          ( tenths_of_a_second -- )
  320.         SECONDS       ( seconds -- )
  321.         MINUTES       ( minutes -- )
  322.         HOURS           ( hours -- )
  323.  
  324. Time delay words use the DOS time function to obtain very accurate time
  325. delays.  Background processing continues, as pause is called in the wait
  326. loop.  Another deferred word, PAUSE-FUNC, is also in the loop, which can
  327. be re-assigned to perform any function you want done while the delay is
  328. occurring.
  329.  
  330.  
  331. 4.6.    COMMENTS
  332.  
  333.  
  334. All comment words in F83, like (, .(, \, \S are preserved and they behave
  335. identically in F-PC. However, a file in F-PC is similar to a block in F83
  336. and \S stops the compilation of the rest of the file.  To accommodate
  337. documentation which spans over many lines, additional comment words are
  338. defined in F-PC.  Multiple line comment in F-PC starts with COMMENT: and
  339. terminates at COMMENT; .  It looks like:
  340.  
  341.                 COMMENT:    
  342.                 <text> 
  343.                 <more text>
  344.                 ... 
  345.                 <even more text>
  346.                 COMMENT; 
  347.  
  348. To print multiple line comments during compiling, 
  349.  
  350.                 .COMMENT:       
  351.                 ...
  352.                 ...
  353.                 COMMENT; 
  354.  
  355. .COMMENT: starts a group of lines that are to be printed to the terminal,
  356. until a terminating COMMENT; is found.
  357.  
  358. /* and */ pair can be used to enclose comments similar to the COMMENT:
  359. and COMMENT; pair. They make the source code look even closer to C code.
  360.  
  361. Plenty of documentation tools are provided in F-PC.  There is no excuse
  362. not using them to beautify your program.
  363.  
  364.  
  365. 4.7.    SCREEN CONTROL WORDS IN F-PC
  366.  
  367.  
  368. F-PC allows you to control the CRT screen to generate very fancy text
  369. displays.
  370.  
  371.         FAST                    Select the fast screen output routines
  372.                                 that are very hardware dependent.
  373.  
  374. The fast mode of screen display is much faster than what BDOS can do, but
  375. requires very compatible hardware.  As FAST stores characters directly
  376. into the hardware screen buffer, you have to make sure that a carriage
  377. return is inserted before a line runs over the 79'th column.  If you want
  378. line wrap, use:
  379.  
  380.         SLOW                    Select the SLOW screen output routines.
  381.  
  382. The BDOS display routines are less hardware dependent than FAST. 
  383.  
  384. When F-PC is loaded into PC, it asks DOS what kind of video board is in
  385. the PC and sets the video display mode accordingly.  It also allows you
  386. to change the attributes of displayed characters very conveniently.
  387.  
  388. In the monochrome mode, you can select from the following list different
  389. types of characters to be displayed on the screen:
  390.  
  391.         >NONE           Normal character display
  392.         >UL             Underlined
  393.         >BOLD           Bold
  394.         >REV            Reversed.  Black character on white background.
  395.         >BOLDUL         Bold underlined
  396.         >BOLDBLNK       Bold blinking
  397.         >REVBLNK        Reversed blinking
  398.  
  399. Characters EMITed to the screen are not affected by the attribute
  400. selection.  To show characters with the selected attribute, used FEMIT or
  401. TYPE.
  402.  
  403. F-PC also supports color cards.  It asks DOS which card is installed and
  404. configures the output routines accordingly.  In color mode, F-PC gives
  405. you the following choices:
  406.  
  407.         >BUGN           Blue background, green foreground
  408.         >RDWT           Red background, white foreground
  409.         >GNWT           Green background, white foreground
  410.  
  411. There are many other choices of background/foreground combinations.  The
  412. following word set allows you to specified any combination of foreground
  413. and background colors:
  414.  
  415.         >FG     ( n1 -- )       Select foreground
  416.         >BG     ( n1 -- )       Select background
  417.  
  418. Words from the COLOR.SEQ file that allow setting the foreground and
  419. background colors on a color monitor are:
  420.  
  421.         >ATTRIB1 to >ATTRIB8        ( -- )
  422.  
  423. They are deferred words to allow selection of the various display
  424. attributes for the current display board.  They default to the following
  425. attributes for Monochrome or Color Card:
  426.  
  427.                         MONOCHROME              COLOR
  428.         Word                                    bkgrnd  frgrnd
  429.  
  430.         >ATTRIB1        UNDERLINE               BLUE    GREEN
  431.         >ATTRIB2        BOLD UNDERLINE  RED     WHITE
  432.         >ATTRIB3        BOLD                    BLUE    WHITE
  433.         >ATTRIB4        REVERSE                 RED     WHITE
  434.  
  435. These values can be changed by changing either COLOR.SEQ, or MONOCROM.SEQ
  436. and re- generating the system with EXTEND.BAT.
  437.  
  438.         SAVESCR         ( -- )    Save screen
  439.         RESTSCR         ( -- )    Restore screen
  440.         RECOVERSCR      ( -- )    Copy rather than pop the screen stack.
  441.         RECOVERLINE     ( n -- )  Copy a line from saved screen stack.
  442.  
  443. These words give you the ability to save the screen contents and later
  444. restore the screen to its original appearance in a simple way.  SAVESCR
  445. may be used and nested up to three times before RESTSCR needs to be done.
  446. That is, three screens can be saved and sequentially restored.
  447.  
  448.  
  449. 4.8.    COMPILATION CONTROL WORDS
  450.  
  451.  
  452. To load a source file, the most convenient way is to use the command
  453. FLOAD or its alias INCLUDE:
  454.  
  455.         FLOAD <file-name> <return>
  456.         INCLUDE <file-name> <return>
  457.  
  458. will open the file and compile the source code starting at the beginning.
  459. After the file is compiled, FLOAD closes the file so that other files can
  460. be loaded.
  461.  
  462. If a file is opened by the editor or by the OPEN command, 
  463.  
  464.         OK <return>
  465.  
  466. compiles the currently open file, starting at the beginning, and
  467. continuing through the end of the file or until an error is encountered.
  468.  
  469.         <line-number> LOAD <return>
  470.  
  471. Start loading the current file starting at the <line_number> specified.
  472. If the stack is empty (no line- number specifier), it starts at line 1.
  473. It loads through the end of the file or until an error or an \S is
  474. encountered.  OK is defined as 1 LOAD.
  475.  
  476. The names of all files loaded into the F-PC system are stored in a
  477. vocabulary FILES.  The word .LOADED displays their names.
  478.  
  479. The word #IF has been added, which accepts a Boolean flag, and determines
  480. if the lines following #IF are compiled up until the #ENDIF.  A TRUE flag
  481. causes the lines to be compiled.  A FALSE flag causes the lines to be
  482. skipped.
  483.  
  484.         TRUE #IF
  485.                 .( This message will be printed.)
  486.         #ENDIF
  487.  
  488.  
  489. 4.9.    PRINTING SOURCE FILES IN F-PC
  490.  
  491.  
  492. Files can of course be printed while in the editor, but you can also
  493. print files from a Forth command line as follows:
  494.  
  495.         OPEN <filename> <return>                \ Open a file
  496.         LISTING <return>                        \ Print the file
  497.  
  498. The print format is the same as the default format for the editor.  Every
  499. page is printed with a header and a footer, suitable for framing.  The
  500. header is taken from the first line in the file.  You can thus customize
  501. the header according to your taste by carefully designing the text in the
  502. first line.  The footer provides the file name, page number, date and
  503. time.  A command which combines the two commands above is:
  504.  
  505.         FPRINT <filespec> <return>
  506.  
  507. It opens the file and performs a LISTING.  Wildcard characters can be
  508. used in the file specification so that many files are printed with a
  509. single FPRINT command.
  510.  
  511.         INDEX <filespec> <return>
  512.  
  513. behaves similarly to FPRINT.  However, it displays only the first line of
  514. each file specified and thus produces a nice table of contents for the
  515. files selected.
  516.  
  517. Another very useful word is PRINT.  PRINT turns on the printer and
  518. interprets the commands following it.   All the characters sent to the
  519. screen are now sent to the printer.
  520.  
  521.  
  522. 4.10.   GLOBAL SEARCH
  523.  
  524.  
  525. One of the neat additions to F-PC is EDITALL.  EDITALL is used as
  526. follows:
  527.  
  528.         EDITALL <string> <filespecs> ... <return>
  529.  
  530. All files specified are searched for <string>.  If the string is found,
  531. the editor is entered on that line in the file, ready for you to perform
  532. an edit or replace on the string.  If you use F8, the replacement is made
  533. and the next occurrence is found.  Otherwise, only the first occurrence
  534. of string is located, and repeated Alt-F6 commands can locate additional
  535. occurrences of string in the file.  Shift-F8 Replace-All can also be used
  536. while in a file to replace all occurrences of a string with another
  537. string.  When you are done editing, press ESC to terminate edit, and the
  538. search will continue through the filespecs specified for additional
  539. occurrences of string, until all files have been searched through.  This
  540. has been very valuable in maintaining a system by making global changes
  541. to all occurrences of a Forth word.
  542.  
  543. If you want to search a string containing spaces, just type EDITALL
  544. <return> and you will be prompted for a string to search for.
  545.  
  546. Another interesting addition to F-PC is:
  547.  
  548.         FLOOK <name> <filespecs> <return>
  549.  
  550. It performs similarly to EDITALL in searching for a string through many
  551. files, but it just displays the line number and the line contents of all
  552. occurrences found without doing anything to the strings found.  It is
  553. very useful to print a report on where a particular string occurred in a
  554. set of files.
  555.  
  556.  
  557. 4.11.   ALIAS
  558.  
  559.  
  560. In many occasions, there is a need to shorten the name of a word which we
  561. expect the user to use very often, like BROWSE, HELP, etc.  It is
  562. wasteful to redefine the function using a short name. ALIAS is a defining
  563. word which generates a new definition with a head only.  Its
  564. code-pointer- field points to the code field of an existing word.  It
  565. does not need its own code field at all. Examples of its uses are:
  566.  
  567.         '  BROWSE  ALIAS  B
  568.         '  HELP  ALIAS  H
  569.  
  570. The code field address returned by ' is then stored in the head of the
  571. new word, forcing it to perform the function of a word already defined in
  572. the dictionary.
  573.  
  574.  
  575. 4.12.   BROWSING A LARGE FILE
  576.  
  577.  
  578. F-PC generally reads an entire file into the editor buffer for editing
  579. and browsing.  It can handle a file up to about 120K bytes on a 640K byte
  580. machine.  However, if you have to examine a file larger than what the
  581. memory can hold, you can read in a part of it and browsing through that
  582. part. VIEWFROM and its alias VF is included to allow viewing very large
  583. files from a specified starting line number. It is used in the form:
  584.  
  585.         OPEN FPCGLOS.TXT                        \ A very large file
  586.         300 VIEWFROM <return>
  587.  
  588. The above commands skip the first 300 lines of the file and starts
  589. reading at line 300. This is useful for examining very large files.  You
  590. should of course be careful not to switch to editing mode and change such
  591. a file lest it get written back to the original file on disk. You can use
  592. Alt-W to write the read portion of the file out to a new file.
  593.  
  594.  
  595. 4.13.   THE NEWZ EDITOR
  596.  
  597.  
  598. This is Tom Zimmer's new and improved editor. The execution file and its
  599. documentation files are put in the NEWZ directory, separated from F-PC.
  600. This NEWZ editor includes some additional features that make it very
  601. useful when examining someone else's source code for a program you have
  602. been given. Tom had experienced the pain associated with taking over
  603. another person's program for maintenance and change.  It can be very
  604. painful if the program is large and consists of many files. NEWZ can now
  605. compile an index file of all symbols in your source files. It then
  606. provides a hypertext browsing environment where you can easily view,
  607. change, and explore a multitude of source files.  You can nest file
  608. searches and return to where you were. Locating any symbol in a
  609. multi-thousand symbol index file on an 80286 machine takes less than one
  610. second. This version of NEWZ supports Forth type words, and assembly
  611. symbols. Support for additional languages will be provided shortly on an
  612. as requested basis. See NEWZ's hypertext help under configuration for
  613. details of how to setup and build an index file of your source files.
  614.  
  615. NEWZ includes many new features, here is a brief summary:
  616.  
  617. 1.      Work with up to 20 files at one time. (Only one file is in memory
  618.         but switching between files with a hard disk is very quick, and
  619.         requires only a single keystroke.)
  620.  
  621. 2.      Searching is supported within a file, and across multiple files,
  622.         to help find any file that contains a particular character
  623.         sequence.
  624.  
  625. 3.      You can set the default file extension to any three characters.
  626.         The specified extension will be applied to a file when no
  627.         extension is specified.
  628.  
  629. 4.      Maximum file size is limited by available memory, and will
  630.         typically be greater than 250k on a 640k machine.
  631.  
  632. 5.      EGA/VGA high resolution text modes are supported, NEWZ will
  633.         automatically adjust to whatever screen size your display is set
  634.         for up to 132 columns by 60 lines.
  635.  
  636. 6.      You can create your own hypertext systems for training.
  637.  
  638. 7.      NEWZ is very fast, moving around a document, or from one end to
  639.         the other, is limited by the repeat rate of your keyboard, not
  640.         NEWZ's redisplay speed. On a 4.7 MHZ 8088 machine, NEWZ can
  641.         redisplay more than ten full (80x24) screens per second.
  642.  
  643. 8.      NEWZ automatically recognizes and supports a mouse when a driver
  644.         is present. The mouse can be used with pulldown menus, cursor
  645.         positioning, scanning through a document, and text line selection
  646.         for Cut and Copy operations.
  647.  
  648. 9.      You can specify in the NEWZ.CFG configuration file whether you
  649.         want backup copies kept of your edits.
  650.  
  651. The NEWZ editor is shareware. If you find NEWZ useful in your daily work,
  652. join other satisfied users and register your copy by sending a check for
  653. $50.00 to the address below.
  654.  
  655.         Tom Zimmer, 292 Falcato Drive, Milpitas, CA  95035,
  656.         Tel. (408) 263-8859.
  657.  
  658. You will receive the next upgrade free, and you will be notified of new
  659. releases about twice a year. Each upgrade will be about $25.00. Be sure
  660. to send your NEWZ revision date (displayed in the upper right hand corner
  661. after you leave NEWZ).
  662.  
  663.  
  664. 4.14.   THE SZ EDITOR
  665.  
  666.  
  667. This is another one of Tom Zimmer's new and improved editors.  The major
  668. improvement is its size, only 18K bytes!  It is produced by Tom's new
  669. target compiler, which is designed to generate tight and secure
  670. application programs from F-PC source.  It only compiles what is needed
  671. in the application and discards Forth words which are not used by the
  672. application.
  673.  
  674. SZ is very simple to use.  Type:
  675.  
  676.         SZ  <filename> <return>
  677.  
  678. and you can edit the file immediately.  Press F1 or ESC pops up and help
  679. screen showing all the commands available.  It has the general look and
  680. feel of SED, without the complications.  It is quite sufficient for
  681. writing programs and research papers.
  682.  
  683. SZ is a public domain program.  You can distribute it freely.  Contact
  684. Tom if you need a customized editor, or if you are interested in his
  685. target compiler.  
  686.  
  687.