home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 2 / goldfish_vol2_cd1.bin / files / dev / lang / aforth / docs / usingaforth.doc < prev    next >
Encoding:
Text File  |  1994-05-17  |  71.8 KB  |  2,100 lines

  1. #1zz
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.                                                             A F O R T H
  12.            ____________________________________________________________
  13.  
  14.  
  15.                                                            Version 1.00
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.                        A FORTH-79 standard implementation for the Amiga
  23. z
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.      Stratagem4 AFORTH for the Amiga
  63.  
  64.      Program and Documentation Copyright (c) Stratagem4, 1994.
  65.  
  66.      AMIGA is a Registered Trademark of Commodore-Amiga, Inc.
  67.      FORTH is a Registered Trademark of FORTH, Inc.
  68.  
  69.      All rights reserved.
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.                                               Stratagem4 AFORTH For AmigaDOS
  82. z
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.                                                             A F O R T H
  92.  
  93.                                                U S E R ' S    G U I D E
  94.          ______________________________________________________________
  95.  
  96.  
  97.                                                            Version 1.00
  98.  
  99.  
  100.  
  101.  
  102.                        A FORTH-79 standard implementation for the Amiga
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.                                                              Stratagem4
  112.                                                    125 Broadview Avenue
  113.                                                                 Rainham
  114.                                                              Gillingham
  115.                                                                    Kent
  116.                                                                 ME8 9JD
  117.                                                                 England
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.                                               Stratagem4 AFORTH For AmigaDOS
  141. z
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.      Stratagem4 AFORTH for the Amiga User's Guide
  176.  
  177.      Copyright (c) Stratagem4, 1994.
  178.  
  179.      AFORTH was written by Steve Martin
  180.  
  181.      Support Address:    Stratagem4
  182.                          125 Broadview Avenue
  183.                          Rainham
  184.                          Gillingham
  185.                          Kent
  186.                          ME8 9JD
  187.                          England
  188.                               
  189.      Telephone:          (0634) 261412
  190.  
  191.      AMIGA is a Registered Trademark of Commodore-Amiga, Inc.
  192.      AmigaDOS and Workbench are trademarks of Commodore-Amiga, Inc.
  193.      FORTH is a Registered Trademark of FORTH, Inc.
  194.  
  195.      All rights reserved.
  196.  
  197.  
  198.  
  199.                                               Stratagem4 AFORTH For AmigaDOS
  200. z
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.                     __________________________________
  212.                              Table of Contents
  213.                     __________________________________
  214.  
  215.  
  216.  
  217.  
  218.  
  219.      Introduction                                                     1
  220.           Hardware Requirements                                       1
  221.           AmigaDOS Compatibility                                      2
  222.           Software Requirements                                       2
  223.  
  224.      Installation                                                     3
  225.           Product Registration                                        3
  226.           Diskette System                                             4
  227.                Single drive Workbench copy                            4
  228.                Multiple drive Workbench copy                          4
  229.                Single drive CLI copy                                  5
  230.                Multiple drive CLI copy                                5
  231.                Difficulties                                           5
  232.           Hard Disk System                                            6
  233.                Workbench                                              6
  234.                CLI                                                    6
  235.  
  236.      The Forth Language                                               7
  237.           A Brief History                                             7
  238.           Standard Comparison                                         8
  239.                Environment                                            8
  240.                Files, blocks and buffers                              8
  241.                Addressing                                             9
  242.                Programming                                            9
  243.                Language Extensions                                    9
  244.  
  245.      Programming In AFORTH                                           11
  246.           Programming                                                11
  247.                Interpret                                             11
  248.                Compile                                               12
  249.           Example Programs                                           13
  250.                STEPDOWN.F                                            13
  251.                CALENDAR.F                                            14
  252.                DATAFILE.F                                            14
  253.                CASE.F                                                14
  254.  
  255.  
  256.  
  257.                                                                           i
  258. z
  259.  
  260.  
  261.  
  262.  
  263.      Table of Contents
  264.  
  265.                                 Appendices
  266.  
  267.      Bibliography                                                    15
  268.           FORTH                                                      15
  269.           AmigaDOS                                                   17
  270.           Motorola 68000                                             17
  271.  
  272.      FORTH Loading Concepts                                          18
  273.  
  274.      AFORTH Reference                                                20
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.           ii                                  Stratagem4 AFORTH For AmigaDOS
  317. z
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.                                  Section 1
  328.                     __________________________________
  329.  
  330.                                Introduction
  331.                     __________________________________
  332.  
  333.  
  334.  
  335.  
  336.  
  337.      This is  a user's  guide for  the AmigaDOS  version of AFORTH.  It
  338.      explains how to install and operate the AFORTH environment, and it
  339.      also discusses the FORTH language as implemented by Stratagem4.
  340.  
  341.      If  you  are  already  familiar  with FORTH and AmigaDOS, then you
  342.      should have no problems using this guide.  However, if you are new
  343.      to FORTH  and/or AmigaDOS, you may find it useful to refer to some
  344.      of the publications listed in Appendix A, Bibliography
  345.  
  346.  
  347.      Hardware Requirements
  348.  
  349.      The  Stratagem4  AFORTH  environment  may  be  used  on  any Amiga
  350.      computer with at least 512K of main memory and one diskette drive.
  351.      Additional memory will be used if it is available.
  352.  
  353.      AFORTH is a very  memory efficient  implementation, utilizing only
  354.      100K  when  loaded.    This provides the complete environment, the
  355.      primary dictionary, and a 64K 'page' for your  own extension words
  356.      and vocabularies.
  357.  
  358.      Extra hardware items you may want to consider are:
  359.  
  360.           -    Additional memory
  361.  
  362.           -    Additional diskette drive
  363.  
  364.           -    A hard disk drive
  365.  
  366.           -    A printer
  367.  
  368.           -    A  colour  monitor,  80  column mode is utilized by this
  369.                system, you may experience difficulties using  it with a
  370.                normal television
  371.  
  372.  
  373.  
  374.  
  375.                                                                           1
  376. z
  377.  
  378.  
  379.  
  380.  
  381.      Introduction
  382.  
  383.      Please bear in mind that 100K is a minimum requirement to run this
  384.      environment, and that any memory  used  by  your  own  programs is
  385.      not, for obvious reasons, included in this calculation.
  386.  
  387.  
  388.      AmigaDOS Compatibility
  389.  
  390.      The   Stratagem4   AFORTH   environment,   related  programs,  and
  391.      utilities are compatible with AmigaDOS version  1.2 and  above, as
  392.      are the programs produced by the system, subject to the use of the
  393.      correct  library  calls   when   needed.      If   you   find  any
  394.      incompatibilities  please   contact  Stratagem4   at  the  address
  395.      printed on the facing  pages  of  this  manual,  or  telephone the
  396.      number printed  thereon.   At the  time of writing AFORTH has been
  397.      successfully tested with AmigaDOS versions 1.2,  1.3, 2.0  and 3.0
  398.      in various configurations.
  399.  
  400.  
  401.      Software Requirements
  402.  
  403.      The  Stratagem4  AFORTH  environment  requires  the  use of a text
  404.      editor for  the  construction  of  programs.    An  editor  is not
  405.      supplied  as  any  editor  capable  of  producing  ASCII output is
  406.      suitable,  experience  has  shown  that  people   have  their  own
  407.      preferences and  should not  be required to change.  If you do not
  408.      own a text editor then MEMACS, supplied on the Extras disk of your
  409.      Workbench disk  set, or  Ed, contained  in the  C directory of the
  410.      Workbench  disk,  are  suitable.    We  realize  that  this  is an
  411.      implementation  decision  that  may  offend  FORTH  purists and we
  412.      apologize to those sad souls, a  detailed discussion  of this, and
  413.      other implementation decisions, follows later in this document.
  414.  
  415.  
  416.  
  417.  
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.           2                                   Stratagem4 AFORTH For AmigaDOS
  435. z
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.                                  Section 2
  446.                     __________________________________
  447.  
  448.                                Installation
  449.                     __________________________________
  450.  
  451.  
  452.  
  453.  
  454.  
  455.      The Stratagem4  AFORTH environment is a Shareware distribution, as
  456.      such  we  have  little  control  on  the  form  in  which   it  is
  457.      distributed.   If you  received this package directly from us then
  458.      it will be in the form of a single diskette ready to  be used, you
  459.      should,  however,  make  a  backup  and store the master in a safe
  460.      place.  Other distribution sources may distribute the package in a
  461.      variety of  compressed forms,  in this  case you should follow the
  462.      instructions accompanying  that  distribution.    All distribution
  463.      methods should lead, eventually, to a single diskette form.
  464.  
  465.  
  466.      Product Registration
  467.  
  468.      If  you  received  this  package  as  a new product, instead of an
  469.      update, you must register  with us  in order  to receive technical
  470.      support and  future updates.   The  accompanying document USER.DOC
  471.      explains the registration procedure  and  the  Shareware marketing
  472.      concept.   Please take  the time to read the documentation and, if
  473.      you continue to find AFORTH useful,  register as  it may  save you
  474.      time in the future.
  475.  
  476.      If  you  experience  difficulty  installing  or  using the package
  477.      please contact us immediately.  You may do this by telephone or in
  478.      writing, USER.DOC explains these options more fully.
  479.  
  480.  
  481.  
  482.  
  483.  
  484.  
  485.  
  486.  
  487.  
  488.  
  489.  
  490.  
  491.  
  492.  
  493.                                                                           3
  494. z
  495.  
  496.  
  497.  
  498.  
  499.      Installation
  500.  
  501.      Diskette System
  502.  
  503.      If you  do not have a hard disk then you only need to make working
  504.      copies  of  your  original  AFORTH  disk.    Below  we  detail the
  505.      procedure for  single and  multiple diskette  drive systems, using
  506.      both the CLI and Workbench environments.
  507.  
  508.      1.   Single drive Workbench copy
  509.  
  510.           1.1. Insert your AFORTH disk  in  drive  DF0:,  this  is your
  511.                SOURCE disk, ensure that it is write protected.
  512.  
  513.           1.2. Select the disk's icon by left clicking on it.
  514.  
  515.           1.3. Select
  516.                1.3.1.    COPY  from  the  ICON  menu,  2.0  systems and
  517.                          above, OR
  518.                1.3.2.    DUPLICATE from WORKBENCH menu, 1.2 systems and
  519.                          above.
  520.  
  521.           1.4. Follow the  on screen  requesters, this may take several
  522.                disk swaps in lower memory capacity machines.
  523.  
  524.           1.5. On  completion  of  the  above  steps  you  will  have a
  525.                complete working copy of the master diskette.
  526.  
  527.      2.   Multiple drive Workbench copy
  528.  
  529.           2.1. Insert your  AFORTH disk  in one  of the drives, this is
  530.                your SOURCE disk, ensure that it is write protected.
  531.  
  532.           2.2. Insert an unprotected disk in any other available drive,
  533.                this is your DESTINATION disk.
  534.                **  WARNING  **  ALL  DATA  ON  THIS  DISKETTE  WILL  BE
  535.                DESTROYED BY THE FOLLOWING PROCEDURE!
  536.  
  537.           2.3. Left click and hold the SOURCE disk's icon.
  538.  
  539.           2.4. Drag the SOURCE icon over the DESTINATION disk's icon.
  540.  
  541.           2.5. Drop  the  SOURCE  icon  by  releasing  the  left  mouse
  542.                button.
  543.  
  544.           2.6. Follow any on screen requesters.
  545.  
  546.           2.7. On  completion  of  the  above procedure you will have a
  547.                complete working copy of the master diskette.
  548.  
  549.  
  550.  
  551.  
  552.           4                                   Stratagem4 AFORTH For AmigaDOS
  553. z
  554.  
  555.  
  556.  
  557.  
  558.      Installation
  559.  
  560.      3.   Single drive CLI copy
  561.  
  562.           3.1. Type 'DISKCOPY DF0: TO DF0:'<return>.
  563.  
  564.           3.2. Follow the on screen  requesters,  inserting  SOURCE and
  565.                DESTINATION diskettes as required.
  566.  
  567.           3.3. On  completion  of  the  above procedure you will have a
  568.                complete working copy of the master diskette.
  569.  
  570.      4.   Multiple drive CLI copy
  571.  
  572.           4.1. Insert your AFORTH disk  in one  of the  drives, this is
  573.                your SOURCE disk, ensure that it is write protected.
  574.  
  575.           4.2. Insert an unprotected disk in any other available drive,
  576.                this is your DESTINATION disk.
  577.                **  WARNING  **  ALL  DATA  ON  THIS  DISKETTE  WILL  BE
  578.                DESTROYED BY THE FOLLOWING PROCEDURE!
  579.  
  580.           4.3. Type 'DISKCOPY DFx: TO DFy:'<return>.
  581.                **  NOTE  **  x  AND  y  SHOULD BE REPLACED BY THE DRIVE
  582.                NUMBERS OF YOUR  CHOSEN  SOURCE  AND  DESTINATION DRIVES
  583.                RESPECTIVELY.
  584.  
  585.           4.4. Follow the on screen requesters.
  586.  
  587.           4.5. On  completion  of  the  above procedure you will have a
  588.                complete working copy of the master diskette.
  589.  
  590.      5.   Difficulties
  591.  
  592.           In case  of  difficulty  with  any  of  the  above procedures
  593.           consult the documentation which came with your Amiga system.
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.  
  602.  
  603.  
  604.  
  605.  
  606.  
  607.  
  608.  
  609.  
  610.  
  611.                                                                           5
  612.      User's Guide
  613. z
  614.  
  615.  
  616.  
  617.      Installation
  618.  
  619.      Hard Disk System
  620.  
  621.      If you  intend to run AFORTH from a hard disk then installation is
  622.      very straight forward.  Details follow for both  CLI and Workbench
  623.      methods.    Note  that  it  is  assumed  you are familiar with the
  624.      necessary steps to create directories, if this is a problem please
  625.      consult your system documentation.
  626.  
  627.      1.   Workbench
  628.  
  629.           1.1. Create a  new drawer on the hard disk to hold the AFORTH
  630.                programs.
  631.  
  632.           1.2. Open the AFORTH diskette  window and  drag at  least the
  633.                AFORTH  icon  and  the  PROGS  drawer  icon  to your new
  634.                drawer.
  635.  
  636.           1.3. AFORTH is now installed.
  637.  
  638.      2.   CLI
  639.  
  640.           2.1. Create a new directory on  the  hard  disk  to  hold the
  641.                AFORTH programs.
  642.  
  643.           2.2. Type 'COPY AFORTH:AFORTH TO <newdrawer>'<return>.
  644.  
  645.           2.3. Type 'COPY AFORTH:PROGS TO <newdrawer> ALL'<return>.
  646.  
  647.           2.4. AFORTH is now installed.
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.  
  668.  
  669.  
  670.           6                                   Stratagem4 AFORTH For AmigaDOS
  671. z
  672.  
  673.  
  674.  
  675.  
  676.  
  677.  
  678.  
  679.  
  680.  
  681.                                  Section 3
  682.                     __________________________________
  683.  
  684.                             The Forth Language
  685.                     __________________________________
  686.  
  687.  
  688.  
  689.  
  690.  
  691.      This section discusses the origination and definition of FORTH, as
  692.      described  by  the   79-Standard   document,   and   the  specific
  693.      implementation of  that standard, on the Amiga, as AFORTH.  We are
  694.      not providing a language  specification, Appendix  A lists several
  695.      sources which fulfil this function.
  696.  
  697.      A general  knowledge of  FORTH is assumed, although not essential,
  698.      and some technical issues are discussed which will  be of interest
  699.      to  those  well  versed  in  the  language.    Appendix  C, AFORTH
  700.      Reference is provided for your convenience  and details  each word
  701.      in the  base dictionary  by function,  you may  find it helpful to
  702.      refer to this whilst studying this, and the following, section.
  703.  
  704.  
  705.      A Brief History
  706.  
  707.      Created in the early 1970's by Charles Moore and Elizabeth Rather,
  708.      primarily for  the control  of radio  telescopes, FORTH is a fast,
  709.      flexible interactive programming language allowing the creation of
  710.      applications by means of extensions to the original language base.
  711.      It has been used in many  diverse  fields,  from  the  creation of
  712.      video games, to the animation sequences in 'Star Wars'.
  713.  
  714.      FORTH  has  been  promoted  in  many  ways,  FORTH,Inc.  promote a
  715.      commercial version known as polyFORTH, the FORTH Interest  Group a
  716.      public  domain  version  known  as  figFORTH.  The FORTH Standards
  717.      Team, a subset of the FORTH Interest Group, have promoted FORTH-79
  718.      and FORTH-83 with some success.  In recent years most applications
  719.      have been in the  field of  embedded control  systems, ie. vending
  720.      machines, production  lines, robots, et al.  Some recent software,
  721.      notably Real 3D version  2,  has  incorporated  an  internal FORTH
  722.      system proving that there is quite some life left in this peculiar
  723.      language yet!
  724.  
  725.  
  726.  
  727.  
  728.  
  729.                                                                           7
  730. z
  731.  
  732.  
  733.  
  734.  
  735.      The FORTH Language
  736.  
  737.      Standard Comparison
  738.  
  739.      AFORTH is a 100% assembly language implementation of  the FORTH-79
  740.      standard for  the Amiga.   Most  of the original standard has been
  741.      implemented    without    modification.        However,    various
  742.      implementation  decisions  were  taken  which have resulted in the
  743.      loss of some words,  the modification  of some  standards, and the
  744.      addition of new words.
  745.  
  746.      The following  list highlights  the differences between AFORTH and
  747.      the original 79-standard.
  748.  
  749.      1.   Environment
  750.           Normally  FORTH  offers  a  complete  operating  system which
  751.           replaces that  of the host machine.  In the case of the Amiga
  752.           it was  decided  that  it  was  not  desirable  to  replace a
  753.           perfectly good operating system, indeed we wish to use AFORTH
  754.           as a  development platform  for stand  alone, Amiga friendly,
  755.           applications.   Thus AFORTH  provides a multi-tasking console
  756.           environment from which the  Amiga, and  the language,  may be
  757.           manipulated.
  758.  
  759.      2.   Files, blocks and buffers
  760.           The  original  storage  method  consisted  of  addressing the
  761.           storage media as a series of 1K 'blocks', a number of virtual
  762.           blocks were maintained known as 'screens'.  Data and programs
  763.           were addressed by a series of block numbers, which you had to
  764.           maintain.    This  is  obviously  not satisfactory within the
  765.           current computing model and  we have,  therefore, implemented
  766.           'file' storage in its common form - by file name.
  767.  
  768.           2.1. The following  FORTH-79 words  do not  exist as a direct
  769.                result of this change:
  770.  
  771.                2.1.1.    LIST          (n ->)    List  block n  and set
  772.                          SCR to n
  773.                2.1.2.    SCR                  (-> addr) System variable
  774.                          holding listed block number
  775.                2.1.3.    UPDATE            ( ->  )      Mark last block
  776.                          access as updated
  777.  
  778.           2.2. The  following  FORTH-79  words  have been modified, the
  779.                79-standard  definitions   are  given   here.  Refer  to
  780.                Appendix B for a detailed discussion and redefinitions.
  781.  
  782.                2.2.1.    LOAD            (n ->)      Interpret block n,
  783.                          the resume normal input
  784.                2.2.2.    BLOCK           (n  -> addr)  Leave address of
  785.                          block  n,   reading  block   from  storage  if
  786.                          necessary
  787.  
  788.           8                                   Stratagem4 AFORTH For AmigaDOS
  789. z
  790.  
  791.  
  792.  
  793.  
  794.      The FORTH Language
  795.  
  796.                2.2.3.    BUFFER        (n ->  addr) Assign  free buffer
  797.                          to block n, leaving its address
  798.                2.2.4.    SAVE-BUFFERS   ( ->  )       Write all updated
  799.                          blocks to storage
  800.                2.2.5.    EMPTY-BUFFERS ( -> )      Mark  all buffers as
  801.                          empty
  802.  
  803.      3.   Addressing
  804.           FORTH-79 uses  16 bit  addressing, AFORTH  implements full 32
  805.           bit addressing.  This may appear trivial but  it impacts many
  806.           defined FORTH  words and  you should  be aware of this change
  807.           when converting programs from other systems  or, indeed, many
  808.           of the example programs given in the texts listed in Appendix
  809.           A.
  810.  
  811.      4.   Programming
  812.           FORTH programs  are  normally  entered  via  a  screen editor
  813.           written in  FORTH, it  is important  to note that there is no
  814.           official   standard   for   the   editor,   individual  FORTH
  815.           implementations vary greatly in this area.  We have taken the
  816.           decision not to provide an editor as any  text editor capable
  817.           of producing  ASCII files  will suffice, as AFORTH multitasks
  818.           the range  available  is  quite  large.    Further discussion
  819.           regarding this point may be found in Section 4.
  820.  
  821.      5.   Language Extensions
  822.           The following  words represent  extensions added  to ease the
  823.           changes in implementation, ease the language generally or are
  824.           common extensions we felt should be included.
  825.  
  826.           5.1.      SYSTEM ( -> )
  827.                Return to AmigaDOS
  828.           5.2.      MODE   ( -> addr)
  829.                System variable, zero when word is immediate
  830.           5.3.      VLIST  ( -> )
  831.                Print each  word in  dictionary search path from CONTEXT
  832.                to beginning
  833.           5.4.      D>R    (d -> )
  834.                Move double number to return stack
  835.           5.5.      DR>    ( -> d)
  836.                Retrieve double number from return stack
  837.           5.6.      DR@    ( -> d)
  838.                Copy double number from return stack
  839.           5.7.      C,     (byte -> )
  840.                Compile byte into latest defined dictionary entry
  841.           5.8.      D@     (addr -> d)
  842.                Fetch double number at address
  843.           5.9.      D!     (d addr -> )
  844.                Store double number at address
  845.  
  846.  
  847.                                                                           9
  848.      User's Guide
  849. z
  850.  
  851.  
  852.  
  853.      The FORTH Language
  854.  
  855.           5.10.     N->UD  (n1 n2 -> ud1 ud2)
  856.                Make top two signed  single  precision  numbers unsigned
  857.                double precision numbers
  858.           5.11.     DROPD  (d -> )
  859.                Drop double precision number
  860.           5.12.     DUPD   (d -> d d)
  861.                Duplicate double precision number
  862.           5.13.     D-     (d1 d2 -> d3)
  863.                Double precision subtraction
  864.           5.14.     D0<    (d -> flag)
  865.                TRUE if d less than zero
  866.           5.15.     D0=    (d -> flag)
  867.                TRUE if d equals zero
  868.           5.16.     D=     (d1 d2 -> flag)
  869.                TRUE if d1=d2
  870.           5.17.     DABS   (d -> |d|)
  871.                Absolute double value
  872.           5.18.     D,     (d -> )
  873.                Compile double value into the dictionary
  874.           5.19.     S->D   (n -> d)
  875.                Make single precision number double precision
  876.           5.20.     1D+    (d -> d+1)
  877.                Add 1 to double precision number
  878.           5.21.     2D+    (d -> d+2)
  879.                Add 2 to double precision number
  880.           5.22.     4D+    (d -> d+4)
  881.                Add 4 to double precision number
  882.           5.23.     1D-    (d -> d-1)
  883.                Subtract 1 from double precision number
  884.           5.24.     2D-    (d -> d-2)
  885.                Subtract 2 from double precision number
  886.           5.25.     4D-    (d -> d-4)
  887.                Subtract 4 from double precision number
  888.           5.26.     D.     (d -> )
  889.                Print d with one trailing space
  890.           5.27.     D.R    (d n -> )
  891.                Print d right justified in field width n
  892.           5.28.     .R     (n1 n2 -> )
  893.                Print n1 right justified in field width n2
  894.           5.29.     EVEN   (n -> flag)
  895.                TRUE if n is even
  896.           5.30.     ODD    (n -> flag)
  897.                TRUE if n is odd
  898.           5.31.     MYSELF ( -> )
  899.                Compile  CFA  of  word  we  are  compiling  into itself,
  900.                recursion!
  901.           5.32.     ASCII  ( -> n)
  902.                Leave ASCII value of <char> following
  903.  
  904.  
  905.  
  906.           10                                  Stratagem4 AFORTH For AmigaDOS
  907. z
  908.  
  909.  
  910.  
  911.  
  912.  
  913.  
  914.  
  915.  
  916.  
  917.                                  Section 4
  918.                     __________________________________
  919.  
  920.                            Programming In AFORTH
  921.                     __________________________________
  922.  
  923.  
  924.  
  925.  
  926.  
  927.      This section will describe  the programming  environment available
  928.      within AFORTH.   An introduction to FORTH programming is presented
  929.      with reference to the examples to  be found  in the  PROGS drawer.
  930.      This  is  not  an  instruction  text,  such  works may be found in
  931.      Appendix A.
  932.  
  933.  
  934.      Programming
  935.      FORTH is an extensible language, programming  involves writing new
  936.      words to perform new operations utilizing, mainly, existing words.
  937.      All  of  these  words  are  truly  compiled,  so  you  get maximum
  938.      performance from the system at all times.
  939.  
  940.      Words  are  stored  in  a  dictionary  which  may  be divided into
  941.      vocabularies.  You initially  get  a  dictionary  which  holds the
  942.      FORTH  vocabulary.     You   could  conceivably  have  a  database
  943.      vocabulary,  a  game   vocabulary,   a   French  vocabulary....any
  944.      vocabulary you want!
  945.  
  946.      FORTH has  two modes  of operation - interpreted and compiled.  We
  947.      will now examine both  modes using  small programming  examples to
  948.      clarify each point.
  949.  
  950.      1.   Interpret
  951.           Interpreted  mode   is  the   standard  interactive  mode  of
  952.           operation seen in languages such as  BASIC.   From the AFORTH
  953.           console type the following:
  954.  
  955.                CR ." Hello world!" CR
  956.  
  957.           and press  the return key (from now on we will assume this at
  958.           the end of each line, unless  stated otherwise).   You should
  959.           receive the response:
  960.  
  961.                Hello world!
  962.                 ok
  963.  
  964.  
  965.                                                                          11
  966. z
  967.  
  968.  
  969.  
  970.  
  971.      Programming in AFORTH
  972.  
  973.           the 'ok'  is AFORTH's input prompt.  This is a fairly trivial
  974.           example of  interpretive  mode,  you  type  some instructions
  975.           (providing  they   fit  on   one  input   line!)  and  AFORTH
  976.           immediately responds.  Try these few lines:
  977.  
  978.           2 2 * .
  979.           2 2 * 2 BASE ! . DECIMAL
  980.           10 2 + .
  981.           10 2 + 16 BASE ! . DECIMAL
  982.  
  983.           This helps to emphasize the interactive nature of  the AFORTH
  984.           environment  and  introduces  Reverse  Polish Notation (RPN).
  985.           RPN is the method by which FORTH performs  mathematics, first
  986.           we declare the operands and then the operator.  Lines 2 and 4
  987.           also show the use  of  the  number  BASE  variable,  line two
  988.           prints  4  as  a  binary  number  and  line  4 prints 12 as a
  989.           hexadecimal number.  The word DECIMAL sets BASE to base ten.
  990.  
  991.      2.   Compile
  992.           Compilation is the means by which new words are added  to the
  993.           FORTH dictionary.  Returning to our previous example type the
  994.           following:
  995.  
  996.                : HI CR ." Hello world!" CR ;
  997.  
  998.           Congratulations,  you  have  just  written  your  first FORTH
  999.           program!   So what happened when you pressed return? Nothing?
  1000.           Type this:
  1001.  
  1002.                HI
  1003.  
  1004.           You should receive the response:
  1005.  
  1006.                Hello world!
  1007.                 ok
  1008.  
  1009.           The instructions have been compiled and the word  HI has been
  1010.           added  to  the  dictionary.   Now, for completeness, type the
  1011.           following:
  1012.  
  1013.                FORGET HI
  1014.                HI
  1015.  
  1016.           notice the amnesiac response:
  1017.  
  1018.                HI ? ok
  1019.  
  1020.           FORTH  has  forgotten  HI,  it  has  been  removed  from  the
  1021.           dictionary.
  1022.  
  1023.  
  1024.           12                                  Stratagem4 AFORTH For AmigaDOS
  1025. z
  1026.  
  1027.  
  1028.  
  1029.  
  1030.      Programming in AFORTH
  1031.  
  1032.           This  method  of  compilation,  ie.  on the terminals command
  1033.           line, is rather limited.   You  must  finish  your definition
  1034.           before the  end of the line, 80 characters, is reached or you
  1035.           get a nasty message.  There  is no  scope for  comments using
  1036.           this  method  either  and,  worse  still, no way to save your
  1037.           programs.
  1038.  
  1039.           The interpreted program method,  and line  entry compilation,
  1040.           are  ideal  modes  for  testing  your programming ideas, they
  1041.           encourage short, succinct, words and will  help you  to think
  1042.           in a modular way but, for real programming purposes, you need
  1043.           a text editor.   You enter  your program  in the  text editor
  1044.           using comments,  indentation and  multiple lines, your source
  1045.           file may include several word definitions, and then  you LOAD
  1046.           it into AFORTH.
  1047.  
  1048.           The PROGS  drawer contain several example programs, replacing
  1049.           <pathname> with your system path to the PROGS drawer type the
  1050.           following:
  1051.  
  1052.                LOAD <pathname>PROGS/CALENDAR.F"
  1053.  
  1054.           Providing you  have entered the path correctly, and installed
  1055.           AFORTH according to  the  instructions  in  this  manual, you
  1056.           should, after a small delay, receive the 'ok' prompt.  Type:
  1057.  
  1058.                VLIST
  1059.  
  1060.           and  you  will  notice  that  a number of new words have been
  1061.           added to the dictionary.  You have just loaded and compiled a
  1062.           complete vocabulary,  named calendar,  which was entered on a
  1063.           text editor away from the AFORTH  environment.   Note that as
  1064.           AFORTH is  a multitasking  environment you  may have the text
  1065.           editor loaded simultaneously  and  flip  between  the  two by
  1066.           using the  screen depth  arrangement gadget  in the top right
  1067.           corner of your screen.
  1068.  
  1069.      Example Programs
  1070.      As mentioned earlier the  PROGS  drawer  contains  several example
  1071.      programs.     These  programs  have  been  carefully  selected  to
  1072.      demonstrate certain points about programming in  FORTH in general,
  1073.      and AFORTH  in particular.   Below  you will  find a list of these
  1074.      examples  together  with  an   explanation  of   their  particular
  1075.      relevance to AFORTH.
  1076.  
  1077.      1.   STEPDOWN.F
  1078.           A simple  new programming  construct which illustrates how to
  1079.           build constructs in FORTH and  the  use  of  modules  in your
  1080.           development.
  1081.  
  1082.  
  1083.                                                                          13
  1084.      User's Guide
  1085. z
  1086.  
  1087.  
  1088.  
  1089.      Programming in AFORTH
  1090.  
  1091.      2.   CALENDAR.F
  1092.           An  example  of  a  large  project type, unlike STEPDOWN this
  1093.           example produces a useful working vocabulary.   Once  again a
  1094.           modular approach  is exemplified, in this case the equivalent
  1095.           of  assembling  the  engine   parts  into   a  complex  drive
  1096.           mechanism.
  1097.  
  1098.      3.   DATAFILE.F
  1099.           This  example  demonstrates  the  use of the modified loading
  1100.           concept to save and  load program  data.   It also  offers an
  1101.           object lesson  in FORTH's  ability to modify memory addresses
  1102.           directly.   This file  also auto-boots  its own demonstration
  1103.           program.
  1104.  
  1105.      4.   CASE.F
  1106.           Finally a  useful, some would say essential, extension to the
  1107.           FORTH vocabulary in  the  form  of  a  CASE  construct.   The
  1108.           included   word   TESTCASE   demonstrates  the  use  of  this
  1109.           important new construct.
  1110.  
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117.  
  1118.  
  1119.  
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.  
  1127.  
  1128.  
  1129.  
  1130.  
  1131.  
  1132.  
  1133.  
  1134.  
  1135.  
  1136.  
  1137.  
  1138.  
  1139.  
  1140.  
  1141.  
  1142.           14                                  Stratagem4 AFORTH For AmigaDOS
  1143. z
  1144.  
  1145.  
  1146.  
  1147.  
  1148.  
  1149.  
  1150.  
  1151.  
  1152.  
  1153.  
  1154.  
  1155.                                 Appendix A
  1156.                        _____________________________
  1157.  
  1158.                                Bibliography
  1159.                        _____________________________
  1160.  
  1161.  
  1162.  
  1163.      Listed below are a number of publications and  articles which have
  1164.      directly, or indirectly, influenced the production of this program
  1165.      and its documentation.    Also  included  are  a  number  of works
  1166.      representing further studies the reader may wish to investigate.
  1167.  
  1168.      FORTH
  1169.      ~~~~~
  1170.      Davis, Chris [1988]
  1171.      Roll Your Own Language, article published in October 1988 issue of
  1172.      Program Now, Intra Press, Intra House,  193 Uxbridge  Road, London
  1173.      W12 9RA, England.
  1174.  
  1175.      Pountain, Dick [1988]
  1176.      Changing  Reverse  Polish  To  Infix, article published in January
  1177.      1988 issue of BYTE, One Phoenix Mill Lane, Peterborough, NH 03458,
  1178.      USA.
  1179.  
  1180.      The FORTH Standards Team [1984]
  1181.      FORTH-83, The  FORTH Interest  Group, PO  Box 1105, San Carlos, CA
  1182.      94070, USA.
  1183.  
  1184.      Grandis-Harrison, Dick de [1983-1984]
  1185.      Various articles published monthly from June 1983 to March 1984 in
  1186.      SOFT, Sportscene  Specialist Press  Ltd, 14 Rathbone Place, London
  1187.      W1P 1DE, England.
  1188.  
  1189.      Winfield, Alan [1983]
  1190.      The Complete FORTH, ISBN  0-905104-22-6, Sigma  Technical Press, 5
  1191.      Alton Road, Wilmslow, Cheshire SK9 5DY, England.
  1192.  
  1193.      Winfield, Alan [1983]
  1194.      Pascal In  FORTH, article  published in September and October 1983
  1195.      issues of  SOFT,  Sportscene  Specialist  Press  Ltd,  14 Rathbone
  1196.      Place, London W1P 1DE, England.
  1197.  
  1198.  
  1199.  
  1200.  
  1201.                                                                          15
  1202. z
  1203.  
  1204.  
  1205.  
  1206.  
  1207.      Bibliography
  1208.  
  1209.      Pountain, Dick [1983]
  1210.      UnPolished FORTH,  article published  in June  1983 issue of SOFT,
  1211.      Sportscene Specialist Press Ltd,  14  Rathbone  Place,  London W1P
  1212.      1DE, England.
  1213.  
  1214.      Pountain, Dick [1983]
  1215.      Raster Is  Faster, article  published in  July 1983 issue of SOFT,
  1216.      Sportscene Specialist Press Ltd,  14  Rathbone  Place,  London W1P
  1217.      1DE, England.
  1218.  
  1219.      Ting, H C [1983]
  1220.      Inside F83, Offete Enterprises, 1306 South B Street, San Mateo, CA
  1221.      94402, USA.
  1222.  
  1223.      Knecht, K [1982]
  1224.      Introduction to  FORTH, Howard  W Sams  & Company,  4300 West 62nd
  1225.      Street, Indianapolis, Indiana 46268, USA.
  1226.  
  1227.      Brodie, Leo [1981]
  1228.      Starting FORTH, ISBN 0-13-842922-7, FORTH Inc.
  1229.  
  1230.      Fritzon, R [1981]
  1231.      Write  your   own  pseudo-FORTH  compiler,  article  published  in
  1232.      February and March issues of Micro-computing.
  1233.  
  1234.      Loeliger, R G [1981]
  1235.      Threaded Interpretive Languages, ISBN 0-07-038360-X, Byte Books.
  1236.  
  1237.      Katzan, H [1981]
  1238.      Invitation to FORTH, Petrocelli  Books,  Research  Park,  251 Wall
  1239.      Street, Princeton, NJ 08540, USA.
  1240.  
  1241.      Moore, C H [1980]
  1242.      The Evolution  Of FORTH, An Unusual Language, article published in
  1243.      August 1980 issue of BYTE, One Phoenix Mill Lane, Peterborough, NH
  1244.      03458, USA.
  1245.  
  1246.      The FORTH Standards Team [1980]
  1247.      FORTH-79, The  FORTH Interest  Group, PO  Box 1105, San Carlos, CA
  1248.      94070, USA.
  1249.  
  1250.      Rather, E D, L Brodie and C Rosenberg [1979]
  1251.      Using FORTH, FORTH-79 standard edition, FORTH Inc.
  1252.  
  1253.      James, J S
  1254.      FORTH on microcomputers, Dr Dobbs, no 26.
  1255.  
  1256.      Moore, C H & E D Rather [1974]
  1257.      FORTH: A new way to  program  a  minicomputer,  Astron. Astrophys.
  1258.      suppl. 15.
  1259.  
  1260.           16                                  Stratagem4 AFORTH For AmigaDOS
  1261. z
  1262.  
  1263.  
  1264.  
  1265.  
  1266.      Bibliography
  1267.  
  1268.      Moore, C H & E D Rather [1973]
  1269.      The FORTH  program for spectral line observing, Proc. IEEE, vol 61
  1270.      September 1973.
  1271.  
  1272.      AmigaDOS
  1273.      ~~~~~~~~
  1274.      Commodore-Amiga Inc. [1986]
  1275.      The  AmigaDOS   Manual,  ISBN   0-553-34294-0,  Bantam  Electronic
  1276.      Publishing, 666 Fifth Avenue, New York, NY 10103, USA.
  1277.  
  1278.      Commodore-Amiga Inc. [1986]
  1279.      Amiga  ROM  Kernel  Reference  Manual:  Exec,  ISBN 0-201-11099-7,
  1280.      Addison-Wesley Publishing Company, Reading, MA, USA.
  1281.  
  1282.      Commodore-Amiga Inc. [1986]
  1283.      Amiga ROM Kernel Reference  Manual:  Libraries  and  Devices, ISBN
  1284.      0-201-11078-4,  Addison-Wesley  Publishing  Company,  Reading, MA,
  1285.      USA.
  1286.  
  1287.      Commodore-Amiga Inc. [1986]
  1288.      Amiga   Intuition    Reference    Manual,    ISBN   0-201-11076-8,
  1289.      Addison-Wesley Publishing Company, Reading, MA, USA.
  1290.  
  1291.      Commodore-Amiga Inc. [1986]
  1292.      Amiga    Hardware    Reference    Manual,    ISBN   0-201-11077-6,
  1293.      Addison-Wesley Publishing Company, Reading, MA, USA.
  1294.  
  1295.      Mortimore, Eugene P [1986]
  1296.      Amiga Programmer's Handbook, Volume I, ISBN  0-895880-343-0, SYBEX
  1297.      Inc., 2021 Challenger Drive #100, Alameda, CA 94501, USA.
  1298.  
  1299.      Mortimore, Eugene P [1986]
  1300.      Amiga  Programmer's  Handbook,  Volume  II,  ISBN  0-895888-384-8,
  1301.      SYBEX Inc., 2021 Challenger Drive #100, Alameda, CA 94501, USA.
  1302.  
  1303.      Motorola 68000
  1304.      ~~~~~~~~~~~~~~
  1305.      Kane, G, D Hawkins and L Leventhal [1987]
  1306.      68000   Assembly   Language   Programming    2nd   Edition,   ISBN
  1307.      0-07-881232-1, Osborne/McGraw-Hill, 2600 Tenth Street, Berkely, CA
  1308.      94710, USA.
  1309.  
  1310.      Motorola Inc. [1986]
  1311.      The  MC68000  User's  Manual  5th  Edition,   ISBN  0-13-541475-X,
  1312.      Prentice-Hall Inc., Englewood Cliffs, NJ 07632, USA.
  1313.  
  1314.      Williams, Steve [1985]
  1315.      Programming  The  68000,  ISBN  0-89588-133-0,  SYBEX  Inc.,  2021
  1316.      Challenger Drive #100, Alameda, CA 94501, USA.
  1317.  
  1318.  
  1319.                                                                          17
  1320.      User's Guide
  1321. z
  1322.  
  1323.  
  1324.  
  1325.  
  1326.  
  1327.  
  1328.  
  1329.  
  1330.  
  1331.  
  1332.                                 Appendix B
  1333.                        _____________________________
  1334.  
  1335.                           FORTH Loading Concepts
  1336.                        _____________________________
  1337.  
  1338.  
  1339.  
  1340.      The FORTH-79 Loading Concept
  1341.  
  1342.      The original FORTH implemented  a  VIRTUAL  MEMORY  MODEL  for its
  1343.      storage requirements,  that is  to say that it divided the storage
  1344.      medium (disk or cassette) into a series of  'blocks' and  loaded a
  1345.      range    of  'blocks'  into  memory  areas  known as 'screens'.  A
  1346.      'block' was given  an  arbitrary  size  of  1024  bytes  (1K), the
  1347.      editing  screen  was  also  16  lines high and 64 characters wide-
  1348.      another 1024 bytes.
  1349.  
  1350.      This  storage  method   was   quite   adequate   for   the  fairly
  1351.      unsophisticated computer  systems of the time where 16K of RAM was
  1352.      considered to be 'massive'  and floppy  disks normally  held about
  1353.      360K of data.  Furthermore, the FORTH system normally replaced the
  1354.      computers native operating system which meant that it  was free to
  1355.      use the storage media in any way it saw fit.
  1356.  
  1357.      Typically  a  user  would  select  an  arbitrary  range  of  block
  1358.      numbers, write a program,  using  a  fairly  simple  screen editor
  1359.      implemented  in  FORTH,  over  a  number  of  screens, saving them
  1360.      sequentially to the blocks already selected.  File  names were not
  1361.      employed and it was necessary to maintain an index of used blocks,
  1362.      together with a synopsis of their contents.  The LOAD  command was
  1363.      used to  load these  programs back  into memory and submit them to
  1364.      the FORTH interpreter.  The command  <100 LOAD>  would fetch block
  1365.      100  from  the  current  storage  device  and  submit  it  to  the
  1366.      interpreter.  A special  command (normally  ==>) would  enable the
  1367.      automatic loading of the next sequential block.
  1368.  
  1369.  
  1370.      The AFORTH Loading Concept
  1371.  
  1372.      As  you  can  see  the  original  FORTH concept does not translate
  1373.      easily to the modern arena, especially  when applied  to the Amiga
  1374.      specifically.    In  the  modern  context we MUST implement a file
  1375.      naming mechanism,  usurping a  perfectly good  operating system is
  1376.      NOT an  option.   However, we  do not need to provide an editor as
  1377.  
  1378.           18
  1379. z
  1380.  
  1381.  
  1382.  
  1383.  
  1384.      FORTH Loading Concepts
  1385.  
  1386.      any ASCII text editor can provide us with source files,  this also
  1387.      means that  the user is not restricted to some compromise solution
  1388.      and can use any editor with which s/he is familiar.
  1389.  
  1390.      As implemented  the  user  can  enter  simple  programs,  ie colon
  1391.      definitions  (new  WORDs),  on  the  command  line but they cannot
  1392.      exceed the  length  of  the  line,  80  characters  from  colon to
  1393.      semi-colon.   An ASCII  source file is the only way in which WORDs
  1394.      exceeding 80 characters may be entered,  this has  the side effect
  1395.      of  allowing  definitions  longer  than  allowed  in  the original
  1396.      standard implementations, the limit then being a screen  full.  In
  1397.      the  interests  of  readability  and  modularity,  not  to mention
  1398.      debugging  and  code  maintenance,   you   should   restrict  your
  1399.      definitions to  small simple types, building complexity from their
  1400.      use in other definitions.
  1401.  
  1402.  
  1403.      Word Summary
  1404.  
  1405.      BLK
  1406.           a variable array containing  two  32  bit  values,  first the
  1407.           address  of  the  current  buffer  (zero  indicates  keyboard
  1408.           input), and second the size of that buffer.  This information
  1409.           is initialized and maintained by LOAD.
  1410.  
  1411.      BUFFER
  1412.           attempts to  allocate a  memory area of the size requested on
  1413.           the stack, to be Amiga specific we pass  a memory  type value
  1414.           as well where: 0=public, 1=chip, 2=fast.
  1415.  
  1416.      EMPTY-BUFFERS
  1417.           frees memory allocated by BUFFER.
  1418.  
  1419.      BLOCK
  1420.           opens and  loads a  file into  memory, calls BUFFER to obtain
  1421.           the required memory, leaves a size  and address  on the stack
  1422.           and reports any errors to the screen.
  1423.  
  1424.      SAVE-BUFFERS
  1425.           saves memory allocated by BUFFER under a given name.
  1426.  
  1427.      LOAD
  1428.           opens file  with name following, various error reports, calls
  1429.           BLOCK.
  1430.  
  1431.  
  1432.  
  1433.  
  1434.  
  1435.  
  1436.  
  1437.                                                                          19
  1438.      User's Guide
  1439. z
  1440.  
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.  
  1450.                                 Appendix C
  1451.                        _____________________________
  1452.  
  1453.                              AFORTH Reference
  1454.                        _____________________________
  1455.  
  1456.  
  1457.  
  1458.      Listed below, and on the following pages, is the complete FORTH-79
  1459.      dictionary,  as  implemented  in  AFORTH, including details of all
  1460.      language extensions.    For  a  detailed  discussion  of  the main
  1461.      variations and  deviations from  the standard  please refer to the
  1462.      main text.
  1463.  
  1464.      Stack notation: (stack before -> stack after)
  1465.  
  1466.      Operand key: 
  1467.           n,n1 ..   16 bit value
  1468.           d,d1 ..   32 bit value
  1469.           addr ..   32 bit address
  1470.           byte ..   16 bit  value whose  lower 8  bits only  are set or
  1471.                     used
  1472.           char ..   16 bit  value whose  lower 7  bits only  are set or
  1473.                     used
  1474.           flag ..   16 bit value representing a Boolean flag
  1475.                     zero=false,  non-zero=true  (the  'true'  value  is
  1476.                     normally -1)
  1477.           u    ..   unsigned number prefix
  1478.  
  1479.      Stack Manipulation
  1480.      DUP                 (n -> n n)     Duplicate top of stack
  1481.      ?DUP                (n -> n (n))   Duplicate only if non-zero
  1482.      DUPD                (d -> d d)     Duplicate    double   precision
  1483.                                         number
  1484.      DROP                (n -> )        Lose top of stack
  1485.      DROPD               (d -> )        Drop double precision number
  1486.      SWAP                (n1 n2 ->
  1487.                               n2 n1)    Reverse top two stack items
  1488.      OVER                (n1 n2 ->
  1489.                               n1 n2 n1) Duplicate 2nd item on top
  1490.      ROT                 (n1 n2 n3 ->
  1491.                               n2 n3 n1) Rotate 3rd item to top
  1492.      PICK                (n1 -> n2)     Duplicate n1th item on top
  1493.      ROLL                (n -> )        Rotate nth item to top
  1494.  
  1495.  
  1496.           20
  1497. z
  1498.  
  1499.  
  1500.  
  1501.  
  1502.      AFORTH Reference
  1503.  
  1504.      DEPTH               ( -> n)        Count the  number  of  items on
  1505.                                         the stack, item = 16 bits
  1506.      >R                  (n -> )        Move top item to return stack
  1507.      R>                  ( -> n)        Retrieve item from return stack
  1508.      R@                  ( -> n)        Copy n from return stack 
  1509.      D>R                 (d -> )        Move  double  number  to return
  1510.                                         stack
  1511.      DR>                 ( -> d)        Retrieve  double   number  from
  1512.                                         return stack
  1513.      DR@                 ( -> d)        Copy double  number from return
  1514.                                         stack
  1515.  
  1516.      Comparison
  1517.      <                   (n1 n2 ->
  1518.                               flag)     TRUE if n1 less than n2
  1519.      =                   (n1 n2 ->
  1520.                               flag)     TRUE if n1=n2
  1521.      >                   (n1 n2 ->
  1522.                               flag)     TRUE if n1 greater than n2
  1523.      0<                  (n -> flag)    TRUE if n is negative
  1524.      0=                  (n -> flag)    TRUE if n=0
  1525.      0>                  (n -> flag)    TRUE if n is greater than zero
  1526.      U<                  (un1 un2 ->
  1527.                               flag)     TRUE  if  un1  less  than  un2,
  1528.                                         unsigned compare
  1529.      D<                  (d1 d2 ->
  1530.                               flag)     TRUE if d1 less than d2
  1531.      D=                  (d1 d2 -> flag)TRUE if d1=d2
  1532.      D0<                 (d -> flag)    TRUE if d less than zero
  1533.      D0=                 (d -> flag)    TRUE if d equals zero
  1534.      NOT                 (flag -> -flag)Reverse truth value
  1535.                                         Note that this is effective for
  1536.                                         all  flag  producing comparison
  1537.                                         operations,     ie.    FALSE=0,
  1538.                                         TRUE=-1, but may be ineffective
  1539.                                         in other situations
  1540.      EVEN                (n -> flag)    TRUE if n is even
  1541.      ODD                 (n -> flag)    TRUE if n is odd
  1542.  
  1543.      Arithmetic and logical
  1544.      +                   (n1 n2 -> sum) Add n1+n2
  1545.      -                   (n1 n2 ->
  1546.                               diff)     Subtract n1-n2
  1547.      *                   (n1 n2 -> prod)Multiply
  1548.      /                   (n1 n2 ->
  1549.                               quot)     Divide, n1/n2, quotient rounded
  1550.                                         toward zero
  1551.      MOD                 (n1 n2 -> rem) Divide,  n1/n2,  remainder  has
  1552.                                         sign of n1
  1553.  
  1554.  
  1555.                                                                          21
  1556.      User's Guide
  1557. z
  1558.  
  1559.  
  1560.  
  1561.      AFORTH Reference
  1562.  
  1563.      /MOD                (n1 n2 ->
  1564.                               rem quot) Divide   with   remainder   and
  1565.                                         quotient, n1/n2
  1566.      */MOD               (n1 n2 n3 ->
  1567.                               rem quot) n1*n2/n3,      with      double
  1568.                                         intermediate
  1569.      */                  (n1 n2 n3 ->
  1570.                               quot)     n1*n2/n3, with double precision
  1571.                                         intermediate
  1572.      U*                  (un1 un2 ->
  1573.                               ud)       Multiply     unsigned,    leave
  1574.                                         unsigned double result
  1575.      U/MOD               (ud un ->
  1576.                          urem uquot)    Divide double number by single,
  1577.                                         all  unsigned,  leave  unsigned
  1578.                                         quotient and remainder
  1579.      1+                  (n -> n+1)     Add 1
  1580.      2+                  (n -> n+2)     Add 2
  1581.      1-                  (n -> n-1)     Subtract 1
  1582.      2-                  (n -> n-2)     Subtract 2
  1583.      D+                  (d1 d2 ->
  1584.                               dsum)     Double precision add
  1585.      D-                  (d1 d2 -> d3)  Double precision subtraction
  1586.      1D+                 (d -> d+1)     Add   1   to  double  precision
  1587.                                         number
  1588.      2D+                 (d -> d+2)     Add  2   to   double  precision
  1589.                                         number
  1590.      4D+                 (d -> d+4)     Add   4   to  double  precision
  1591.                                         number
  1592.      1D-                 (d -> d-1)     Subtract    1    from    double
  1593.                                         precision number
  1594.      2D-                 (d -> d-2)     Subtract    2    from    double
  1595.                                         precision number
  1596.      4D-                 (d -> d-4)     Subtract    4    from    double
  1597.                                         precision number
  1598.      MAX                 (n1 n2 -> max) Compare   n1   n2   and   leave
  1599.                                         greater
  1600.      MIN                 (n1 n2 -> min) Compare n1 n2 and leave lesser
  1601.      ABS                 (n -> |n|)     Make absolute value of n
  1602.      DABS                (d -> |d|)     Absolute double value
  1603.      NEGATE              (n -> -n)      Change sign, 2's complement
  1604.      DNEGATE             (d -> -d)      Change sign  of  double number,
  1605.                                         2's complement
  1606.      AND                 (n1 n2 -> and) Bitwise logical AND
  1607.      OR                  (n1 n2 -> or)  Bitwise logical OR
  1608.      XOR                 (n1 n2 -> xor) Bitwise logical XOR
  1609.  
  1610.  
  1611.  
  1612.  
  1613.  
  1614.           22                                  Stratagem4 AFORTH For AmigaDOS
  1615. z
  1616.  
  1617.  
  1618.  
  1619.  
  1620.      AFORTH Reference
  1621.  
  1622.      Memory
  1623.      C@                  (addr -> byte) Fetch byte at address
  1624.      C!                  (byte addr ->) Store byte at address
  1625.      @                   (addr -> n)    Fetch number at address
  1626.      !                   (n addr -> )   Store number at address
  1627.      D@                  (addr -> d)    Fetch double number at address
  1628.      D!                  (d addr -> )   Store double number at address
  1629.      ?                   (addr -> )     Print  the   number  stored  at
  1630.                                         address
  1631.      +!                  (n addr -> )   Add  n  into  number  stored at
  1632.                                         address
  1633.      MOVE                (addr1
  1634.                          addr2 n -> )   Move  n   numbers  starting  at
  1635.                                         addr1 to addr2
  1636.      CMOVE               (addr1
  1637.                          addr2 n -> )   Move n bytes starting  at addr1
  1638.                                         to addr2
  1639.      FILL                (addr
  1640.                          n byte -> )    Fill  n  bytes starting at addr
  1641.                                         with byte
  1642.  
  1643.      Control Structures
  1644.      DO                  (end start ->) Set up DO..LOOP or  +LOOP given
  1645.                                         index range
  1646.      LOOP                ( -> )         Add  one  to  index,  exit loop
  1647.                                         when index>=end
  1648.      +LOOP               (n -> )        Add n to  index,  if  n>=0 exit
  1649.                                         when   index>=end,   else  exit
  1650.                                         when index=end
  1651.      I                   ( -> n)        Fetch current loop index value
  1652.      J                   ( -> n)        Fetch  next  outer  loop  index
  1653.                                         value
  1654.      LEAVE               ( -> )         Force DO loop termination
  1655.      IF                  (flag -> )     Construct IF...THEN,
  1656.                                                   IF...ELSE...THEN
  1657.      ELSE                ( -> )         In construct IF..ELSE..THEN
  1658.      THEN                ( -> )         In      construct     IF..THEN,
  1659.                                                        IF..ELSE..THEN
  1660.      BEGIN               ( -> )         Mark start  of  UNTIL  or WHILE
  1661.                                         loop
  1662.      UNTIL               (flag -> )     Construct   BEGIN..UNTIL,  loop
  1663.                                         until flag is true
  1664.      WHILE               (flag -> )     In                    construct
  1665.                                         BEGIN..WHILE..REPEAT
  1666.      REPEAT              ( -> )         Loop while flag true at WHILE
  1667.      EXIT                ( -> )         Prematurely   exit  this  colon
  1668.                                         definition
  1669.      EXECUTE             (addr -> )     Execute word  whose  CFA  is at
  1670.                                         address
  1671.  
  1672.  
  1673.                                                                          23
  1674.      User's Guide
  1675. z
  1676.  
  1677.  
  1678.  
  1679.      AFORTH Reference
  1680.  
  1681.      Character input-output
  1682.      EMIT                (char -> )     Print character
  1683.      CR                  ( -> )         Print carriage  return and line
  1684.                                         feed
  1685.      SPACE               ( -> )         Print one space
  1686.      SPACES              (n -> )        Print n spaces
  1687.      ."                  ( -> )         Print text delimited by "
  1688.      TYPE                (addr n -> )   Print   the    string    of   n
  1689.                                         characters at address
  1690.      COUNT               (addr ->
  1691.                               addr+1 n) Fetch count byte n and point to
  1692.                                         string
  1693.      -TRAILING           (addr n1 ->
  1694.                               addr n2)  Reduce   character   count   by
  1695.                                         trailing spaces
  1696.      ASCII <char>        ( -> n)        Leave ASCII value of <char>
  1697.                                         STATE  smart   -  if  compiling
  1698.                                         compiles n as LITERAL
  1699.      KEY                 ( -> char)     Wait for a key  press and leave
  1700.                                         its ASCII value on the stack
  1701.      EXPECT              (addr n -> )   Read  n  characters,  or  until
  1702.                                         return,   from   keyboard  into
  1703.                                         memory at addr
  1704.      QUERY               ( -> )         Read  80  characters,  or until
  1705.                                         return, from  keyboard to input
  1706.                                         buffer
  1707.      WORD                (char -> addr) Read   next   word  from  input
  1708.                                         stream using  char  as terminal
  1709.                                         delimiter.   Leave  address  of
  1710.                                         length byte.
  1711.  
  1712.      Number input-output
  1713.      BASE                ( -> addr)     System     variable,    current
  1714.                                         numerical base
  1715.      DECIMAL             ( -> )         Set BASE to decimal
  1716.      .                   (n -> )        Print n with one trailing space
  1717.      U.                  (un -> )       Print    unsigned    with   one
  1718.                                         trailing space
  1719.      D.                  (d -> )        Print d with one trailing space
  1720.      D.R                 (d n -> )      Print  d   right  justified  in
  1721.                                         field width n
  1722.      .R                  (n1 n2 -> )    Print  n1  right  justified  in
  1723.                                         field width n2
  1724.      CONVERT             (d1 addr1 ->
  1725.                               d2 addr2) Convert  string  at  addr1+1 to
  1726.                                         double,  add  to d1 leaving d2,
  1727.                                         addr2 is address of  first non-
  1728.                                         convertible  character  or 0 if
  1729.                                         converted ok
  1730.  
  1731.  
  1732.           24                                  Stratagem4 AFORTH For AmigaDOS
  1733. z
  1734.  
  1735.  
  1736.  
  1737.  
  1738.      AFORTH Reference
  1739.  
  1740.      <#                  ( -> )         Begin   a    formatted   number
  1741.                                         conversion
  1742.      S->D                (n -> d)       Make  single  precision  number
  1743.                                         double precision
  1744.      N->UD               (n1 n2 ->
  1745.                               ud1 ud2)  Make  top   two  signed  single
  1746.                                         precision    numbers   unsigned
  1747.                                         double precision numbers
  1748.      #                   (ud1 -> ud2)   Convert next digit  of  ud1 and
  1749.                                         HOLD it
  1750.      #S                  (ud -> 0 0)    Convert and  HOLD all remaining
  1751.                                         significant digits
  1752.      HOLD                (char -> )     Insert character into formatted
  1753.                                         string
  1754.      SIGN                (n ud -> ud)   HOLD   minus   sign   if  n  is
  1755.                                         negative
  1756.      #>                  (ud -> addr n) End       formatted      number
  1757.                                         conversion, drop ud and prepare
  1758.                                         string for type
  1759.  
  1760.      Mass storage input-output
  1761.      BUFFER              (d n ->
  1762.                               d addr)   Allocate  a   memory  block  of
  1763.                                         size  d  and  type n, leave the
  1764.                                         size  d  and  address   of  the
  1765.                                         allocated block.   Addr will be
  1766.                                         zero if the allocation failed.
  1767.                                         n=type where  0=PUBLIC, 1=CHIP,
  1768.                                         2=FAST
  1769.                                         d=size in bytes
  1770.      BLOCK               (addr1 ->
  1771.                               d addr2)  Open and  read into storage the
  1772.                                         file whose  name  is  at addr1,
  1773.                                         report  errors  to the console.
  1774.                                         Leaves  buffer   size,  d,  and
  1775.                                         address,  addr2.    Both values
  1776.                                         will be zero if failed.
  1777.      LOAD <name>         ( -> )         Load and interpret file <name>
  1778.      SAVE-BUFFERS        (d addr1
  1779.                          addr2 -> d
  1780.                          addr1 flag)    Write  contents  of  buffer  at
  1781.                                         addr1,  size  d,  under name at
  1782.                                         addr2 to storage.    Report all
  1783.                                         errors  to  the console.  Leave
  1784.                                         the size, address and a flag.
  1785.      EMPTY-BUFFERS       (d addr -> )   Frees memory  block  at address
  1786.                                         of  size  d,  the  block should
  1787.                                         have been allocated by BUFFER
  1788.  
  1789.  
  1790.  
  1791.                                                                          25
  1792.      User's Guide
  1793. z
  1794.  
  1795.  
  1796.  
  1797.      AFORTH Reference
  1798.  
  1799.      Defining words
  1800.      : <name>            ( -> )         Begin   colon   definition   of
  1801.                                         <name>
  1802.      ;                   ( -> )         End colon definition
  1803.      VARIABLE <name>     ( -> )         Define variable <name>.
  1804.           <name>         ( -> addr)     Returns PFA when executed
  1805.      CONSTANT <name>     (n -> )        Define   constant  <name>  with
  1806.                                         value n.
  1807.           <name>         ( -> n)        Returns n when executed.
  1808.      VOCABULARY <name>   ( -> )         Define a vocabulary <name>.
  1809.           <name>         ( -> )         Becomes    CONTEXT   vocabulary
  1810.                                         when executed
  1811.      CREATE <name>       ( -> )         Create   an   empty  dictionary
  1812.                                         entry <name>.
  1813.           <name>         ( -> addr)     Returns PFA when executed
  1814.      DOES>               ( -> )         Defines  run   time  action  of
  1815.                                         most   recently  defined  word.
  1816.                                         Used to define defining words.
  1817.  
  1818.      Vocabularies
  1819.      CONTEXT             ( -> addr)     System variable, vocabulary for
  1820.                                         word searches
  1821.      CURRENT             ( -> addr)     System variable, vocabulary for
  1822.                                         definitions
  1823.      FORTH               ( -> )         Set  CONTEXT   to   main  FORTH
  1824.                                         vocabulary
  1825.      DEFINITIONS         ( -> )         Set   CURRENT   vocabulary   to
  1826.                                         CONTEXT vocabulary
  1827.      ' <name>            ( -> addr)     Find PFA of <name>
  1828.                                         STATE  smart   -  if  compiling
  1829.                                         compiles address as a LITERAL
  1830.      FIND                ( -> addr)     Find CFA  of next word in input
  1831.                                         stream
  1832.      FORGET <name>       ( -> )         Forget all  definitions back to
  1833.                                         <name> inclusive
  1834.      VLIST               ( -> )         Print  each  word in dictionary
  1835.                                         search  path  from  CONTEXT  to
  1836.                                         beginning
  1837.  
  1838.      Compiler
  1839.      C,                  (byte -> )     Compile    byte   into   latest
  1840.                                         defined dictionary entry
  1841.      ,                   (n -> )        Compile n  into  latest defined
  1842.                                         dictionary entry
  1843.      D,                  (d -> )        Compile  double  value into the
  1844.                                         dictionary
  1845.      ALLOT               (n -> )        Add n  bytes  to  the Parameter
  1846.                                         Field  of  the  latest  defined
  1847.                                         dictionary entry
  1848.  
  1849.  
  1850.           26                                  Stratagem4 AFORTH For AmigaDOS
  1851. z
  1852.  
  1853.  
  1854.  
  1855.  
  1856.      AFORTH Reference
  1857.  
  1858.      IMMEDIATE           ( -> )         Mark   most   recently  defined
  1859.                                         word as immediate
  1860.      LITERAL             (n -> )        Compile n as a literal
  1861.      STATE               ( -> addr)     System  variable, non-zero when
  1862.                                         compiling
  1863.      MODE                ( -> addr)     System variable, zero when word
  1864.                                         is immediate
  1865.      [                   ( -> )         Stop    compiling   and   start
  1866.                                         executing
  1867.      ]                   ( -> )         Stop   executing    and   start
  1868.                                         compiling
  1869.      COMPILE             ( -> )         Compile   the    CFA   in   the
  1870.                                         following PFA
  1871.      [COMPILE]           ( -> )         Compile   the    CFA   of   the
  1872.                                         following    word    even    if
  1873.                                         immediate
  1874.      MYSELF              ( -> )         Compile  CFA  of  word  we  are
  1875.                                         compiling      into     itself,
  1876.                                         recursion!
  1877.  
  1878.      Miscellaneous
  1879.      (                   ( -> )         Begin comment, terminated by )
  1880.      HERE                ( -> addr)     Address   of   next   available
  1881.                                         dictionary location
  1882.      PAD                 ( -> addr)     System variable, address of 256
  1883.                                         byte scratchpad
  1884.      BLK                 ( -> addr)     System     variable,    details
  1885.                                         current input buffer
  1886.      >IN                 ( -> addr)     System  variable,  offset  into
  1887.                                         input buffer
  1888.      EOF                 ( -> addr)     System variable,  TRUE when end
  1889.                                         of buffer
  1890.      DPL                 ( -> addr)     System   variable,   number  of
  1891.                                         decimal places in most recently
  1892.                                         converted  word,  -1  if single
  1893.                                         precision
  1894.      SYSTEM              ( -> )         Return to AmigaDOS
  1895.      ABORT               ( -> )         Clear  all  stacks  and  return
  1896.                                         control to keyboard
  1897.      QUIT                ( -> )         Clear  return  stack and return
  1898.                                         control to keyboard
  1899.      79-STANDARD         ( -> )         Verify that  system conforms to
  1900.                                         FORTH-79 standard
  1901.  
  1902.  
  1903.  
  1904.  
  1905.  
  1906.  
  1907.  
  1908.  
  1909.                                                                          27
  1910.      User's Guide
  1911. z
  1912.  
  1913.  
  1914.  
  1915.  
  1916.  
  1917.  
  1918.  
  1919.  
  1920.  
  1921.                     __________________________________
  1922.                                    Index
  1923.                     __________________________________
  1924.  
  1925.  
  1926.  
  1927.  
  1928.  
  1929.  
  1930.  
  1931.  
  1932.  
  1933.  
  1934.  
  1935.  
  1936.  
  1937.  
  1938.  
  1939.  
  1940.  
  1941.  
  1942.  
  1943.  
  1944.  
  1945.  
  1946.  
  1947.  
  1948.  
  1949.  
  1950.  
  1951.  
  1952.  
  1953.  
  1954.  
  1955.  
  1956.  
  1957.  
  1958.  
  1959.  
  1960.  
  1961.  
  1962.  
  1963.  
  1964.  
  1965.  
  1966.  
  1967.                                                                           i
  1968. z
  1969.  
  1970.  
  1971.  
  1972.  
  1973.      Index
  1974.  
  1975.      .  24                              Addressing  9
  1976.      ."  24                             AFORTH  1, 2, 3, 7, 8
  1977.      .R  10, 24                              disk  4, 5
  1978.      ,  26                                   diskette  6
  1979.      :  26                                   environment  1, 2, 3
  1980.      ;  26                                   icon  6
  1981.      !  23                                   programming
  1982.      ?  23                                        environment  11
  1983.      ?DUP  20                                programs  6
  1984.      '  26                                   Standard   Comparison
  1985.      (  27                                        8
  1986.      [  27                              AFORTH environment  2
  1987.      [COMPILE]  27                      ALLOT  26
  1988.      ]  27                              AmigaDOS  1, 17
  1989.      +  21                                   compatibility  2
  1990.      +!  23                                  version  1, 2
  1991.      +LOOP  23                          AND  22
  1992.      -  21                              Arithmetic and logical  21
  1993.      -TRAILING  24                      ASCII  2, 9, 10, 24
  1994.      *  21                              Backup
  1995.      */  22                                  Difficulties  5
  1996.      */MOD  22                               Multiple drive CLI  5
  1997.      /  21                                   Multiple        drive
  1998.      /MOD  22                                     Workbench  4
  1999.      <  21                                   Single drive CLI  5
  2000.      <#  25                                  Single          drive
  2001.      =  21                                        Workbench  4
  2002.      >  21                              BASE  12, 24
  2003.      >IN  27                            BEGIN  23
  2004.      >R  21                             BLK  27
  2005.      #  25                              BLOCK  8, 25
  2006.      #>  25                             BUFFER  9, 25
  2007.      #S  25                             C,  9, 26
  2008.      @  23                              C!  23
  2009.      0<  21                             C@  23
  2010.      0=  21                             CALENDAR.F  14
  2011.      0>  21                             CASE.F  14
  2012.      1+  22                             Character input-output  24
  2013.      1-  22                             CMOVE  23
  2014.      1D+  10, 22                        Comparison  21
  2015.      1D-  10, 22                        Compile  12, 27
  2016.      2+  22                             Compiler  26
  2017.      2-  22                             CONSTANT  26
  2018.      2D+  10, 22                        CONTEXT  26
  2019.      2D-  10, 22                        Control Structures  23
  2020.      4D+  10, 22                        CONVERT  24
  2021.      4D-  10, 22                        COUNT  24
  2022.      79-STANDARD  27                    CR  24
  2023.      ABORT  27                          CREATE  26
  2024.      ABS  22                            CURRENT  26
  2025.  
  2026.           ii                                  Stratagem4 AFORTH For AmigaDOS
  2027. z
  2028.  
  2029.  
  2030.  
  2031.  
  2032.      Index
  2033.  
  2034.      D.  10, 24                              FigFORTH  7
  2035.      D.R  10, 24                             FORTH,Inc.  7
  2036.      D,  10, 26                              History  7
  2037.      D!  9, 23                               Interest Group  7
  2038.      D+  22                                  PolyFORTH  7
  2039.      D-  10, 22                              Standards Team  7
  2040.      D<  21                                  The,Language  7, 11
  2041.      D=  10, 21                         FORTH purists  2
  2042.      D>R  9, 21                         FORTH-79  7, 8
  2043.      D@  9, 23                          FORTH-83  7
  2044.      D0<  10, 21                        Hard disk  4
  2045.      D0=  10, 21                        Hard disk install
  2046.      DABS  10, 22                            CLI  6
  2047.      DATAFILE.F  14                          Workbench  6
  2048.      DECIMAL  12, 24                    Hard disk installation
  2049.      Defining words  26                      CLI  6
  2050.      DEFINITIONS  26                         Workbench  6
  2051.      DEPTH  21                          Hard Disk System  6
  2052.      Diskette System  4                 Hardware Requirements  1
  2053.      Distribution sources  3            HERE  27
  2054.      DNEGATE  22                        HOLD  25
  2055.      DO  23                             I  23
  2056.      Documentation  3                   IF  23
  2057.      DOES>  26                          IMMEDIATE  27
  2058.      DPL  27                            Implementation   decisions
  2059.      DR>  9, 21                                   2
  2060.      DR@  9, 21                         Incompatibilities  2
  2061.      DROP  20                           Installation  3
  2062.      DROPD  10, 20                      Installing  3
  2063.      DUP  20                            Interpret  11
  2064.      DUPD  10, 20                       J  23
  2065.      Ed  2                              KEY  24
  2066.      Editor  2                          Language Extensions  9
  2067.      ELSE  23                           LEAVE  23
  2068.      EMIT  24                           LIST  8
  2069.      EMPTY-BUFFERS  9, 25               LITERAL  27
  2070.      Environment  8                     LOAD  8, 13, 25
  2071.      EOF  27                            Loading
  2072.      EVEN  10, 21                            AFORTH  18
  2073.      Example Programs  13                    FORTH-79  18
  2074.      EXECUTE  23                        LOOP  23
  2075.      EXIT  23                           Mass  storage input-output
  2076.      EXPECT  24                                   25
  2077.      Extras disk  2                     MAX  22
  2078.      Files, blocks  and buffers         MEMACS  2
  2079.                8                        Memory  23
  2080.      FILL  23                           MIN  22
  2081.      FIND  26                           Miscellaneous  27
  2082.      FORGET  26                         MOD  21
  2083.      FORTH  1, 7, 26                    MODE  9, 27
  2084.  
  2085.                                                                         iii
  2086.      User's Guide
  2087. z
  2088.  
  2089.  
  2090.  
  2091.      Index
  2092.  
  2093.      Moore, Charles  7                  VARIABLE  26
  2094.      MOVE  23                           VLIST  9, 26
  2095.      MYSELF  10, 27                     Vocabularies  26
  2096.      N->UD  10, 25                      VOCABULARY  26
  2097.      NEGATE  22                         WHILE  23
  2098.      NOT  21                            WORD  24
  2099.      Number input-output  24            Workbench disk  2
  2100.      ODD  10, 21                        Working copies  4
  2101.      OR  22                             XOR  22
  2102.      OVER  20
  2103.      PAD  27
  2104.      PICK  20
  2105.      Product Registration  3
  2106.      Programming  9, 11
  2107.      QUERY  24
  2108.      QUIT  27
  2109.      R>  21
  2110.      R@  21
  2111.      Rather, Elizabeth  7
  2112.      Registration procedure  3
  2113.      REPEAT  23
  2114.      Reverse   Polish  Notation
  2115.                12
  2116.      ROLL  20
  2117.      ROT  20
  2118.      S->D  10, 25
  2119.      SAVE-BUFFERS  9, 25
  2120.      SCR  8
  2121.      Shareware
  2122.           distribution  3
  2123.           marketing  3
  2124.      SIGN  25
  2125.      Software Requirements  2
  2126.      SPACE  24
  2127.      SPACES  24
  2128.      Stack Manipulation  20
  2129.      STATE  27
  2130.      STEPDOWN.F  13
  2131.      SWAP  20
  2132.      SYSTEM  9, 27
  2133.      Text editor  2, 9
  2134.      THEN  23
  2135.      TYPE  24
  2136.      U.  24
  2137.      U*  22
  2138.      U/MOD  22
  2139.      U<  21
  2140.      UNTIL  23
  2141.      UPDATE  8
  2142.      USER.DOC  3
  2143.  
  2144.           iv                                  Stratagem4 AFORTH For AmigaDOS
  2145. c