home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / forth / compiler / pygmy / pygmy.txt < prev    next >
Text File  |  1990-09-16  |  50KB  |  1,111 lines

  1.                      Pygmy Forth version 1.3 MANUAL   
  2.                  Copyright 1989, 1990 Frank C. Sergeant
  3.                                       809 W. San Antonio St.
  4.                                       San Marcos, TX  78666
  5.  
  6.         Pygmy Forth version 1.3 is a fast direct-threaded Forth for 
  7. reasonably compatible MS-DOS & PC-DOS machines.  It includes an editor, 
  8. assembler, and metacompiler (so it can recompile itself) in only 14K.  Up 
  9. to 15 files can be open simultaneously. It comes with full source code and 
  10. documentation.  It is based loosely on Charles Moore's cmFORTH.
  11.  
  12.     TABLE of CONTENTS
  13.  
  14.                   Chapter  1   Terms of use and distribution
  15.                   Chapter  2   Bonuses
  16.                   Chapter  3   Credit Where Credit is Due
  17.                   Chapter  4   "Why I Wrote Pygmy" 
  18.                   Chapter  5   What Is Pygmy?
  19.                   Chapter  6   How To Run The Program
  20.                   Chapter  7   If You Are New to Forth
  21.                   Chapter  8   What Was New With Version 1.2
  22.                   Chapter  9   What Is New With Version 1.3
  23.                   Chapter 10   Tips
  24.                   Chapter 11   How Files Work
  25.                   Chapter 12   The Assembler
  26.                   Chapter 13   The Editor
  27.                   Chapter 14   The Meta Compiler
  28.                   Chapter 15   Vocabularies
  29.                   Chapter 16   Additional Information
  30.                   Chapter 17   Addresses
  31.                   Chapter 18   The Glossary
  32.                   Chapter 19   Memory Map
  33.                   Chapter 20   Files
  34.                   Chapter 21   Direct Threaded
  35.                   Chapter 22   History & Philosophy
  36.                   Chapter 23   How to Print the Source Code
  37.  
  38.  
  39. Chapter 1           Terms of use and distribution
  40.  
  41.      I hold the copyright to all of the documentation and source code and 
  42. machine code included in the Pygmy Forth version 1.3 package, including the 
  43. organization and presentation thereof, with the exception of the parts 
  44. taken from public domain sources or contributed by others.
  45.  
  46.      Conditional upon recipients accepting full responsibility for any 
  47. adverse consequences or damages, I grant to recipients of this package
  48. permission to further distribute it, to post it on computer bulletin 
  49. boards, to use it for developing personal or commercial applications, and 
  50. to use parts of it in building other Forth systems.  I DO NOT GRANT 
  51. permission to distribute printed copies of the source code or the 
  52. documentation, or to publish the same in books, magazines, etc.  If you 
  53. wish to do something along these lines, please contact me.  (I am excluding 
  54. from this excerpted source code that you have incorporated into your own 
  55. Forth system, and nothing here is intended to prevent you from printing 
  56. out a hard copy of the source code and documentation for your own use.)
  57.  
  58.                      Is This Shareware or What?
  59.  
  60.      Well, yes and no.  You are welcome to use Pygmy.  If you do, you 
  61. assume all risk.  Don't use it on anything important until and unless you 
  62. have completely tested it.  If Pygmy is valuable to you, feel free to send 
  63. me some money.  A gift of any amount will be appreciated.  On the other 
  64. hand, my "assistants" in this endeavor (my bulletin board buddies as 
  65. mentioned below) certainly should not send money.  Please don't refrain 
  66. from writing, regardless.  That reminds me of the old joke of the kid away 
  67. at college who writes home "Dear Mom & Dad, please write often, even if 
  68. it's only $5.00."
  69.  
  70.  
  71. Chapter 2                       Bonuses
  72.  
  73.      There are some bonuses for anyone sending me at least two tens and a 
  74. five:
  75.  
  76.      1. Serial I/O routines with interrupt driven input.
  77.      2. Double (32-bit) and Quad (64-bit) number support.
  78.      3. Printed glossary, organized by categories, indexed to screen 
  79.         numbers.
  80.      4. Shadow file (PYGMY.DOW) commenting, screen by screen, on the 
  81.         meta-compiler and kernel source code.
  82.      5. Perhaps (don't count on this) 1 or 2 mini-applications to serve as 
  83.         a skeleton for your own work.
  84.  
  85.  
  86. Chapter 3               Credit Where Credit is Due
  87.  
  88.      Pygmy Forth was inspired by cmFORTH for the NOVIX, a public domain 
  89. Forth written by Charles Moore.  Much of the overall structure and some of 
  90. the specific high level code reflect this influence!  Some of the machine 
  91. code, especially flag producing words, is tighter due to ideas suggested by 
  92. Robert Berkey.  In addition, the code for DO LOOP (in the Starting Forth 
  93. compatibility section) was contributed by Robert.  Wil Baden provided OF 
  94. THENS.  The initial approach to handling files was suggested by Dennis 
  95. Ruffer by his description of files in Forth Inc's polyForth.  Rob Chapman 
  96. contributed the idea of (and how obvious when you think about it!) having 
  97. FOR NEXT do the loop <n> times instead of <n+1> times.  He also contributed 
  98. a slogan that I've adopted: "It's so simple - it HAS to work."  There may 
  99. be other such specific contributions that escape my mind at the moment.
  100.  
  101.      In general, I would also like to thank the many people who, through 
  102. the Forth bulletin board network, hounded, badgered, criticized, suggested, 
  103. questioned, and otherwise encouraged me to think.  They should be held 
  104. completely responsible for any remaining errors.
  105.  
  106. Chapter 4                   "Why I Wrote Pygmy" 
  107.  
  108.      Pygmy Forth's goals:
  109.           1. Faster, more comfortable editor.
  110.           2. Reduced sized and complexity.
  111.           3. Inclusion of certain cmFORTH ideas:
  112.              a. PUSH POP (instead of >R R>)
  113.              b. FOR NEXT
  114.              c. no IMMEDIATE word
  115.                 (but it does have words that are immediate)
  116.              d. simple Meta-Compilation
  117.  
  118.      Pygmy includes
  119.          1. a fast screen oriented block editor
  120.          2. an 8088/8086 assembler
  121.          3. full source code
  122.          4. full meta-compiler
  123.          5. up to 15 files open & accessible at one time
  124.          6. default set of files opened automatically
  125.          7. FOR/NEXT, PUSH, POP, \, COMPILER vocabulary, and
  126.             other cmFORTH improvements
  127.          8. Direct screen writes for speed for monochrome
  128.             & color
  129.          9. vectored I/O  ( EMIT, KEY, KEY?, CR )
  130.         10. documentation (this file)
  131.         11. *Starting Forth* compatibility hints for people new
  132.             to Forth
  133.  
  134. Chapter 5                    What Is Pygmy?
  135.  
  136.      Pygmy is one step on my path toward a "perfect" Forth.  It runs on the 
  137. IBM PC/XT/AT and compatibles. It is based (more and more loosely) on 
  138. Charles Moore's cmFORTH for the NOVIX Forth chip.  I have made many changes 
  139. to allow it to run on a PC, and other changes as well.
  140.  
  141.      cmFORTH was designed to run on a NOVIX connected by a serial line to a 
  142. host terminal or computer that supplies editing and file storage services. 
  143. Therefore, cmFORTH does not include an editor.  Also, no assembler is 
  144. needed because the NOVIX's assembly language is Forth (more or less).
  145.  
  146.      Pygmy Forth includes an editor & assembler and still only takes up 
  147. about 14K bytes.  The kernel (without editor and assembler) is less than 
  148. 8K.  It comes with complete source code, including a meta-compiler, so it 
  149. can recompile itself.  The meta-compiler can also be used for target 
  150. compiling custom applications.  In this case you can eliminate the parts 
  151. (such as the editor & assembler & various utilities) that the final 
  152. application will not need.
  153.  
  154.      Pygmy is direct threaded with top of stack kept in a register.  It has 
  155. (in my opinion) quite a comfortable screen oriented block editor. You can 
  156. move quickly from screen to screen with the PgDn & PgUp keys, search across 
  157. screens, insert blank screens, and compress out blank screens.
  158.  
  159.      Pygmy allows you to have 15 files open at one time.  These are all 
  160. accessible "simultaneously" at different block numbers (none of the 
  161. OPEN/FROM as used in F83).  Your default files are opened automatically and 
  162. the defaults can be changed, of course, and additional files can be opened. 
  163. .FILES shows you the defaults and the documentation shows examples of how 
  164. to reset them.  If you need more than 15 files open at one time, there is 
  165. supplemental code that shows how to have over 200 files open simultaneously 
  166. (untested).
  167.  
  168.  
  169. Chapter 6                  How To Run The Program
  170.  
  171.      Make a backup copy of the distribution disk.  If Pygmy is distributed 
  172. in a ZIP file, unzip it.  If you are going to run from a hard disk, set up 
  173. a directory and copy all of the files to that directory as in the following 
  174. example. 
  175.  
  176.            C:\>md pyg 
  177.            C:\>cd pyg 
  178.            C:\PYG\>copy a:*.*
  179.  
  180.     Then bring up Pygmy by typing
  181.            C:\PYG\>pygmy
  182.  
  183.      In previous versions, most of the documentation was in block files.  
  184. Version 1.3 contains only 3 files other than the program itself.  One is a 
  185. block file, PYGMY.SCR, which contains all the source code.  Another is a 
  186. regular text file, PYGMY.TXT (the file you are currently reading), which is 
  187. readable with TYPE or LIST or just about any text editor.  The last file is 
  188. YOURFILE.SCR and contains 8 blank blocks all ready for you to play with.
  189.  
  190.      If you are reading this, then you probably know everything you need to 
  191. know to read PYGMY.TXT.  To read the source code, bring up Pygmy and then 
  192. use Pygmy's editor to browse through the block file PYGMY.SCR.  To start at 
  193. the beginning, make sure Caps Lock is on, then type    
  194.  
  195.            0 EDIT    
  196.  
  197. (end all commands by pressing <Enter>).  Then just start browsing with the 
  198. PgDn & PgUp keys.  To get out of the editor press Esc.  To get back in 
  199. where you left off, type  
  200.  
  201.            ED
  202.  
  203.    To skip to a particular screen, press Esc to get out of the editor and 
  204. then type    n EDIT    where n is the screen you want to jump to. To see 
  205. what files have been opened automatically, get out of the editor and type   
  206.  
  207.            .FILES
  208.  
  209.  
  210.  
  211.                               CONFIG.SYS file
  212.  
  213.    If you get error messages when you try to open files, it probably means 
  214. that your CONFIG.SYS file is not allowing enough files.  Change or add a 
  215. "FILES=" statement to CONFIG.SYS so it says  FILES=20 then reboot and try 
  216. again.  (As shipped PYGMY.COM tries to open only 2 files automatically, so 
  217. this should rarely be a problem.)
  218.  
  219.  
  220.             If You Have Trouble Using Pygmy With Your Monitor
  221.  
  222.    Version 1.3 (as did version 1.2) of Pygmy automatically sets itself up 
  223. to match the monitor you are using.  This should work with any MS-DOS or 
  224. PC-DOS computer that uses video display memory at either $B0000 or $B8000
  225. (like normal IBM PCs and compatibles do).
  226.  
  227.  
  228. Chapter 7               If You Are New to Forth
  229.  
  230.      Could/should this manual teach you Forth?  I don't know.  Probably 
  231. only YOU can teach yourself Forth.  Maybe something can be done to make your 
  232. job easier.  I think the very best way for you to do it is to work your way 
  233. through the book Starting Forth by Leo Brodie.  It should be available from 
  234. the Forth Interest Group (see phone number below).  It's not ready as I 
  235. write this, but look for an upcoming book by Kent Peterson that will teach 
  236. you Forth with examples written specifically for Pygmy.
  237.  
  238.      I didn't design Pygmy to be a teaching Forth, but it does have some 
  239. advantages:  (1) it doesn't cost you a fortune (2) the entire source code 
  240. is included (3) it is small enough that you have a chance to grasp it - it 
  241. shouldn't be too intimidating (4) meta-compiling, using Pygmy, is the 
  242. easiest I have ever seen (5) I am available to answer questions via GEnie 
  243. and, thereby, a number of other bulletin boards (or even via the U.S. 
  244. Postal Service - in which case a SASE might facilitate assistance to 
  245. beginners).
  246.  
  247.      If you want to try it without a book, then read all of the 
  248. documentation and read the source code as well.  Try out simple examples.  
  249. Join FIG and read Forth Dimensions.  Then get a book, like you should have 
  250. done to begin with.  Then read everything again and try out more examples.  
  251. There is no substitute for doing your own experimenting. The word SEE may 
  252. help.  To examine the internals of a word or data structure, use DUMP or 
  253. DU.  Make heavy use of the glossary. The stack comments are most helpful, 
  254. showing what goes into a word and what comes out.
  255.  
  256.  
  257. Chapter 8             What Was New With Version 1.2
  258.  
  259.    Some bugs have been fixed.  Specifically,  <   &   >   did not work
  260. in all cases but should now be fixed.  Also,  /  was accidentally doing
  261. an unsigned divide because I had cleared register DX rather than sign
  262. extending register AX into it.  Now / does a signed division,
  263. truncating toward zero  ( eg    -3  2  /  returns  -1  ) rather than
  264. flooring.  I don't much care whether division is floored or truncated
  265. toward zero so I left it the way the 8088/8086 IDIV instruction does it.
  266.  
  267.    U/   has been added so there is still an unsigned divide available.
  268.  
  269.    The various MODs are still unsigned, but have been renamed to
  270. reflect that fact.
  271.  
  272.    The type of video display is determined automatically.
  273.   
  274.    BOOT is DEFER'd to make it easy to customize ( e.g. ' MYAPP IS BOOT ).
  275.  
  276.    Words that return flags are now smaller and faster - based on Robert 
  277. Berkey's code.
  278.  
  279.    LMOVE has been renamed MOVEL.  I have my doubts as to which is the
  280. better name.  It still takes a word count rather than a byte count.  I
  281. also have doubts about that and think a byte count would make more
  282. sense, but have not changed it yet.
  283.  
  284.    Fast DO LOOP are now available from Robert Berkey. (Ver. 1.3 note: ALL 
  285. source code is now in PYGMY.SCR.)
  286.  
  287.    TYPE ( a # -)  replaces the cmFORTH TYPE ( a - a').  I have also
  288. added  COUNT  and  -TRAILING to support it.  I like the cmFORTH TYPE (
  289. a - a') but the ending address was only used in one or two places so
  290. I've changed it to TYPE$ ( a -).
  291.  
  292.    NUMBER now understands hexadecimal literals such as  $8000   $FF and
  293. ascii character literals such as   'A   'B   'z.
  294.  
  295.    .S  has been changed so it shows exactly what is on the stack,
  296. rather than showing 3 values regardless of how many are present.  This
  297. is much prettier, although more expensive.
  298.  
  299.    The opening greeting also shows the default files that are open.  I
  300. found the first thing I always did was type   .FILES  so I built that
  301. into the default (BOOT word.
  302.  
  303.    "   has been added for in-line string literals.  At compile time it
  304. compiles the following text up to the ending quote mark as a counted
  305. string.  It then commas in a zero byte, which is not included in the
  306. count.  The purpose of this is to make it easy to setup "asciiz"
  307. strings for DOS.  E.g.  : TST  " this is a string "  TYPE$  ;
  308.  
  309.    -FIND and CREATE are now DEFER'd words to make experimenting with
  310. these easier.  See next paragraph.
  311.  
  312.    The file HASH.SCR (ver. 1.3 note: this code has been moved to PYGMY.SCR) 
  313. contains code to do very rapid dictionary searches.  This is not built into 
  314. Pygmy.  If you want to use it, you must load it.  Then hashing is optional  
  315. (  HASH-ON  HASH-OFF).  You can use it for development and then leave it 
  316. off in the final application.  It devotes the 64K segment above Pygmy's 
  317. segment to the hash table.  To find a word probably takes an average of 
  318. less than two compares.  Unfortunately this is not the only factor involved 
  319. in compiling speed.  My quick tests suggest that with HASH-ON the time it 
  320. takes to load an application is approximately 1/3rd less than with 
  321. HASH-OFF.  The larger the dictionary the more time will be saved.
  322.  
  323.  
  324. Chapter 9            What Is New With Version 1.3
  325.  
  326.      File handling has been overhauled.  Everything is now done relative to 
  327. the unit# of the file.  See UNIT, SETTLE, CHOP, OPEN, ?CLOSE, etc.
  328.  
  329.      ABORT is now a DEFER'd word, to make customizing applications easier.
  330.  
  331.      For Leonard Morgenstern, NUMBER & LITERAL are now DEFER'd.  (This also 
  332. makes adding the double and quad number extensions easier!)
  333.  
  334.      (ONEKEY  is the default for KEY.  It returns a single value no matter 
  335. what key is pressed, rather than a single value for some keys and two 
  336. values for other keys, as DOS does.  I MUCH prefer the consistency of a 
  337. single value.
  338.  
  339.      All the source code is now in a single (block) file.  All the 
  340. documentation is now in a single (text) file.
  341.  
  342.      Meta-compiling is even easier.
  343.  
  344.      WORD no longer does BLOCK every time (for faster loading).
  345.  
  346.      SEE now handles abort"  "  etc. and recognizes non colon words.
  347.  
  348.      FILES now keeps track of the highest block # in the file. Neither the 
  349. editor nor BLOCK will go outside actual file bounds anymore.
  350.  
  351.      HOLES added to editor (F9).  SETTLE & CHOP make managing block files 
  352. more convenient.
  353.  
  354.      Search across now always goes to end of file, no need to set the 
  355. ending screen number.
  356.  
  357.      THRU no longer uses the data stack, so multi-screen definitions which 
  358. pass arguments on the stack can now be loaded with THRU.
  359.  
  360.      Added N! ( n a - n) to store n into a, keeping a copy of n
  361.  
  362.      Changed FOR/NEXT so 0 FOR ... NEXT goes thru loop zero times &  
  363. u FOR ... NEXT goes thru loop  u times.  Robert Berkey suggests spelling it 
  364. ?FOR.
  365.  
  366.      ABORT" now includes the IF.
  367.  
  368.      Added +UNDER ( a b c - a+c b).
  369.  
  370.      Added NIP ( a b c - a c).
  371.  
  372.      Straightened out the redundant EXIT.  
  373.  
  374.  
  375. Chapter 10                        TIPS
  376.  
  377.      Set Caps Lock on.  Most words must be typed in UPPER CASE.
  378.  
  379.      To abandon changes you have just made in the editor, use Esc to get 
  380. out of the editor then type   EMPTY-BUFFERS
  381.  
  382.     ?SCROLL  is embedded in WORDS and DU  to let you halt the display
  383. by pressing any key (except Esc).  Press any key again to start it up
  384. again (except Esc).  To bail out, whether you are scrolling or paused,
  385. press Esc.  You can also put ?SCROLL into your own words.  For my tastes, 
  386. this is very much better than the common practice of aborting the display 
  387. when you press the <Enter> key.
  388.  
  389.     DUMP ( a - a')  and DU ( a # - a') allow you to inspect memory.
  390. DUMP dumps one line and leaves the address of the next line ready for
  391. typing DUMP once more.  DU repeats DUMP for a number of lines.  ?SCROLL
  392. is built in, so feel free to type  0  2000 DU  (you can get out of it
  393. with Esc, or pause with any key).  You'll probably want to say HEX first.
  394.  
  395.     .FILES ( -) shows the files that are currently open and the block 
  396. numbers associated with them.  You can open ANY type of file; you are not 
  397. limited to Forth style BLOCK files.
  398.  
  399.      The word ." works either inside or outside of colon definitions.  
  400. There is no need for the abomination  .(    
  401. (Actually there are two  ."s  one is in FORTH and the other is in 
  402. COMPILER.)
  403.  
  404.      Pygmy recognizes $xxxx as a hex number (e.g.  $2000 or $1FFE) and it 
  405. recognizes character literals as well (e.g.  'A  'B  'C  'z).  The hex 
  406. literals are a great convenience and allow us to stay in DECIMAL more of 
  407. the time.  The character literals allow us to avoid the ugly CHAR & [CHAR] 
  408. or ASCII & [ASCII].
  409.  
  410.      NOT in Pygmy inverts the truth value on the stack.  It is equivalent 
  411. to 0=.  If you want to invert each bit individually, use  -1 XOR
  412.  
  413.  
  414.  
  415. Chapter 11                    How Files Work
  416.  
  417.      There are some changes in version 1.3.  I'll discuss the philosophy 
  418. more in another place.
  419.  
  420.      Pygmy can access a number of files "simultaneously."  As shipped, it 
  421. contains 15 slots or units for files.  This can be changed to a smaller 
  422. number if you wish.  If you must access more (perhaps over 200 files), that 
  423. can be done also, and sample code is included in PYGMY.SCR.  Before you can 
  424. access a file, it must be installed into one of the slots.  This is done by 
  425. the word UNIT.  UNIT establishes the file's starting block number and the 
  426. file's name (as it is known to DOS).  This name can include the full path, 
  427. including drive, for those cases where the file is not in the default 
  428. directory.  The parameters for UNIT are starting-screen#, file-name, and 
  429. unit#.  The file-name is the address of a counted string that ends in a 
  430. zero byte (for the DOS "asciiz" format).  There are several ways to define 
  431. the name.  Most of the time I use the word NAMEZ: which defines a word 
  432. whose name is the string.  For example, 
  433.  
  434.              NAMEZ: YOURFILE.SCR
  435.  
  436. defines a Forth word YOURFILE.SCR that returns the address of the counted 
  437. string "YOURFILE.SCR" with the required zero-byte following the name.  Now 
  438. that we've defined the file name, we can install it into unit# 7 and 
  439. declare that its starting block number will be 3000 by typing
  440.  
  441.              3000 YOURFILE.SCR 7 UNIT
  442.  
  443. Note, that this does not open, create, check, or do anything with the 
  444. actual file.  Once a file name and starting block number are equated with a 
  445. particular unit#, everything else we want to do to that file is done by 
  446. referring to its unit#, in this case 7.
  447.  
  448.      To open the file, type
  449.  
  450.              7 OPEN
  451.  
  452.      To create a new file, type
  453.  
  454.              7 MAKE
  455.  
  456.      To close the file, type
  457.  
  458.              7 ?CLOSE
  459.  
  460.      Once you have set up the name and number with UNIT, you can open and 
  461. close the file repeatedly without using the word UNIT again.  If you want 
  462. to use that slot (unit) for a different file, just set up the new name and 
  463. number with UNIT, by typing, for example,
  464.  
  465.              NAMEZ: MYFILE
  466.              4000 MYFILE 7 UNIT
  467.              7 OPEN
  468.  
  469. The file that was previously in unit# 7 will be closed automatically before 
  470. the new file is opened.  The question mark on ?CLOSE indicates that it 
  471. closes the file if it is open, but doesn't blow up if the file is not open.
  472.  
  473.      As shipped, Pygmy version 1.3 has two files that are already installed 
  474. in units 0 & 1.  These are PYGMY.SCR, which contains all the source code, 
  475. and YOURFILE.SCR, which contains 8 blank screens.  These are automatically 
  476. opened for you and ready to go.  YOURFILE.SCR is provided so the new user 
  477. of Pygmy has a file ready to go for his own source code.
  478.  
  479.      Any time you want to see which files are installed in units, whether 
  480. they are open, or what their starting block numbers are, type
  481.  
  482.              .FILES
  483.  
  484.      You are not limited to these files!  Close them all down with 
  485. RESET-FILES if you like, and open your own set.  If you save that image of 
  486. PYGMY  (ie  SAVE TST1.COM), whenever you bring up that image (by typing 
  487. TST1 at the DOS prompt) your custom set of files will automatically be 
  488. opened for you (and the list of names and starting block numbers will be 
  489. displayed).
  490.  
  491.      When installing file names with UNIT, be sure to give each file a 
  492. different starting block number, so the block numbers do not overlap.  It's 
  493. probably neater to set them up with ascending numbers.  For example, unit 1 
  494. could start with block #0, unit 2 with #300, unit 3 with #600, etc. 
  495. However, that is not necessary in version 1.3.  All block numbers must be 
  496. lower than 8192.
  497.  
  498.      Each block in the entire system of open files has its unique number.  
  499. There is no need to use the F83 OPEN/FROM CONVEY.  There is no need for 
  500. OFFSET.  To copy a range of blocks, whether to and from the same or 
  501. different files, just say  ( from to #) COPIES   e.g.
  502.  
  503.              17   300  50  COPIES
  504.  
  505. to copy the 50 blocks starting at block 17 to the 50 blocks starting at 
  506. block 300.  It is an error if those blocks do not exist.  In earlier 
  507. versions of Pygmy you could extend a file just by accessing a block past 
  508. the end of file.  In version 1.3, the blocks must already exist.  To extend 
  509. a file, either use the word MORE or use F9 from within the editor.  It does 
  510. not work quite like the MORE of F83.  If the file is not empty, the easy 
  511. way to extend it is to get in the editor and move to the last block and use 
  512. the F9 key (which does MORE for you).  For copying a single block you can 
  513. still use COPY.
  514.  
  515.  
  516.  
  517.  
  518. Chapter 12                  The Assembler
  519.  
  520.      The 8088/8086 assembler in Pygmy is a regular Forth postfix assembler. 
  521. For examples of how it is used, browse through PYGMY.SCR.
  522.  
  523.      Begin a code word with CODE and end it with END-CODE, e.g.
  524.  
  525.          CODE DUP    BX PUSH,   NXT,   END-CODE
  526.  
  527.      Except in special cases (& then you know what you are doing) code 
  528. words must perform next somehow.  In Pygmy, this code is laid down in-line 
  529. (by the word  NXT,) rather than by a jump to a central next routine.
  530.  
  531.      If your routine disturbs CS, DS, BP, SP, SI, or BX it must restore it.  
  532. The direction flag must be left clear.
  533.  
  534.      BP points to the return stack.
  535.  
  536.      SP points to the data stack.  The top (data) stack item is kept in BX 
  537. rather than on the actual stack.  See example above for DUP.
  538.  
  539.      DS:SI is Forth's IP register.  AX is Forth's W register, but you may 
  540. use it freely without restoring it.
  541.  
  542.      The assembler words generally end in a comma, signaling they actively 
  543. comma data into the dictionary.  This is useful for another purpose: as the 
  544. assembler words and the regular Forth words all sit in the same vocabulary 
  545. (FORTH), the comma helps distinguish between similar words, e.g. THEN & 
  546. THEN,
  547.  
  548.  
  549.      It is a "structured" assembler with
  550.      
  551.     <set-codes> <condition> IF,   XXXXXX    ELSE,   XXXXXX   THEN,
  552. and 
  553.  
  554.      XX #, CX MOV, BEGIN,  XXXXX  LOOP,     
  555. etc.
  556.  
  557.      If it is not clear from the instruction whether the operand is a byte 
  558. or a word, a byte is assumed.  E.g.   0 [BX] PUSH, would push only a single 
  559. byte.  To override this, use W-PTR  e.g.
  560.  
  561.     0 [BX] W-PTR PUSH,
  562.  
  563.      For the shifts & rotates, if an immediate operand precedes it, it 
  564. shifts a single bit, e.g.  
  565.  
  566.    1 #, AX SHR,   ( shift AX one bit right)
  567. or even
  568.    300 #, AX SHR, ( shift AX one bit, not 300 bits, right)
  569.  
  570.      If you want it to shift based on the contents of CL, omit the 
  571. immediate operand, e.g.
  572.  
  573.     4 #, CX MOV,  AX SHR, 
  574.  
  575. examples to shift right 1 bit:
  576.  
  577.      1 #, SI SHR,  
  578.      1 #,  W-PTR  17 [BX] SHR,  
  579.      1 #, AL SHR,
  580.  
  581. examples to shift right the # of bits in CL
  582.  
  583.      SI SHR,
  584.      AL SHR,
  585.      1300 ) SHR, 
  586.      3752 W-PTR  ) SHR,
  587.  
  588. IN, & OUT,  (reading & writing I/O ports)
  589.  
  590. use  
  591.       port #, AL IN, 
  592. or
  593.       port #, AX IN, 
  594. for 8 bit ports
  595.  
  596. or 
  597.       AX IN,   if the port number is the DX register. 
  598.  
  599. Do not use    AL DX IN,  as the DX is implied.
  600.  
  601.  
  602. JMP, & CALL,
  603.  
  604.      Long JMPs & long CALLs are "not supported at this time."
  605.  
  606.      The instruction that does a bit by bit complement is called NOT by 
  607. Intel, but in THIS assembler it is called COM,.  This assembler uses NOT, 
  608. to invert the test at the beginning of an IF,   e.g.  
  609.  
  610.       CS, IF, ( do if carry set)      THEN,
  611. or  
  612.       CS, NOT, IF, ( do if carry not set)  THEN,
  613.  
  614.      The full source code for the assembler is present in the file 
  615. PYGMY.SCR.  Some examples are included along with the source code.  In 
  616. addition, you can browse the code for Pygmy's primitives for examples of 
  617. how to use the assembler.  The general rule is that the operand(s) come 
  618. first followed by the opcode mnemonic (which ends in a comma).  With two 
  619. operands, the source comes first and the destination second, like god meant 
  620. it to be.  BX AX MOV,  lays down a move instruction to copy the contents of 
  621. register BX into register AX.
  622.  
  623.  
  624. Chapter 13                   The Editor
  625.  
  626.                            Editor commands:
  627.  
  628.    To enter the editor, type  n EDIT.  To get out of the editor, press the 
  629. ESC key.  When you are in the editor you can make changes by using the 
  630. arrow keys to position the cursor and then just typing.  Press the INS key 
  631. to switch between the insert and the overwrite modes.  The backspace key 
  632. will delete characters to the left of the cursor and the Del key will 
  633. delete the character the cursor is on.  Inserts and deletes only occur on 
  634. the current line.
  635.  
  636.    The PgUp & PgDn keys are used to move to the previous or next screen.  
  637. This is delightfully fast compared to the editor in F83.  If the cursor is 
  638. at the beginning of the line already, Home moves to top of screen; 
  639. otherwise, Home moves to beginning of current line.  End moves past last 
  640. character on current line. 
  641.  
  642.      The very top line of the screen is a status line that shows the screen 
  643. number and the file name and a brief reminder of some of the function keys' 
  644. functions.  It also shows an "i" if in the insert mode.  It also shows a 
  645. count of the lines in the cut buffer.
  646.  
  647.    F1 repeats a search.
  648.  
  649.    F2 repeats a replace.
  650.  
  651.    F3 sets up a search string and then searches.
  652.  
  653.    F4 sets up a replace string and immediately replaces with it. ( To 
  654. repeatedly change CAT to DOG, use F3 to set up CAT ) ( & F4 to set up DOG 
  655. and then press  F1 F2 F1 F2 etc ). 
  656.  
  657.    F5 deletes the current line.
  658.  
  659.    F6 joins the line below to the current line at the cursor.
  660.  
  661.    F7 "cuts" the current line to the cut buffer.  This does not alter the 
  662. current line.  (See the "c= " on status line).
  663.  
  664.    F8 "pastes" the oldest line in the cut buffer to the current line on the 
  665. screen, overlaying the current line. The cut buffer is almost unlimited in 
  666. size.  It can be used to copy and move lines on the same screen or to 
  667. different screens (even screens in different files).  Notice that the count 
  668. of lines cut (on the status line) changes as you press F7 & F8.
  669.  
  670.    F9 inserts blank screens after the current screen.
  671.  
  672.    F10 does a search like F1, but across multiple screens.
  673.  
  674.    Esc exits from the editor.  If you want to cancel the most recent 
  675. changes, after pressing Esc, type  EMPTY-BUFFERS.  If you want your most 
  676. recent changes to be applied to the disk immediately, after pressing Esc, 
  677. type  FLUSH.
  678.  
  679.    CR  ends the current line, pushing anything to the right onto the 
  680. following line and pushing the lines below it down.
  681.  
  682.    Home  moves the cursor to the beginning of the current line.  If already 
  683. at the beginning, it moves the cursor to top left corner.
  684.  
  685.    End  moves the cursor just past the end of text on the current line 
  686. (which may be at the 1st position of the following line).
  687.  
  688.    Bksp  If not at the far left of a line, it deletes the character to the 
  689. left of the cursor.
  690.  
  691.    Del  deletes the character the cursor is on.
  692.  
  693.    Ins  toggles insert vs overwrite modes (see the "i" on status line).
  694.  
  695.      Note, the deletions and insertions only affect the current line.
  696.  
  697.  
  698.                                  Oooops
  699.  
  700.      How do you exit from the editor without making any changes? (cancel 
  701. your changes, that is)?  Press Esc key to get out of the editor and then 
  702. type 
  703.      
  704.        EMPTY-BUFFERS
  705.  
  706.      F9 is good for opening up a file in the middle or for extending a file 
  707. at the end.  As you move screens around and delete them from where they 
  708. used to be, you may accumulate a number of blank screens.  SETTLE (used 
  709. outside of the editor) is used to let the heavy screens sink to the bottom 
  710. and let the light screens float to the top.  It only affects the range of 
  711. screens that you specify, e.g.
  712.  
  713.        315  345  SETTLE
  714.  
  715. will re-arrange those screens so that any completely blank screens are at 
  716. the highest numbers and the non-blank screens are at the lowest numbers.  
  717. This compresses out blank screens.  A related word CHOP will truncate a 
  718. file by chopping off all trailing blank screens, e.g.
  719.  
  720.         3 CHOP  
  721.  
  722. will chop the blank screens off the end of the file whose unit# is 3.
  723.  
  724.  
  725. Chapter 14              The Meta Compiler
  726.  
  727.      Pygmy includes a meta-compiler.  It is easy to use.  To regenerate the 
  728. kernel of Pygmy, edit the source code in the file PYGMY.SCR to include your 
  729. changes.  Then type
  730.  
  731.                      1 LOAD
  732.  
  733.      This will create a new version of the Pygmy kernel and save it to 
  734. disk.  Be sure to edit the file name you want it saved as on scr #1.  Exit 
  735. to DOS with  
  736.  
  737.                      BYE
  738.  
  739. and bring up the new version you just created.  It is the kernel only, 
  740. without the editor or assembler or other extensions.  However, it will have 
  741. the file PYGMY.SCR already set up in unit# 0, and opened automatically.  To 
  742. extend it, just load the proper load screen.  This screen number is usually 
  743. noted on screen #1 to make it easy to find, e.g.
  744.  
  745.                      83 LOAD
  746.  
  747. Look at screen 83 to see how this works.  Note that this is simpler than in 
  748. previous (to version 1.3) versions.  Having all the source code in a single 
  749. file makes this easier.  Be sure to edit screen 83 (or whatever your load 
  750. screen is) so it will include just what you want and so it will save the 
  751. newly created Forth to the proper file name.     
  752.  
  753.      Meta-compiling Pygmy is very easy, so don't put off trying it.  It 
  754. lets you fix all the aspects of Pygmy that you disagree with me about! Your 
  755. first attempt should be to generate a version of Pygmy with no changes 
  756. whatsoever, except possibly the file name you save the new versions under. 
  757. Once you've done this once or twice you can begin changing the kernel, or 
  758. extending it differently.
  759.  
  760.      Here is how the meta-compiler works.  First the load screen (#1) loads 
  761. the meta-compiler (on screens 3 through 13).  This renames some of the 
  762. current Forth's words (so they can still be found) and then redefines the 
  763. defining words needed for the new Forth.  Note a number of variables such 
  764. as TLIT and TVAR etc.  These will hold the addresses of the target's 
  765. runtime routines (for LITERAL and VARIABLE etc.) as soon as those runtime 
  766. routines have been defined in the target.  The meta-compiler will use those 
  767. values to compile the proper code in the target.
  768.  
  769.      Then, starting at screen 17, the target's code begins.  The target is 
  770. compiled starting at address $8000.
  771.  
  772.      H' holds the target's dictionary pointer (H holds the host's). 
  773. Following H' is the relocation factor used for the target code.  The curly 
  774. braces switch between the target & host spaces, so that the regular host 
  775. facilities, such as , HERE -FIND etc can be used for both purposes.  The 
  776. host does need some special meta-compiler words.  When we are redefining a 
  777. host word that we might need the original of, the original is renamed, so 
  778. we will still have access to it under the synonym ( e.g.   : :' :  ;  ). 
  779. There are two ghost vocabularies used for the target.  After our 
  780. redefinitions, FORTH & COMPILER refer to the target and FORTH' & COMPILER' 
  781. refer to the host.  This is the secret that keeps everything straight.
  782.  
  783.      When interpreting, words are looked up and executed (as is normal) 
  784. from the FORTH' (host) vocabulary.  When compiling a colon definition, 
  785. COMPILER' (host) is searched first.  If found the word is executed 
  786. immediately.  If not found, FORTH (target) is searched.  If found, the word 
  787. is compiled into the new definition.  If not found, it is converted to a 
  788. number (or an error) and compiled as a literal into the new definition. So, 
  789. when meta-compiling, target COMPILER words are never executed, leaving the 
  790. host's free to operate.  When not compiling, target FORTH words are never 
  791. executed, leaving our regular host system free to operate.  \ is redefined 
  792. so when meta-compiling, the word is looked up in the target's COMPILER 
  793. vocabulary and compiled into the new definition.
  794.  
  795.    All of this means that you do not have to  "forget"  any of the target 
  796. words.  (There may one or two that need to be forget'd.  I can't remember 
  797. at the moment, ha ha.)
  798.  
  799.      So what changes might you make?  Changing the constant TMAX-FILES will 
  800. let you specify just how many files to allow open at the same time. 
  801. Changing TNB lets you change the number of file buffers that will be used. 
  802. Currently TNB is 1, which allows 2 buffers. Note that the number of buffers 
  803. must be a power of two (and greater than 1), so acceptable values for TNB 
  804. are 1, 3, 7, 15, etc.  (TNB and thus NB are set to 1 less than the number 
  805. of buffers.)  Suit yourself.  So far I haven't had any trouble using just 
  806. two.  You can eliminate the excess and useless words that I've included 
  807. which you see no need for.  (Just don't eliminate any that are used in the 
  808. definitions of other words that you do want to include!)
  809.  
  810.    For target applications, you can let the metacompiler do all of your 
  811. CODE (assembly language) words so that you do not need to include the 
  812. assembler in the final target application. (You might also eliminate the 
  813. editor from the final application if it isn't needed, but, since it is 
  814. loaded after the kernel has been created, that's not affected by the 
  815. meta-compiler.)
  816.  
  817.    Currently the meta-compiler does not allow headless code. If you want to 
  818. streamline the dictionary, you can unlink the auxiliary words that won't 
  819. need to be looked up in the final application by using HIDE (see its 
  820. definition in PYGMY.SCR).  The heads won't show with WORDS and they won't 
  821. be in the links to slow down the dictionary searches, but they'll still be 
  822. taking up space.
  823.  
  824.    If you change the boot code, you may need to change the patch on screen 
  825. 68 where the address of reset is patched into boot.
  826.  
  827.    If you are target compiling an application and want it to execute your 
  828. code automatically (rather than coming up in Forth) just point the word 
  829. BOOT at your application.  Suppose you have named it  YOUR-APPLICATION.  
  830. Type  
  831.  
  832.               ' YOUR-APPLICATION IS BOOT
  833.  
  834. and then save it to disk  with something like 
  835.    
  836.               SAVE YOUR.COM
  837.  
  838.    Note that BOOT can be re-vectored as above at anytime, not just when 
  839. meta-compiling.
  840.  
  841.    The source code in PYGMY.SCR is set up to choose between monochrome and 
  842. color displays automatically.  The word  'VIDEO supplies the two address 
  843. used by RESET to setup the system variables  CRTC  and  VID  to the correct 
  844. addresses for the monitor you are using.
  845.  
  846.      For a color monitor VID is set to $B800 and CRTC is set to $03D4 and 
  847. for a monochrome monitor, VID is set to $B000 and CRTC is set $03B4.
  848.  
  849.    Thus, a single version of Pygmy, should run on either color or 
  850. monochrome.  I think Pygmy will now work on all MSDOS & PCDOS systems that 
  851. have video display memory at either $B000 or at $B800.  If you have any 
  852. trouble with it on your system, please send me full details.
  853.  
  854.  
  855. Chapter 15                   VOCABULARIES
  856.  
  857.      PYGMY, like cmFORTH, has two vocabularies: FORTH & COMPILER.  Compiler 
  858. words are immediate by virtue of being in the COMPILER vocabulary. 
  859. INTERPRET only looks up words in FORTH.  When compiling, COMPILER is 
  860. searched first.  A word found in COMPILER is executed immediately otherwise 
  861. FORTH is searched and if the word is found it is compiled.  To force 
  862. compilation of a COMPILER word, precede it with a backslash ( \ ).  This is 
  863. used in place of the FORTH-83 word [COMPILE].  CONTEXT holds the number 
  864. that represents which of the two vocabularies is active.  Whichever it is, 
  865. that is the vocabulary into which new words will be linked.  FORTH & 
  866. COMPILER set CONTEXT to the appropriate number.
  867.  
  868.      There are also has 2 "spare" vocabularies available for use by the 
  869. meta-compiler.
  870.  
  871.  
  872. Chapter 16            ADDITIONAL INFORMATION
  873.  
  874.    For additional information, browse through all of PYGMY.SCR using the 
  875. editor ( n EDIT ) and the PgDn & PgUp keys.  Search across (F9 in the 
  876. editor, after setting up the search string with F3) is handy for finding a 
  877. particular word's definition or where it is used.  Use search across as a 
  878. substitute for VIEW, which is not available.
  879.  
  880.  
  881.  
  882. Chapter 17                   ADDRESSES
  883.  
  884.  
  885.      I'm glad to hear your comments.  I can be reached on GEnie as 
  886. F.SERGEANT or via the post office:
  887.                   Frank Sergeant 
  888.                   809 W. San Antonio St. 
  889.                   San Marcos, Texas  78666
  890.  
  891.  
  892. for info on signing up with GEnie dial 1-800-638-9636
  893.  
  894.  
  895. Join FIG, send $30 (in North America) to 
  896.    Forth Interest Group        (408) 277-0668
  897.    P.O. Box 8231
  898.    San Jose, CA  95155
  899. FIG is a great source for Forth related publications.
  900.  
  901. East Coast Forth Board bulletin board  (703) 442-8695
  902.  
  903. ACM SIGForth  
  904.     c/o ACM
  905.         Box 12115
  906.         Church Street Station
  907.         New York, NY  10249
  908.         (212) 869-7440
  909.      or
  910.         George Shaw (415) 276-5953
  911.         Dan Miller  (713) 363-3140
  912.  
  913.  
  914. Chapter 18                     The Glossary
  915.  
  916.      If you don't have the printed glossary, use the file PYGMY.SCR and the 
  917. editor's PgUp, PgDn, and F3 F9 search across screens to find the words you 
  918. want more info about.
  919.  
  920.  
  921. Chapter 19                     MEMORY MAP
  922.  
  923.      Pygmy fits in one 64K segment.  DOS loads it at offset $0100.  CS@ 
  924. will fetch the contents of CS (the code segment), in case you need to know 
  925. the absolute address of the program.  The dictionary grows up from low 
  926. memory. The stacks & TIB and disk buffers are in high memory (within the 
  927. one segment).
  928.  
  929. origin                $0100
  930. boot code             $0100
  931. 1st word (null)       $010B
  932. system variables      $0116 - $0147
  933. dictionary continues  $0148
  934. HERE                  $29C5  ( perhaps, if assembler is not loaded)
  935. TIB @                 $F300  ( TIB is $100 bytes below the 1st disk)
  936.                              ( buffer.  The last disk buffer is    )
  937.                              ( always at $F800                     )
  938. 1st disk buffer       $F400  
  939. 2nd disk buffer       $F800 
  940. data stack pointer    $FE00  ( grows down from FE00)
  941. return stack pointer  $FF00  ( grows down from FF00)
  942.  
  943.  
  944.      It also has 2 "spare" vocabularies available for use by the 
  945. meta-compiler.
  946.  
  947. Chapter 20                      FILES
  948.  
  949.      MAX-FILES may be open at once.  If you want a different mix, use 
  950. RESET-FILES and open a new set or re-setup the files one by one with UNIT. 
  951. If you then save an image of Pygmy, next time you bring it up, those files 
  952. will be opened for you automatically.
  953.  
  954.      To install a file, you must say what the starting block number should 
  955. be. I usually set them up in 300 block increments, but you may choose 
  956. whatever increment you wish.  It is no longer important that they be in 
  957. ascending order.  If the third file opened was handled this way   
  958.  
  959.           NAMEZ: DUMMY.BLK
  960.           600 DUMMY.BLK 2 UNIT
  961.           2 OPEN
  962.  
  963. then the beginning of the file would be screen 600.  Previous (to 1.3) 
  964. versions allowed you to alter the block numbers with which you accessed a 
  965. file by using the word UNIT which set OFFSET to some value.  In version 
  966. 1.3, there is no word OFFSET, and UNIT has an entirely different use!  Now 
  967. UNIT establishes which starting number and file name go with which "unit" 
  968. number.
  969.  
  970.  
  971. Chapter 21                  DIRECT THREADED
  972.  
  973.      Pygmy is direct threaded, with TOS kept in a register (BX) for speed.
  974.  
  975.      Constants are coded "in-line" rather than by jumping to a central 
  976. constant routine.  This costs 2 bytes per constant but saves 40 cycles (46 
  977. vs 86) on the 8088.  System variables are really coded as constants.  So 
  978. this method helps speed up the system.  Note that the system variable TIB 
  979. returns the address of the address of the terminal input buffer, as in 
  980. figForth.
  981.  
  982.      Variables don't seem to offer the same advantage and so they still use 
  983. a central routine.
  984.  
  985.      DEFER/IS deferred words are supported.  EMIT, KEY, KEY?, CR, BOOT, 
  986. ABORT, NUMBER, LITERAL, -FIND, and CREATE are deferred. 
  987.            ( e.g.  DEFER EMIT   ' (EMIT) IS EMIT    )
  988.  
  989.  
  990. Chapter 22               HISTORY & PHILOSOPHY
  991.  
  992.      Pygmy was based on cmFORTH by Charles Moore.  cmFORTH is designed for 
  993. the NOVIX Forth chip.  cmFORTH doesn't include an assembler as that's not 
  994. needed for the NOVIX.  Also, it doesn't include an editor, as it is 
  995. designed to be used with a host terminal or computer that supplies the disk 
  996. storage and editing facilities.  A Forth for the IBM PC/XT etc., can't do 
  997. without an assembler and editor, and so these have been included as part of 
  998. Pygmy.
  999.  
  1000.      The goal for Pygmy is not to copy cmFORTH exactly, but to use it as a 
  1001. starting point for a fast lean Forth that can be used for serious 
  1002. application development.
  1003.  
  1004.      I've added multiple files (up to 15, but you can change it to fewer if 
  1005. you like) open at the same time, and the default set are opened 
  1006. automatically.  This was inspired by Dennis Ruffer's notes on GEnie about 
  1007. Forth Inc's PolyForth.  If you want up to 200+ files open at once, see the 
  1008. supplemental code in PYGMY.SCR.
  1009.  
  1010.      The editor is fast and is so much more comfortable than the line 
  1011. editor in F83 that I'm satisfied for now.  Still, I don't feel I've 
  1012. completely solved the problem of managing source code.  The addition of 
  1013. "holes" SETTLE CHOP have helped.
  1014.  
  1015.      I want it small & fast, but I want it comfortable too.  I worry that 
  1016. it has grown too big.
  1017.  
  1018.      I have not added vocabularies. I like the cmFORTH idea of marking 
  1019. immediate words by the fact that they are in the COMPILER vocabulary!  
  1020. Everything else is in FORTH.  Is this a problem?  I don't think so, for me, 
  1021. but it makes for a crowded & busy WORDS listing and forces assembler words 
  1022. to end in commas.  
  1023.  
  1024.      The auxiliary words can be unlinked from the dictionary to speed up 
  1025. searches and to unclutter WORDS somewhat.  See HIDE in the supplemental 
  1026. definitions.  I don't, personally, use HIDE, but I've included it for you 
  1027. if want it.  
  1028.  
  1029.      DO/LOOP have not been included.  If you miss them too much, load them 
  1030. (Robert Berkey's version) from PYGMY.SCR screen #171.  I've been enjoying 
  1031. using FOR/NEXT and have not missed DO/LOOP.  I changed FOR/NEXT so it does 
  1032. the loop n times instead of n+1 times.  This was suggested and inspired by 
  1033. Rob Chapman.
  1034.  
  1035.      I no longer use cmFORTH's  TYPE ( a - a').  In cmFORTH it expects to 
  1036. find a count at the first byte of the address.  Instead I use a regular  
  1037. TYPE ( a # -).  In addition there is TYPE$ ( a -) which expects the address 
  1038. of a counted string.  It does COUNT TYPE and does not leave an address on 
  1039. the stack.
  1040.  
  1041.      There are 3 name changes in cmFORTH (& Pygmy) that delight me:  
  1042.  
  1043.              new names        old names
  1044.  
  1045.                   PUSH               >R
  1046.                    POP               R>
  1047.                      \        [COMPILE]
  1048.  
  1049. I think I always get >R & R> right, but it gives me hell every time I have 
  1050. to think about which is which. PUSH & POP are so much better names, in my 
  1051. opinion, and so much easier to read.  I don't see how you can try them and 
  1052. then go back to >R & R>.  I also prefer \ to [COMPILE].  I like comments in 
  1053. parentheses, so do not mind losing \ for that purpose.  Also it is shorter 
  1054. and clearer (I think) than [COMPILE] once you get used to it.
  1055.  
  1056.      The stack comment for cmFORTH's  M/MOD is ( l h u - q r) but I have 
  1057. implemented it as the more familiar ( l h u - r q).  
  1058.  
  1059.      Of course, there are extensive changes from cmFORTH because the 
  1060. primitives had to be coded in 8088/8086 machine language rather than NOVIX. 
  1061. I may have made other changes due to my failing to appreciate the beauty & 
  1062. simplicity of how CM did it.  I hope anyone noticing such denseness on my 
  1063. part will point it out to me.
  1064.  
  1065.      I am far from satisfied that I have found the "perfect" Forth in 
  1066. Pygmy.  Overall I am pleased.  There are many areas where Pygmy "works, but 
  1067. isn't pretty."  The compromise I like is where you give up something you 
  1068. don't want to get something you do want.  When I see one of those it is an 
  1069. easy decision.  The more common decision is where you give up something you 
  1070. do want for something you think you prefer but aren't quite sure, or where 
  1071. you give up something you really want for something you have to have.
  1072.  
  1073.      I think there is room for a number of different styles of Forth.  
  1074. Speed with lots of primitives in machine language versus ease of porting to 
  1075. other microprocessors by having a minimal number of primitives:  I (more or 
  1076. less) went for the speed.  I traded off some efficiency in disk access for 
  1077. a much more regular and comfortable file interface.  I've supplied the 
  1078. hooks for sequential file access (see FILE-READ FILE-WRITE >POSITION >EOF 
  1079. >BOF etc.) primarily for accessing data files in various formats, rather 
  1080. than for loading source code from text files.  Sometime I want to try for 
  1081. raw speed with "Forth owns the whole disk" but I haven't reconciled that 
  1082. with my need for co-existing with DOS, which I feel I have to do at this 
  1083. time.  I've left out VIEW and substituted a search-across-screens in the 
  1084. editor.  But, I've included a fairly complete SEE for colon definitions.  
  1085. The supplemental hashing dictionary search mechanism is something I use 
  1086. almost all the time (it can be thrown away for the target system).
  1087.  
  1088.  
  1089. Chapter 23           How to Print the Source Code
  1090.  
  1091.      SHOW prints source code screens 3 per page.  SHOW2 prints source code 
  1092. screens 6 per page (your printer must allow 132 character lines).  These 
  1093. words are now included in PYGMY.COM, so you don't have to load anything.  
  1094. If you are using SHOW2, you must set up the word CONDENSED so it will work 
  1095. with your printer.  See screens #83 and #150-155 for more info.  Once you 
  1096. have CONDENSED set correctly for your printer,  type
  1097.  
  1098.                 0  182  SHOW
  1099.  
  1100.   or
  1101.  
  1102.                 0  182  SHOW2
  1103.  
  1104. to print the entire contents of PYGMY.SCR.  If you are using an HP LaserJet 
  1105. II, IIP, or III, (or many other printers) you can set the characters per 
  1106. inch from the front panel (internal font #10 on a II, for example) and just 
  1107. set CONDENSED to a NOP  ( e.g.   ' NOP IS CONDENSED ).
  1108.  
  1109.        
  1110.                          **** The End ****
  1111.