Lots of typos fixed.
[rrq/jonesforth.git] / jonesforth.S
index 2d2b09a74a807bb8c7d39330b437339394b0bd5d..d110e6c910b315d7e5797b142992d26330a17b5f 100644 (file)
@@ -1,11 +1,11 @@
 /*     A sometimes minimal FORTH compiler and tutorial for Linux / i386 systems. -*- asm -*-
        By Richard W.M. Jones <rich@annexia.org> http://annexia.org/forth
        This is PUBLIC DOMAIN (see public domain release statement below).
-       $Id: jonesforth.S,v 1.18 2007-09-08 22:23:16 rich Exp $
+       $Id: jonesforth.S,v 1.20 2007-09-15 11:21:09 rich Exp $
 
        gcc -m32 -nostdlib -static -Wl,-Ttext,0 -o jonesforth jonesforth.S
 */
-       .set JONES_VERSION,18
+       .set JONES_VERSION,20
 /*
        INTRODUCTION ----------------------------------------------------------------------
 
@@ -65,6 +65,8 @@
 
        Here is another "Why FORTH?" essay: http://www.jwdt.com/~paysan/why-forth.html
 
+       Discussion and criticism of this FORTH here: http://lambda-the-ultimate.org/node/2452
+
        ACKNOWLEDGEMENTS ----------------------------------------------------------------------
 
        This code draws heavily on the design of LINA FORTH (http://home.hccnet.nl/a.w.m.van.der.horst/lina.html)
            |
          LATEST
 
-       You shoud be able to see from this how you might implement functions to find a word in
+       You should be able to see from this how you might implement functions to find a word in
        the dictionary (just walk along the dictionary entries starting at LATEST and matching
        the names until you either find a match or hit the NULL pointer at the end of the dictionary);
        and add a word to the dictionary (create a new definition, set its LINK to LATEST, and set
@@ -1481,7 +1483,7 @@ _TCFA:
        IMMEDIATE flag (F_IMMED in this code).  If a word in the dictionary is flagged as
        IMMEDIATE then the interpreter runs it immediately _even if it's in compile mode_.
 
-       I hope I don't need to explain that ; (SEMICOLON) just such a word, flagged as IMMEDIATE.
+       I hope I don't need to explain that ; (SEMICOLON) is just such a word, flagged as IMMEDIATE.
        And all it does is append the codeword for EXIT on to the current definition and switch
        back to immediate mode (set STATE back to 0).  Shortly we'll see the actual definition
        of ; and we'll see that it's really a very simple definition, declared IMMEDIATE.
@@ -1663,7 +1665,7 @@ _HIDDEN:
        BRANCH is an unconditional branch. 0BRANCH is a conditional branch (it only branches if the
        top of stack is zero).
 
-       The diagra below shows how BRANCH works in some imaginary compiled word.  When BRANCH executes,
+       The diagram below shows how BRANCH works in some imaginary compiled word.  When BRANCH executes,
        %esi starts by pointing to the offset field (compare to LIT above):
 
        +---------------------+-------+---- - - ---+------------+------------+---- - - - ----+------------+
@@ -1865,7 +1867,7 @@ interpret_is_lit:
        .data
        .align 4096
 buffer:
-       // Multi-line constant gives 'Warning: unterminated string; newline inserted' messages which you can ignore
+       // Multi-line constant gives 'Warning: unterminated string; newline inserted' messages which you can ignore.
        .ascii "\
 \\ Define some character constants
 : '\\n'   10 ;
@@ -2026,7 +2028,7 @@ buffer:
 \\ that the input buffer where the string comes from may be overwritten by the time we
 \\ come round to running the function).  We store the string in the compiled function
 \\ like this:
-\\   LITSTRING, string length, string rounded up to 4 bytes, EMITSTRING, ...
+\\   ..., LITSTRING, string length, string rounded up to 4 bytes, EMITSTRING, ...
 : .\" IMMEDIATE
        STATE @         \\ compiling?
        IF