home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / PROG_GEN / FORTH_86.ZIP / WHY.UCC < prev   
Text File  |  1993-12-09  |  7KB  |  178 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.    4th_86 version 4.01              WHY.UCC                   page  1
  8.    
  9.    
  10.                  ( November 1993 - 4th_86 version 4.01 - MFB )
  11.  
  12.    Introduction
  13.    ============
  14.  
  15.           The **primary** objective of 4th_86 is to provide a version of
  16.    FORTH which is specifically designed to make the learning curve for
  17.    newcomers an easy -- and interesting one.
  18.  
  19.           There are many existing implementations of FORTH -- both
  20.    commercial and Shareware. While these are excellent in their way -- they
  21.    appear to be written solely from the viewpoint of compiling efficient
  22.    user code -- and not with any sympathy for the normal difficulties a
  23.    newcomer faces in learning FORTH -- much less the difficulties imparted
  24.    by the unfair reputation FORTH has for being "obscure" and
  25.    "unconventional".
  26.  
  27.           It is not claimed that 4th_86 is either "conventional" in FORTH
  28.    traditional terms -- nor that it is particularly efficient or fast as a
  29.    "code producing mill". It is however not *so* far removed from the
  30.    conventional FORTH approach as to make the transition for a learner
  31.    difficult. Indeed -- the whole objective is that the learner will be able
  32.    to "find his feet" here -- and should he then wish -- progress to the
  33.    Shareware world -- or to commercial versions.
  34.  
  35.           This translation and extension attempts to maintain the clarity of
  36.    the original UCC 4th -- and indeed extend it's appeal to newcomers by
  37.    replacing the conventional FORTH blank screen and  OK  prompt with an
  38.    interactive HELP tutorial.
  39.  
  40.           It is also believed to be quite capable of producing fully
  41.    functional code, and it is hoped that users will find it just as
  42.    "functional" in its own way as many of the other versions avaliabe.
  43.  
  44.    Cross Platform Portability
  45.    ==========================
  46.  
  47.            In line with the philosophy of FORTH -- much of 4th_86 was
  48.    written in 4th_86.  There has been no attempt at portability across
  49.    hardware platforms however, and to conserve speed a great deal has been
  50.    written in assembly language with a conventional 8086 assembler.
  51.  
  52.           As 4th_86 is heavily IBM-PC oriented in concept; conversion to
  53.    another platform would be largely meaningless. For this reason the
  54.    original FORTH concept of minimising the assembly content to a small
  55.    KERNEL of assembly in order to simplify cross-platform recompilation has
  56.    been abandoned. Inbuilt DOS and PC-BIOS routines have been heavily used
  57.    where it is felt they offer advantages.
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.    4th_86 version 4.01              WHY.UCC                   page  2
  65.    
  66.    
  67.    4th_86
  68.  
  69.           a) uses PC BIOS routines -- especially Int 10H for video output
  70.  
  71.           b) implements EGA and CGA graphics
  72.  
  73.           c) uses BIOS window-scrolling routines and GOTXY and GETXY
  74.  
  75.           d) uses DOS INT 21H file-handles and modes for acccessing disk
  76.               files
  77.  
  78.           e) uses the concept of shelling to DOS and executing conventional
  79.               DOS programs as child processes -- specifically DOS editors
  80.               and Assemblers.
  81.  
  82.           f) version 4.01 takes advantage of segment addressing to separate
  83.              dictionary; cross compile; code; and scratch areas into
  84.              separate 64K segments
  85.  
  86.           e) assumes that the user is capable of using a keyboard and normal
  87.              command line entry.
  88.  
  89.                 The tutorial shows that windows producing code is quite
  90.               easily implemented -- and at a later date some basic mouse-
  91.               access words will be issued as source code.
  92.  
  93.    History
  94.    =======
  95.  
  96.           UCC 4th was originally marketed by United Controls Corporation
  97.    in 1982, for 8-bit hardware. Originally written for in-house use, it
  98.    only marketed for a short time, and with limited advertising. For this
  99.    reason very few copies were sold, and despite its innovative excellence,
  100.    appears to be comparatively un-known even amongst Forth enthusiasts.
  101.  
  102.           This version 4.01 has both an in line and an external assembler
  103.    adhering to conventional MASM format and mnemonics. It also has separate
  104.    64K segments for dictionary; for cross compile code; and for direct input
  105.    code.
  106.  
  107.           There are several highly professional and extremely comprehensive
  108.    FORTH packages for the PC now -- as well as several excellent Public
  109.    Domain versions. Despite these, FORTH is widely ignored, and indeed is
  110.    often regarded with disdain by "conventional" programmers. So what
  111.    justification is there for resurrecting and faithfully maintaining the
  112.    flavour of an old 8-bit version?
  113.  
  114.         The purpose of this translation and major expansion of UCC Forth is
  115.    still to provide a teaching tool. It is a fully useable interpreter and
  116.    compiler -- but the whole structure of the documentation -- and the on-
  117.    line HELP tutorial -- is one of helping newcomers to UNDERSTAND Forth.
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.    4th_86 version 4.01              WHY.UCC                   page  3
  125.    
  126.    
  127.     4th_86 vs. "the others"
  128.    =======================
  129.  
  130.           Hopefully there is no "competition" as such. The spirit of FORTH
  131.    lives in all implementations, but mostly it is disguised in a world of
  132.    non-readable, non-printable 1024 byte screens; non standard disk I/O;
  133.    inbuilt oddities of editors; plus numerous "conversion" utilities to make
  134.    it reluctantly interact with the "real" world.
  135.  
  136.           Under the above aura of user-unfriendliness, the minor hurdles of
  137.    reverse polish notation and special character symbols ( both of which
  138.    are an essential part of the FORTH concept ) seem insurmountable, and
  139.    never receive from a novice the attention and understanding they merit.
  140.  
  141.  
  142.    4th_86 makes no attempt to adhere to "tradition" where simpler and more
  143.    comprehensible techniques seem beneficial. For example -- conventional
  144.    Forths have a flag called BASE which defines the number base.
  145.  
  146.         To input a number in decimal -- and print it in Hex would require
  147.  
  148.              10 BASE !  13  16 BASE !  .
  149.  
  150.           and the result displayed would be 000D Hex.
  151.  
  152.           In 4th_86 version 4.01 the variable BASE does not exist. [ It
  153.    used to exist in earlier versions - but was used in a different context -
  154.    - as an offset for the cross compiler ]. To input a number type it as you
  155.    would in MASM.   The above code would simply be
  156.  
  157.              13   .H
  158.  
  159.           .H prints in Hex just as . prints in decimal and .Q in octal and
  160.    .B in binary.
  161.  
  162.           23H puts 23 Hex on the stack.   23 puts 23 Decimal on the stack
  163.           23Q puts 23 Octal   etc.
  164.  
  165.       This means that you can easily mix bases
  166.  
  167.              23H 13 + .H  will display  0030 as the Hex value.
  168.  
  169.    Similarly data types such as BLOCK  CONST  DATA[ ... ] etc are not as in
  170.    more conventional models -- and the leading string delimiter is now just
  171.    that -- instead of a hybrid delimiter plus print word.
  172.  
  173.       conventional =>  ." this is a test "
  174.           4th_86   =>    " this is a test "  ."
  175.  
  176.    As a beginner, you need not worry about these variations. They are fully
  177.    detailed in the documentation however.
  178.