home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / forth / compiler / fpc / doc / fpcutils.txt < prev    next >
Text File  |  1989-10-28  |  8KB  |  234 lines

  1.  
  2. °F-PC-Utils             Utilities Provided in F-PC
  3.                         ──────────────────────────
  4.   F-PC provides a number of tools to make exploring and programming in
  5. Forth easier and more efficient.
  6.  
  7.                                 Categories
  8.  
  9. ∙Decompiler             Un-compiles memory to see what was compiled.
  10. ∙Debugger               Source level debugger for Forth words
  11. ∙Dump-Memory            Examine any memory area of the computer.
  12. ∙Where-Used             Shows where a word is used.
  13. ∙Stack-Print            Examine the contents of the forth stack.
  14. ∙View/Browse            Hypertext link around the F-PC source code.
  15. ∙Word-Help              Operational Help on any F-PC word.
  16. ∙Words-Like             Scans dictionary for words containing a string.
  17. ∙Multi-File-Search      Scan multiple filespecs for a string.
  18. ∙Multi-File-Edit        Edit multiple files containing a string.
  19.  
  20.  
  21.  
  22.  
  23. °Decompiler                   Forth Decompiler
  24.                               ────────────────
  25.  
  26.    The word ∙SEE will Un-compile any (non-code) Forth word and show you the
  27. compiled source for that word.
  28.  
  29.  
  30.         Typing: SEE ∙HEX <Enter>                <Enter> is the Enter key.
  31.  
  32.         Will show:      : HEX
  33.                                 16 BASE ! ;
  34.  
  35.  
  36.   The decompiler can also be used on other Forth words types as well.  The
  37. primary advantage of the decompiler is that it is available even when the
  38. source code is not available for viewing.
  39.  
  40.  
  41.  
  42.  
  43.  
  44. °Debugger                 Debug Hi-level Forth Words
  45.                           ──────────────────────────
  46.   F-PC contains a source level debugger that allows stepping through Forth
  47. Colon definitions as they execute while examining the stack operations.
  48. This can be very useful when looking for renowned "Stack Underflow"
  49. problem.
  50.  
  51.   Two words are available for starting the debugger, they are:
  52.  
  53.        ∙DEBUG <word> <Enter>    Start debugging <word> when it is later
  54.                                 executed.
  55.  
  56.        ∙DBG   <word> <Enter>    Start debugging <word> now.
  57.  
  58. When the debugger is invoked, the source for <word> will be shown on the
  59. upper lines of the display with the current word hilighted in reverse
  60. video. A running word by word scroll with the current stack contents will
  61. appear at the bottom of the screen allowing you to step through the
  62. definition and watch what happens.
  63.  
  64.  
  65. °Dump-Memory              Display Memory Contents
  66.                           ───────────────────────
  67.   F-PC has words to dump any portion of memory in the computer. Multiple
  68. words are provided to make it easier to examine certain areas of the
  69. computers memory.
  70.  
  71.        Stack contents            Word               Function
  72.    ─────────────────────────────────────────────────────────────────────
  73.    ( address length )           ∙DUMP           Dumps CODE segment
  74.  
  75.    ( segment offset length )    ∙LDUMP          Dumps ANY segment
  76.  
  77.    ( relative-segment length )  ∙XDUMP          Dumps LIST segment
  78.  
  79.    ( offset length )            ∙YDUMP          Dumps HEAD segment
  80.  
  81.  
  82.   XDUMP takes the "relative-segment" that is compiled into the BODY field
  83. of a COLON definition and adds the contents of XSEG to determine where to
  84. XDUMP from.
  85.  
  86. °Where-Used             Where is This Word Used
  87.                         ───────────────────────
  88.  
  89.   Just as it is useful to look at a word's source to see how it works, it
  90. is also useful to see how a word is used.  The word to do this is:
  91.  
  92.         ∙REF <word> <Enter>
  93.  
  94.   All words that use <word> will be listed along with their vocabularies.
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.   See also ∙WORDS  ∙HELP
  105.  
  106.  
  107. °Stack-Print                Display Data Stack
  108.                             ──────────────────
  109.  
  110.  
  111.   F-PC provides two ways to look at the stack non-destructively.  At the
  112. Forth command level, you can type ∙.S <enter>, to see the stack displayed
  113. horizontally with the top of stack to the right.  The second way to display
  114. the stack is with a background task that is watching the keyboard waiting
  115. for both SHIFT keys to pressed. Then the routine detects both Shift keys,
  116. it pulls down a stack from the top of the screen which will remain visible
  117. until you release the Shift keys.  you can try it NOW, although you will
  118. probably only see the message "Stack Empty" appear.  At the Forth command
  119. level, after you have placed several items on the stack, a menu-like window
  120. will be pulled down showing the stack contents.
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128. °View/Browse            View or Browse a word
  129.                         ─────────────────────
  130.  
  131.   When installed on a hard disk drive F-PC has immediate access to the
  132. source for every word in the system. You can browse ANY Forth word by
  133. typing the following command:
  134.  
  135.         ∙BROWSE <word> <Enter>
  136.  
  137.   F-PC will lookup <word> and startup a browser on its source file for you
  138. to examine.
  139.  
  140.   F-PC actually has several ∙ALIAS or shortcut names you can use for the
  141. above command. Any of the following will work the same as BROWSE.
  142.  
  143.                         ∙B      ∙VIEW   ∙V
  144.  
  145.  
  146.  
  147.  
  148.  
  149. °Word-Help              Give me Help on a Word
  150.                         ──────────────────────
  151.  
  152.  
  153.   Just as the source for any word in F-PC can be Browsed of Viewed, you can
  154. get usage Help on any word in F-PC with the following command:
  155.  
  156.  
  157.         ∙HELP <word> <Enter>
  158.  
  159.   The <word> will be looked up, and the help file containing help for
  160. <word> will be shown to you in a browser.
  161.  
  162.   An ∙ALIAS or shorthand name for HELP is ∙H .
  163.  
  164.  
  165.  
  166.  
  167. See also ∙WORDS  ∙REF
  168.  
  169.  
  170. °Words-Like              Words Containing
  171.                          ────────────────
  172.  
  173.   F-PC can show you which words in its 2000+ word dictionary that contain a
  174. particular sequence of characters.  The command is:
  175.  
  176.                 ∙WORDS <sub-string> <Enter>
  177.  
  178.   All word in the dictionary regardless of which vocabulary they are in
  179. will be displayed along with the vocabulary name they are in.
  180.  
  181.   You can even pass two strings to WORDS and it will show words which
  182. contain only BOTH strings.
  183.  
  184.                 ∙WORDS <sub-string1> <sub-string2> <enter>
  185.  
  186.  
  187.  
  188.   See also ∙REF ∙HELP
  189.  
  190.  
  191. °Multi-File-Search      Find a String on Disk
  192.                         ─────────────────────
  193.  
  194.   There are times when you would like to know in which files a particular
  195. word or phrase is used.  For example you might want to know every place
  196. that uses a particular graphics word, or maybe you can't remember shich
  197. file contains the serial interface words.  F-PC makes it easy to look for
  198. such things on your hard disk with the following command:
  199.  
  200.                 ∙FLOOK GRAPHINIT SRC\*.SEQ <filespec> <filespec>
  201.  
  202.   In this example, we are looking for the word GRAPHINIT in the
  203. subdirectory SRC, and we are looking in all .SEQ files.  Multiple file
  204. specifications can follow and all files matching will be searched. The
  205. search is NOT case sensitive.  You can print all occurances found in the
  206. above command by preceeding it with the ∙PRINT command as follows:
  207.  
  208.                 ∙PRINT FLOOK GRAPHINIT SRC\*.SEQ
  209.  
  210.   See also ∙EDITALL
  211.  
  212. °Multi-File-Edit   Edit all occurances of a String
  213.                    ───────────────────────────────
  214.  
  215.  
  216.   Like FLOOK on the previous screen, there are times when you want to
  217. change all or almost all occurances of a character sequence from one string
  218. to another.  F-PC provides the ability to do this in the following command:
  219.  
  220.                 ∙EDITALL GRAPHINIT SRC\*.SEQ <filespec> <filespec>
  221.  
  222.   In this example perhaps you want to change all occurances of GRAPHINIT to
  223. GRAPHICS-INIT, as would occur if you changed the graphics package you were
  224. using.  Each file containing GRAPHINIT will be started in the editor at the
  225. first occurance found. You can then change it and search for additional
  226. occurances with Alt-F6, the repeat search command in the editor.
  227.  
  228.   When you leave the editor saving changes, the search will continue and
  229. start the editor on the next file where a match is found.
  230.  
  231.   See also ∙FLOOK
  232.  
  233.  
  234.