[net.lang.forth] Special Posting in a series, forwarded from...

UMFORTH@WEIZMANN.BITNET (... the FIGIL Digest) (01/17/86)

Date: Wed, 8 Jan 86 23:52 EST
From: SECRIST%OAK.SAINET.MFENET@LLL-MFE.ARPA
Subject: ET-FIG News Posting #5
Organization: Science Applications Int'l. Corp., Oak Ridge, Tenn.
Geographic-Location: 36 01' 42" N, 84 14' 14" W
CompuServe-ID: [71636,52]


  Excerpts from the ET-FIG News                  Posting #5 in a series

  ------------------------------------------------------------------------------
   Volume 1, Number 5  **  East Tennessee FORTH Interest Group  **  06-DEC-1984
  ------------------------------------------------------------------------------

                                 IN THIS ISSUE:

                             A Simple HELP Function
                                 N-Digit Pi Code
                           Book Review: Thinking FORTH
                       Software Review: LMI Z-80 FORTH 3.0
                In Print: Review of (then) recent FORTH articles
                    Public Domain: KFORTH for the Z-80 Kaypro
                           Errata from our last issue


                                    -=<***>=-


  Word of the Month

                          * A SIMPLE "HELP" FUNCTION *


  HELP displays the "cheat sheet" for the  editor  functions.   I  seem  to  be
  forever  looking  for my editor reference sheet because I only use the editor
  occasionally.  The text for the HELP display can be stored in any screen.   I
  used  Screen  19  because it was free, and the code for HELP is in Screen 18.
  Screen 18 is loaded as part of the editor anyway with the DL change that  was
  published  last  month  (see  ERRATA).   This  made  HELP  part of the Editor
  vocabulary and not available to the rest of  Forth.   The  following  is  the
  source screen listing for both the source and the text displayed.

  SCR # 18

    4 : HELP
    5     SCR @ 19 LIST SCR SCR ! ;
    6
        [rest of screen empty]


  SCR # 19
    0 ( EDITOR HELP SCREEN    SCR# 19                   11/16/84     )
    1 -R  REPLACE SEARCH STRING  TRADE    TRADE n AND m LINES
    2 L    LIST SCREEN           T        TYPE LINE
    3 I    INSERT LINE           DL       DELETE LINE
    4 M    MOVE n LINES          D        DELETE n CHARS
    5 EX   EXIT EDITOR/SAVE      SCRATCH  EXIT EDITOR/NOSAVE
    6 NEW  INSERT LINES          SPREAD   MOVE LINES DOWN
    7 S    SEARCH FOR STRING     E        EDIT AGAIN
    8

        [rest of screen is blank]


  HELP is very simple.  The current edited screen (SCR)  is  fetched  onto  the
  stack  for  safe  keeping.   The  HELP  SCREEN  (19)  is  listed; then SCR is
  restored.  It works well with my line editor and should work with any  editor
  just as well.  HELP is so simple and useful that I wonder why I did not think
  of it before.  [nes]


    =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


  Proceedings

                     * BERG-KAISER N-POSITION PI DIVISION *

           As presented by Joe Minarick at his November presentation.


  Replace 'nnn' below with the number of places you wish to calculate Pi to.


        0 VARIABLE DIV

        : /. DUP DIV ! /MOD . 46 EMIT
           nnn 0 DO I 10 * DIV @ /MOD 9 OVER <
           IF 7 + THEN
           48 + EMIT LOOP DROP CR ;



        Example:

        355 113 /.
        3 .1415929203539823008849557522123893805
        3097345132743362831...


    =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


  Book Review

                         * Leo Brodie's THINKING FORTH *

                             by Norman E. Smith, CDP


  I am sure everyone has heard that Leo Brodie was finally writing a sequal  to
  STARTING  FORTH,  which  has the well justified reputation for being the best
  Forth tutorial available.  Brodie's new book is called  THINKING  FORTH.   As
  soon  as  I  saw the publication notices, I ordered a copy from Mountain View
  Press.  (MVP is the best source for Forth publications  available  !)  I  was
  expecting a lot from THINKING FORTH and was not disappointed !

  There was a comment at the last meeting that much of the detail  of  THINKING
  FORTH  will  probably  be mentioned in the upcoming (January) presentation on
  Forth coding style, so I will not get into too much detail  in  this  review.
  If this turns out not to be the case, a more detailed review will be included
  in a future newsletter.

  Brodie has a very light style of writing that prevents the  terminal  boredum
  associated  with  most  technical/text books.  As in STARTING FORTH, THINKING
  FORTH includes numerous cartoons that illustrate the points in the text.  The
  text  also  includes  useful Forth words in the later sections.  For example,
  DOER/MAKE  words  are  presented  to  illustrate  vectored  word   execution.
  Implementations  of DOER/MAKE are given in the appendix in FIG, F79, and F83.
  DOER/MAKE and several other useful words are worth  the  price  of  the  book
  alone !

  THINKING FORTH is divided into several major sections.  Systems analysis  and
  levels  of  design  are spread over several chapters.  These chapters contain
  very little Forth specific information.  The remaining two-thirds of the book
  is  very  specific  to  Forth  because  the  examples are all coded in Forth,
  although the ideas presented can  be  applied  to  just  about  any  computer
  language  with  little  effort.   Brodie  includes an overview of Forth as an
  appendix for those readers with little or no knowledge of Forth.

  The central theme of THINKING FORTH is that systems can be much  simpler  and
  much  more efficient by proper "factoring" of functions (words).  The simpler
  a word, the easier it is to test and re-use.  Brodie shows it is possible  to
  eliminate  much  control  structure  through  proper  factoring of functions.
  According to Brodie, factoring can take several forms.  First, words  can  be
  re-arranged  so  IF's  are  minimized.   Words  can use actual data values to
  control program flow, as can data tables.

  THINKING FORTH is an excellent book to give your boss who will  not  let  you
  use  Forth  for  an  application  because  it  is not a "real" language.  The
  non-Forth sections present many  good  suggestions  on  system  analysis  and
  design.   The  author establishes himself as a very credible systems designer
  by the time the reader gets into the Forth specific chapters.  The many Forth
  examples  in  THINKING  FORTH illustrate its power well enough to to convince
  even the most skeptical boss that Forth  is  a  worthy  language  for  "real"
  applications  programming.  THINKING FORTH is a great Forth book that makes a
  very comfortable companion to Brodie's other  book,  STARTING  FORTH.   If  I
  could have only two books on Forth, they would be the Brodie pair !  [nes]


    =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


  Software Review

               * LABORATORY MICROSYSTEMS Z-80 FORTH 3.0 for CP/M *

                              by Richard C. Secrist


            Editor's Note:  Since the publication of this issue  over
            a   year  ago,  LMI  has  updated  their  product  making
            extensive changes to the documentation which now puts  it
            into  the  superlative class...  as of 1/8/85 the current
            release was Version 3.10.


  < OVERVIEW >

  Laboratory Microsystems Inc.  (LMI) Z-80 FORTH version 3.0 is an  83-Standard
  Forth  development system optimized for the Z-80 uP that runs as a task under
  CP/M.  The disk and console interface make use of the host  operating  system
  and provide high level compatability with other LMI Forth implementations for
  various microprocessors.  Z-80 Forth uses standard CP/M  random  access  data
  files  for  screen storage, so its programs and data coexist on the disk with
  other applications and may be manipulated with standard system utilities.

  < UTILITIES >

  Z-80 Forth includes full screen and line editors, an  assembler,  decompiler,
  and extensive file I/O facilities.

  The full-screen editor uses Wordstar-like command sequences and is  adaptable
  to   sundry   video  terminals  through  the  video  attributes  installation
  procedure.  If you are either new to Forth or lazy the manual offers  you  an
  easy  way  out  of  configuring  Z-80 Forth to your terminal by hand.  Simply
  photocopy the cursor and attribute control section out of your terminal  book
  and  send  it  to them with your distribution diskette.  Then LMI will return
  your disk via express mail with your terminal listed as one of the choices on
  the installation menu.  This saves you the grief of having to do it yourself,
  and helps LMI out because their Forth now supports the XYZZY  type  terminal.
  This  also  configures  your  copy  of Forth to take advantage of the various
  video-support words made available in Z-80 Forth (e.g.   CLEARSCREEN,  BLINK,
  UNDERLINE).

  The assembler uses standard Zilog mnemonics in the traditional Forth  postfix
  style.   Other assorted utilities include a decompiler, notable benchmarks, a
  non-destructive stack print routine, and even memory dumps in  byte  or  word
  format.   Software  floating point and AMD 9511 chip support are available at
  extra cost.

  < EXTENSIVE FILE I/O SUPPORT >

  One of the most outstanding features of the LMI product is superior file  I/O
  support.  From within FORTH the programmer is given access to a very powerful
  complement of disk file and record  interface  routines.   The  routines  are
  sufficiently powerful to allow you to get yourself into a lot of trouble, and
  LMI sprinkles the documentation with  numerous  cautions  regarding  what  to
  watch out for.

  For openers, LMI includes a file access function word called FDOS that  gives
  you  direct  access  to 36 file operation primatives.  There are also another
  set of  extensions  that  "give  you  total  control"  for  record-level  I/O
  bypassing  the  FORTH  internal  disk  drivers  and virtual memory management
  features of the LMI FORTH altogether.

  LMI also supports binary overlays to link things like  the  editor  into  the
  dictionary as a one-shot.  This is described in the documentation.

  < COST-FREE TURNKEY APPLICATIONS >

  LMI provides several boot-up literals to  create  custom  pre-compiled  FORTH
  applications  using  this product.  No license fee is required as long as you
  seal-off the LMI F83 itself.  They would of course appreciate some credit and
  a phone call to make sure you sealed everything up correctly.

  < SIMPLE MULTI-TASKING >

  Z-80 FORTH includes simple multi-tasking support  for  up  to  10  background
  tasks.  LMI allocates CPU to these tasks on a round-robin basis.  In general,
  however, these tasks should not access the  disk  or  keyboard  and  must  of
  course leave the stack clean upon exit.

  < EXCELLENT DOCUMENTATION >

  The documentation is of excellent technical quality and content  -  something
  growing  rarer in these torrid days of user-friendly coloring books.  The LMI
  documentation has MEAT.  From the internals section describing the formats of
  the  dictionary  formats  of  things like colon and "CODE" definitions, right
  down to a real index, I am very pleased with the manual.

  Although I am not trying to scare away beginners, the documentation  and  the
  generous  extensions make this an excellent "hacker" FORTH.  I do not mean to
  suggest that the newcomer to FORTH is neglected in the LMI  manual,  however.
  In  fact,  the  manual  contains  an instructive and interesting "overview of
  FORTH" that is one of the most concise yet useful readings on  FORTH  I  have
  seen  anywhere.   It  does not make for light reading mind you, but ounce for
  ounce it may be some of the most useful text you may ever scan  in  terms  of
  putting the language as a whole into a nutshell.  The text would be extremely
  useful to the professional programmer who is just getting into FORTH.

  The documention also  includes  several  useful  appendicies  including:   1)
  "Coping  with the F83 Standard", 2) "Restrictions on an 83-standard program",
  3) "Checklist for Program  Conversion  to  Z-80  FORTH  3.0",  and  "Adapting
  STARTING FORTH to Z-80 FORTH 3.0".

  < USER SUPPORT >

  A word about support.  Once I called them for support and got handed off to a
  knowledgeable  analyst  promptly,  who  did  a  very  good job of fielding my
  questions.

  Another nice thing happened in my dealings with LMI  to  date:   I  purchased
  this product because I wanted a real FORTH for the Z80 and I noticed in their
  ad in FORTH DIMENSIONS a few months ago that it was still only $50.  Well,  I
  ordered it assuming (ass-u-me) that the ad price was right, and didn't verify
  this with the person who took my order (entirely my  stupidity).   Well,  the
  next  day my new issue of COMPUTER LANGUAGE came in the MAIL and the ad there
  pegged the LMI Z80 FORTH at $100.  Confused, I called LMI back  to  ask  them
  about it, and it turns out I did fubar it.

  LMI gave me a partial refund "to take some of the  sting  out  of  it".   Now
  THAT'S service !  Not to mention the fact that the product is quite worthy of
  it's $100 price tag.  Overall, I highly recommend the LMI  product  and  will
  consider  their version first when shopping for a FORTH for other processors.
  [rcs]


    =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


                                  * IN PRINT *


  "IN PRINT" cites recent references to FORTH articles and literature and lists
  copies   of  articles  made  available  by  the  membership  to  the  chapter
  publication library.  If you see anything that would be of  interest  to  our
  membership,  please  bring a copy of it to chapter librarian Norman Smith and
  the next meeting.  It will be automatically listed here.  [rcs]

      Submitted to the ET-FIG Library by Steven Wallace:

   o  "Plug-in  Module  Adds  Forth  Language  and  Assembler  to  a   Handheld
      Computer", Hewlett-Packard Journal, July 1984.

   o  "ORNL Forth System reference Manual, Including  ODDBALL",  ORNL  Computer
      Sciences, February 1983.  87 pages.  (ORNL document code ORNL/CSD/TM-174,
      see below.)

   o  "FORTH-83:  Evolution Continues" (pg.  137), BYTE magazine, August  1984.
      Submitted to the ET-FIG library by Steven Wallace.

      Cited by Norman Smith :

   o  Reviews:  PC/FORTH and polyFORTH (pg.  303); GO for MacFORTH, (pg.   180)
      BYTE magazine, November 1984.


  For people with access to the X-10 PDP-10 system, Steven  says  to  copy  the
  "DSKD:FORSYS.DAT  [200,20560]"  file  into  your  area  and execute the image
  "DSKD:FORTH [200,25150]".  If someone could VAXINE a tape of these files  for
  us  we will make them available on 9-track magtape to the club at large (talk
  to Richard Secrist).  [rcs]


    =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


                           * ET-FIG NEWSLETTER STAFF *

                         Editors: Richard C. Secrist, Norman E. Smith
                   Staff Writers: Norman E. Smith, Richard C. Secrist
                    Distribution: Joesph Minarick
                       Treasurer: Steven A. Wallace


    =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


  Public Domain

        * KFORTH, FORTH-BASIC INTERPRETER JOIN ET-FIG SOFTWARE LIBRARY *


  The East Tennessee-FIG public domain library has grown again,  with  more  to
  come  in the next few months.  Another version of 8080 Fig-Forth is available
  called KFORTH (purchased from Micro  Cornocopia).   The  source,  execuatable
  file,  and a 150 screen file make up the package.  It has several things that
  make it worth looking at.  First an excellent full screen editor is included.
  This  of  course  is set up for the Kaypro (ADM-3A) screen control sequences,
  but the words relating to screen control are localized in one  screen.   This
  should make it easy to port the editor to other Forths.  Another neat feature
  is it displays the current contents of the stack across the top of the screen
  at  all  times.  This makes it easy to see what is going on during debugging.
  Screens are kept in normal CP/M files, and the screen file is compatable with
  the  Laxen  &  Perry (L&P) F83 !  The implication is it should be possible to
  convert the KFORTH full screen editor and stack display to F83 without having
  to type in 25 or 30 screens of source.

  I plan to port the KFORTH editor and stack display to the PDP-11 Fig Forth we
  have.   This  will  be  a  major  upgrade to its capability.  Don't hold your
  breath though, it will be a couple of months at least before  that  is  done.
  We  are  also working on integrating it with the RSX file system.  The PDP-11
  Fig Forth that is available through this group will have most  of  the  tools
  necessary to be used in real applications development !  [nes]


    =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

                                 * E R R A T A *


  In the previous issue of the ET-FIG  Newsletter  (Volume  1,  Number  4)  the
  following  screen  was  ommitted  from the article "SAIC VAX/PDP-11 FIG-FORTH
  UPDATED" describing the new delete line (DL) function.  We apologize for  the
  oversight.

  SCR # 18
    0
    1 : DL   ( N --- )
    2     DUP 64 * ESCR @ BLOCK +
    3     64 BLANKS T STK ;


------------------------------------------------------------------------
Acknowledge-To: ... the FIGIL Digest <UMFORTH@WEIZMANN>