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