home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 196.lha / Forth / readme.txt < prev    next >
Text File  |  1988-04-28  |  11KB  |  282 lines

  1.  
  2.                         Forth for Amigas.
  3.  
  4.  
  5.    These files comprise an implementation of F83 for Amiga's. F83 is a
  6. public domain Forth system written by Henry Laxen and Michael Perry, for
  7. CP/M and IBM pc's. Several other implementations for different computers
  8. are around, although none for Amiga's ( as far as I know ).
  9. See below for the discription of differences with F83.
  10.  
  11. First the files making up this system.
  12.  
  13. 1- Readme.txt     The file you are reading.
  14. 2- Forth          A compiled kernel ready to "run" from the Dos prompt.
  15. 3- Akernel.blk    The source for the kernel.
  16. 4- Utility.blk    The utilities which make this system useful, see below.
  17. 5- Cpu68k.blk     The forth RPN assembler and low level debugger support.
  18. 6- Meta.blk       The meta compiler, to generate your own system(s).
  19.  
  20. NOTE: THE FILE Utility.blk MUST BE RENAMED TO Utilities.blk, THE
  21.       ARC PROGRAM COULDN'T HANDLE THE LENGTH OF THE NAME AND I
  22.       HAD TO SHORTEN IT.
  23.       AFTER UNARCING, PLEASE RENAME IT:
  24.       rename Utility.blk as Utilities.blk
  25.  
  26. The version of arc program used:
  27. AmigArc version 0.23, compatible with ARC v 5.0.
  28.  
  29.  
  30.  
  31.  
  32. To start without reading any further:
  33. After unarcing, start the system by entering, from the Dos prompt:
  34.  
  35. Forth    ( or )
  36. run Forth
  37.  
  38. This will load the kernel as supplied and start it running. In the Forth
  39. window you can now enter:
  40.  
  41. open Utilities.blk
  42. and after the system responds with 'ok' enter either:
  43.  
  44. ok       ( or )
  45. 1 load
  46.  
  47.  
  48.  
  49.  
  50. In more detail. At the Dos prompt you can enter:
  51.  
  52. [run] Forth [[nnnn] <any acceptable forth command>]
  53.  
  54. nnnn - specifies the number of bytes allocated to your 'user dictionary'
  55.        and defaults to 64k bytes. The number must be in hex e.g.
  56.        run Forth A000
  57.  
  58. After the 'Forth' or 'nnnn' you can enter any Forth command or line of
  59.        Forth commands that the kernel can make sense out of. The most
  60.        useful of course would be to load in the Utilities:
  61.        run Forth open Utilities.blk ok
  62.        The ok is a synonym for '1 load' and will load screen 1 of the
  63.        current file. Usually the load screen for the file.
  64.  
  65.  
  66.  
  67.  
  68. A bit about running the system.
  69.  
  70. First of all if you are new to Forth it is best that you get some books on
  71.    the language. Some standard books available:
  72.  
  73.    STARTING FORTH by LEO BRODIE.
  74.    THINKING FORTH by LEO BRODIE.
  75.    MASTERING FORTH by ANITA ANDERSON and MARTIN TRACY
  76.  
  77.    These books are available from:
  78.    FORTH INTEREST GROUP
  79.    P.O.BOX 8231
  80.    SAN JOSE, CALIFORNIA, 95155
  81.    (408)277-0668
  82.  
  83.    And a membership with the above group will also be helpful.
  84.    The Forth Interest Group also has a roundtable on GEnie,
  85.    ( General Electric Network for Information Exchange )
  86.  
  87. Secondly try to print a listing of the system, to peruse at your leisure.
  88.  
  89.  
  90. Following is an explanation of some words which will be helpful in under-
  91. standing the system.
  92.  
  93. view     When entering view <name>, that is view followed by a word you
  94. list     are trying to understand, the system will display the screen that
  95. l        contains the source code.
  96. b        You can list screens by typing l ( the letter 'l' ). This will
  97. n        list the current screen. If you want to list a particular screen,
  98. a        nn list ( e.g. 45 list ) will list that screen.
  99.          To see the next screen: n l
  100.          To see the previous screen: b l
  101.          Each screen has a comment screen, called the shadow screen.
  102.          You can list it by entering: a l
  103.          This will list the shadow, also called the alternate. Some of the
  104.          explanations maybe of help.
  105.  
  106. listing  If you have a printer attached and have it set for 132 character
  107. open     lines, you can print the entire current file.
  108. file?    The word 'file?' will echo the name of the current file. If you
  109. files    want to change the current file you enter:
  110. show     open Meta.blk
  111. shadow   After that the current file would be Meta.blk. Typing 'listing'
  112.          will print the entire file with shadow screens beside the source
  113.          code screens.  To see which files are currently known by the
  114.          system type: files
  115.          This will show all the files known and open. If a file is known,
  116.          but is not open a double question mark will be printed. (??)
  117.          A lower level word to print the screens on the printer is show
  118.          Show will print 6 screens of code only on a page. It
  119.          requires a start screen number and an end screen number.
  120.          0 11 show, would print two pages of source code screens.
  121.          Shadow show will print a specified number of screens and their
  122.          shadows, 0 11 shadow show would print 4 pages.
  123.  
  124.  
  125. see      Is a decompiler. This word will attempt to decompile high level
  126.          words.  The low level words are in code and cannot be decompiled
  127.          by this word.
  128.          To use 'see' : see listing
  129.          This would decompile the word 'listing'. This together with
  130.          view can provide information about the system.
  131.  
  132.  
  133. create   To start your own file you must first create one. The word create
  134. edit     takes care of that: 10 create myfile.blk
  135. id       The above command creates a file called myfile.blk in the current
  136. load     directory, 10 screens long. You will now have to open the file.
  137. done     To enter source code you can start the editor by typing: 1 edit.
  138.          The system will start the editor on screen #1. It will display
  139.          the contents of the screen and ask for an id. Enter any string,
  140.          the standard is the date and initials. The cursor will now go
  141.          to byte 0 on the screen. You can start entering information.
  142.          The arrow keys will allow moving the cursor around.
  143.          See the editor listings, or view the screens for all the commands.
  144.          After entering some information you can exit the editor by first
  145.          typing a control-c to leave the screen editor, then typing: done.
  146.          This will put you back in the normal Forth area.
  147.          Now type nn load, where nn is the screen number you used. Any
  148.          number except 0 is ok to use.
  149.  
  150.  
  151. vocabulary  A confusing part of the system can be the vocabularies.
  152. vocs     Vocabularies are lists of words (routines) which belong together,
  153. words    are normally used in a particular context. They are like seperate
  154. current  dictionaries for different applications. For instance a routine
  155. context  called 'i' in the editor context could mean insert. Yet in
  156.          the regular Forth dictionary 'i' will return the index of a
  157.          do loop. The same word can have multiple meanings, depending on
  158.          the context in which it is used. Somewhat similar to English.
  159.          English also has words which mean different this at different
  160.          times, depending on the context they are used in.
  161.          The context, that is which vocabulary (=dictionary) is searched
  162.          for a word can be displayed by the word: order.
  163.          context: forth forth root
  164.          current: forth
  165.          would be a typical reply to that command. The above means that,
  166.          the context is forth; forth is searched. Then root, if the search
  167.          didn't find the word with the name you specified. If it fails again
  168.          it will try to make a number out of it. If that also fails, the
  169.          system will reply with ?  It doesn't know what you want.
  170.          Current means the dictionary which will receive any new words you
  171.          dream up.
  172.          Say you type editor and then type order:
  173.          context: editor forth root
  174.          current: forth
  175.          Now all words will be looked up in the editor vocabulary, then
  176.          forth, then root. The first one found matching the given name will
  177.          be executed.
  178.          At this point you can type: words
  179.          This will show you all the words defined in the editor vocabulary.
  180.          'See' a few of them if you like.  Switch back to forth by
  181.          typing: forth.  Now type: words. Press any key to stop the listing.
  182.          Enter the word: vocs. This will show you all the defined
  183.          vocabularies. Some are used for a specific purpose. Hidden for
  184.          instance is used in printing.
  185.  
  186. The books listed above can give you more help. I tried to give you a push
  187. in the right direction.
  188.  
  189.  
  190.  
  191. A little more technical information.
  192.  
  193. This system is NOT 83 standard, for several reasons. It follows closely
  194. F83 from L&P, but again is NOT identical. An identical system is not
  195. feasable on the Amiga.  If you have used F83, this system will be
  196. familiar enough to start using it.
  197.  
  198.  
  199. The compiled kernel:
  200.  
  201. -  Indirect threaded.
  202. -  Singles are 32 bits. Doubles are 64 bits. A cell is 32 bits. An address
  203.    a single or a pointer are interchangable.
  204. -  Opens a Console.device for window input and output.
  205. -  The size of the user ( or application ) dictionary can be specified at
  206.    startup.
  207. -  Uses a linear dictionary, but not connected to the user dictionary.
  208. -  User dictionary can be 'forgotten'. The kernel can not.
  209. -  Uses BSS memory from the Amiga Roms for disk buffers, in/output buffers.
  210. -  Return stack is 1k, needs Meta compiling for larger stack.
  211. -  Parameter stack size is specified by Amiga Dos. I use 8k. (stack 8000)
  212. -  Both stacks are not in the dictionary space.
  213. -  Supports a method of calling Amiga Rom routines. (But is not the final
  214.    word, on Rom routine calling).
  215. -  current size appr 21 k.
  216.  
  217. The Meta compiler:
  218.  
  219. The Meta Compiler produces a run file. This file can be executed from
  220. the Amiga Dos prompt. No linking is required.
  221. Since Amiga Dos requires run files to be relocatable, the Meta compiler
  222. had to be modified to produce a relocation table. 32 Bit relocations are
  223. marked in an array. When the system is saved, the relocation information
  224. is appended to the file.
  225. For this same reason, the system cannot be saved after starting it and
  226. loading some utilities. Only Meta Compiling will produce a run file.
  227. To get some memory from Amiga Dos to use as buffers, Block Storage Section,
  228. was added.  This will allocate some memory at startup, courtesy of the
  229. loader.
  230.  
  231. To Meta compile, you should forget part of the Utilities, presumably
  232. loaded at startup. I use : forget .4
  233. This will forget the dictionary from the dumping routine on up. The Meta
  234. compiler has a short dump routine.
  235. Next start the Meta Compiler by: open Meta.blk ok
  236. This will start the entire sequence. Be sure to resolve any forward
  237. references.
  238. The system is saved by: Save-target <name>
  239. You must also de-allocate the target image memory by entering: free-target.
  240.  
  241. I encourage you to take a look at Meta.blk to see what is going on, before
  242. you make any changes.
  243.  
  244.  
  245.  
  246. Finally:
  247. If you find any problems, errors or omissions, or would like to comment,
  248. drop me line. You can leave me E-mail on GEnie ( address: P.APPELMAN )
  249. or if you like, use regular mail.
  250.  
  251.  
  252.  
  253.  
  254.  
  255. This system is placed in the public domain, may be freely distributed and
  256. copied, as long as the author is given credit and no copyright notice is
  257. placed upon it.
  258.  
  259.  
  260. 29 Feb 88                        Peter Appelman
  261.                                  1460 Ghent Ave. apt 704
  262.                                  Burlington Ontario, Canada L7S-1X7
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.