Home » Archimedes archive » Zipped Apps » FORTH » !FORTH/dict

!FORTH/dict

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Archimedes archive » Zipped Apps » FORTH
Filename: !FORTH/dict
Read OK:
File size: 40B3 bytes
Load address: 0000
Exec address: 0000
File contents
   This file contains the dictionary entries called words of the FORTH
compiler / interpreter, it should be used to check the semantics and number
of stack entries of the words. A short example follows of the syntax used to
desribe them.

DUP  [ W32a -> W32a W32a ]  (special) this word is used to duplicate the top 32 bit word on the stack.

   The entry starts of with the word being defined, next in the square
brackets comes the stack usage. The values on the stack before the call of
DUP are shown to the left of the -> those left on the stack after the call
are shown on the right. Each stack element definition is made up of three
parts the first part is a letter showing the type of the stack element.
         A = address
         U = unsigned
         S = signed                                                               
         W = a word (address or unsigned or signed)
         B = a word which can only have two values (0=FALSE, -1=TRUE).
   The next part is a number showing the number of bits that the element
takes up.
   The final part is a letter which is used to distinguish between stack
elements i.e.

ROT [ W32a W32b W32c -> W32b W32c W32a] (main) this word is used to rotate
    the top three stack elements, the bottom one of these becomes the top.

   Next comes a name in brackets, this is the dictionary that the word is
contained in, currently there are three basic dictionaries defined:
      1. main - this is the dictionary which contains the words that are
interpreted from the prompt, as well as basic stack manipulation there arewords for I/O, dictionary manipulation, etc.
      2. compiler - this dictionary is only available when compiling a new word, it contains words for iteration, selection, etc.
      3. special - this dictionary contains the most used words from the main dictionary. The are compiled in a special way so that they run much faster than ordinary words. 
   Finally comes a description of the word its actions, semantics, and usual uses.



:      [ -> ] (main) this word starts the compilation process, the next string starting after the intervening space and ending
at the next space after that is the name of the word compiled. (e.g. : 2DUP DUP DUP ;    compiles the word 2DUP, a semicolon ends
the compilation. 

.      [ W32a -> ] (main) this word prints the TOS to the currently selected output (e.g. the screen).

,      [ W32a -> ] (main) this word writes the top stack entry into the code. It is used during the compilation process, see the example program Outer.

>      [ S32a S32b -> B32c ] (main) (special) if S32a > S32b then write -1 into the TOS else write 0 to TOS. (-1 = TRUE, 0=FALSE).

<      [ S32a S32b -> B32c ] (main) (special) if S32a < S32b then write -1 into the TOS else write 0 to TOS. (-1 = TRUE, 0=FALSE).

=      [ W32a W32b -> B32c ] (main) (special) if W32a = W32b then write -1 into the TOS else write 0 to TOS. (-1 = TRUE, 0=FALSE).

-      [ S32a S32b -> S32c ] (main) (special) subtract the top stack entry from the one below it on the stack.

+      [ S32a S32b -> S32c ] (main) (special) add the top two stack entries together

*      [ S32a S32b -> S32c ] (main) multiply the top two stack entries together.

/      [ S32a S32b -> S32c ] (main) divide the second entry on the stack by the top stack entry.

@      [ A32a -> W32a ] (main) (special) the top stack entry is treated as an address, the word at this address is loaded into the top stack entry.

!      [ W32a A32a -> ] (main) (special) the top stack entry is treated as an address and the second entry on the address is stored at this address, both entries are poped.

C@     [ A32a -> W8a ] (special) the top stack entry is treated as an address, the byte at this address is loaded into the top stack entry.

C!     [ W8a A32a -> ] (main) (special) the top stack entry is treated as an address and the second entry on the address is stored as a byte at this address, both entries are poped.

*/     [ S32a S32b S32c -> S32d ] (main) (special) S32d := (S32a * S32b) / S32c. This is written so that the multiplication produces at 64 bit product that is then divided by S32c to produce the 32 bit result.

DUP    [ W32a -> W32a W32a ]  (main) (special) this word is used to duplicate the top 32 bit word on the stack.

ROT    [ W32a W32b W32c -> W32b W32c W32a] (main) this word is used to rotate the top three stack elements, the bottom one of these becomes the top.

0=     [ W32a -> B32b ] (main) if the TOS is zero the B32b=-1 (TRUE) else B32b=0 (FALSE).

0<     [ S32a -> B32b ] (main) if the TOS is less than zero the B32b=-1 (TRUE) else B32b=0 (FALSE).

1-     [ S32a -> S32b ] (main) (special) S32b := S32a-1.

1+     [ S32a -> S32b ] (main) (special) S32b := S32a+1.

2-     [ S32a -> S32b ] (main) (special) S32b := S32a-2.

2+     [ S32a -> S32b ] (main) (special) S32b := S32a+2.

2*     [ S32a -> S32b ] (main) S32b := S32a << 1.

2/     [ S32a -> S32b ] (main) S32b := S32a >> 1.

4-     [ S32a -> S32b ] (main) (special) S32b := S32a-4.

4+     [ S32a -> S32b ] (main) (special) S32b := S32a+4.

4*     [ S32a -> S32b ] (main) S32b := S32a << 2.

4/     [ S32a -> S32b ] (main) S32b := S32a >> 2.

<R     [ W32a -> ]  (main) pops the top word off the stack and puts it onto the processor stack.

R>     [ -> W32a ]  (main) pops the top word off the processor stack and puts it onto the stack.

+!     [ W32a A32b -> ] (main) pops two stack entries and adds the word in the second entry to the word whose address is the top entry.

uD*    [ W32a W32b -> W64c ] (main) multiplies the top two 32 bit unsigned entries on the stack and places the 64 bit result back on the stack (high word is at the TOS).

uD/    [ W64a W32b -> W32c ] (main) divides the 64 bit unsigned entry by the TOS and places the result on the stack.

D*     [ W32a W32b -> W64c ] (main) multiplies the top two 32 bit signed entries on the stack and places the 64 bit result back on the stack (high word is at the TOS).

D/     [ W64a W32b -> W32c ] (main) divides the 64 bit signed entry by the TOS and places the result on the stack.

?SP    [ -> A32a ] (main) pushes the current stack pointer (before the execution of ?SP) onto the stack.

+SP    [ W32a -> W32b ] (main) Add the current stack pointer to the number on top of the stack.

0SET   [ A32a -> ] (main) set the 32 bit word whose address is the top stack entry to 0.

1SET   [ A32a -> ] (main) set the 32 bit word whose address is the top stack entry to 1.

C0SET  [ A32a -> ] (main) set the byte whose address is the top stack entry to 0.

C1SET  [ A32a -> ] (main) set the byte whose address is the top stack entry to 1.

C+!    [ W8a A32b -> ] (main) pops two stack entries and adds the least significant byte in the second entry to the byte whose address is the top entry.

ABS    [ S32a -> W32b ] (main) makes the TOS positive, by negating is top bit set (i.e. negative) before call of ABS.

REM   

RANDOM

AND    [ W32a W32b -> W32c ] (main) does a bitwise logical AND on the top two stack entries and pushes the result.

CLEAR

CRET   [ -> ] (main) write a carriage-return line-feed to the current output streams.

DROP   [ W32a -> ] (special) (main) remove the top stack entry without doing any processing on it.

ECHO   [ W8a -> ] (main) pops the top stack entry and write the low-order byte to all the current output streams.

MAX    [ S32a S32b -> S32c ] (main) pops the top two stack entries, compares them and then pushes the higher value back onto the stack. IF S32a > S32b THEN S32c := S32a ELSE S32c := S32b ENDIF.

MIN    [ S32a S32b -> S32c ] (main) pops the top two stack entries, compares them and then pushes the loweer value back onto the stack. IF S32a < S32b THEN S32c := S32a ELSE S32c := S32b ENDIF.

NOT    [ W32a -> W32b ] (main) does a bitwise NOT on the top stack entry.

OR     [ W32a W32b -> W32c ] (main) does a bitwise logical OR on the top two stack entries and pushes the result.

.R     [ S32a W32b -> ] (main) Displays the second stack entry as a number on all the current output streams in a field width determined by the top stack entry. The number is right justified within the field and followed by a space. The field width is the the minimum field width and so a number which takes more digits to display then are allowed for it can overflow.

.H

ASPACE [ -> W32a ] (main) pushes the ASCII (32 decimal) space character onto the stack.

TYPE   [ A32a -> ] (main) uses the top word on the stack as a pointer to a string (sequence of bytes followed by a 0 byte terminator). It prints this string out to the current output streams.

WAIT   [ -> ] (main) if any key has been pressed then enter a loop waiting for the next key to be pressed.

KEY    [ -> W9a ] (main) wait for a key to be pressed and the push the lowest 9 bits onto the stack.

INKEY  [ W32a -> W9b ] (main) wait for a key to be pressed for the number of centiseconds given by W32a and the push the lowest 9 bits onto the stack.

TAB    [ W32a W32b -> ] (main) move to character position X=W32a, Y=W32b where (0,0) is the top left corner of the screen.

SPACE  [ -> ] (main) write a space character the the current output streams. Equivalent of : SPACE 32 ECHO ;

XOR    [ W32a W32b -> W32c ] (main) does a bitwise logical XOR (or EOR if you prefer) on the top two stack entries and pushes the result.

ABORT  [ -> ] (main) aborts the current operation and resets the FORTH system. Reinitialises output stream, stacks, compiler variables,but leaves the dictionaries alone.

2OVER  [ W32a W32b W32c -> W32a W32b W32c W32a ] (main) duplicates the third stack entry onto the TOS.

OVER   [ W32a W32b -> W32a W32b W32a ] (special) (main) duplicates the second stack entry onto the TOS.

2SWAP  [ W32a W32b W32c -> W32c W32b W32a ] (main) interchanges the third stack entry and the TOS.

SWAP   [ W32a W32b -> W32b W32a ] (special) (main) interchanges the second stack entry and the TOS.

LROT   [ W32a W32b W32c -> W32c W32a W32b ] (main) rotate the top three stack entries (e.g. 1 2 3 ROT  gives 2 1 3).

RROT   [ W32a W32b W32c -> W32b W32c W32a ] (main) rotate the top three stack entries (e.g. 1 2 3 ROT  gives 1 3 2).

DUP    [ W32a -> W32a W32a ] (special) (main) duplicates the TOS, creating two words the with the same value.

2DUP   [ W32a -> W32a W32a W32a ] (main) duplicates the TOS twice, creating three words the with the same value.

TRUE   [ -> W32a ] (main) pushes a TRUE value onto the stack, equivalent to : TRUE -1 ;

FALSE  [ -> W32a ] (main) pushes a FALSE value onto the stack, equivalent to : FALSE -1 ;

STATE  [ -> A32a ] (main) pushes the address of the STATE variable onto the stack. The STATE variable is used to indicate wether a word should be compiled or executed. All the main vocabulary words should be executed in interpret mode, but only those in the compiler dictionary in compile mode. In compile mode those words not in the compiler dictionary should be compiled into the word currently being defined.

BASE   [ -> A32a ] (main) places the address of the number base onto the stack, currently the only number base which should be used is decimal.

MODE   [ -> B32a ] (main) if the FORTH system is interpretive mode then put 0 (FALSE) onto the stack otherwise it is in compile mode and so it places -1 (FALSE) onto the stack.

ENTRY  [ A32a -> ] (main) 

LINE_BUFFER  [ -> A32a ] (main) places the address of the pointer to the current input line on the stack.

TOKEN_BUFFER [ -> A32a ] (main) places the address of the pointer to the currently decoded token.

CODE   [ -> A32a ] (main) places the address of the code pointer onto the TOS. The code pointer points to the place where the next byte (word) of code will be compiled to.

CORE   [ -> ] (main) set the dictionaries back to the default dictionaries, i.e forgets all user defined words.

CONTEXT  [ -> A32a ] (main) pushes the address of the address of the dictionary to search initially for word definitions.

CURRENT  [ -> A32a ] (main) pushes the address of the current user dictionary onto the stack.

COMPILER [ -> A32a ] (main) pushes the address of the compiler dictionary onto the stack.

SPECIAL  [ -> A32a ] (main) pushes the address of the special dictionary onto the stack.

SEARCH   [ A32a -> A32b TRUE   or  FALSE ] (main) seaches the dictionary from address A32a looking for the token which is in the TOKEN_BUFFER. IF the token is found the place the execute address of the token onto the stack and then place a -1 (TRUE) onto the
stack. If the token is not found just put a 0 (FALSE) onto the stack.

QUESTION     [ -> A32a ] (main) places the address of the string "<cr> ? " onto the stack.

EXECUTE      [ A32a -> ] (main) executes the code at address A32a, which could of cause change the stack.

INLINE       [ -> ] (main) reads a line (up to 255 characters) into the buffer pointed to by the LINE_BUFFER variable from the currently selected input steam. Always ends the line with a 0 Byte so that TYPE works.

NUMBER       [ -> W32a TRUE  or FALSE ] (main) if the token in the TOKEN_BUFFER is a valid number in the current number base (must be decimal for now), then place that number on the stack and put a true on top, otherwise put a false on the stack.

*STACK       [ -> ] (main) checks the stack for overflow / underflow, but now implemented at the moment.

SETUP_STACK  [ -> ]  (main) used in the outer interpreter/compiler to create the code so that the TOS would be in R0 and the data_SP pointer would point to the NOS.

CREATE_BL    [ A32a -> W32b ] (main) used in the outer interpreter/compiler to create the BL instruction to call the code at address A32a. This assumes that the code put at the address CODE (see above).

TOP_REG      [ -> W32a ] (main) used in the outer interpreter/compiler. TOP_REG contains a value from 0 to 5, 0 means that the TOS is at the address data_SP, 1 means that it is contained in R0,  .. 5 means that it is contained in R4, with NOS in R3, etc.

COMPILECONST [ W32a -> ] (main) this is used to compile a constant into the code. 

CONSTANT     [ W32a -> ] (main) defines a constant which has the value W32a, i.e. '32 CONSTANT space'  defines a new word space which has the value 32. When space is executed it places the value 32 onto the stack.

CCONSTANT    [ W8a -> ] (main) defines a byte (or character) constant which has the value W32a, i.e. '32 CCONSTANT space'  defines a new word space which has the value 32. When space is executed it places the value 32 onto the stack.

VARIABLE     [ W32a -> ] (main) defines a variable which has the initial value W32a, i.e. '32 VARIABLE space'  defines a new word space which has the value 32. When space is executed it places an address on the stack which points to a word which contains 32 (initially).

CVARIABLE    [ W8a -> ] (main) defines a byte (or character) variable which has the initial value W32a, i.e. '32 CVARIABLE space'  defines a new word space which has the value 32. When space is executed it places an address on the stack which points to a word which contains 32 (initially).

VARS         [ -> A32a ] (main) pushes the address that the next variable will be placed at.

I>   [ -> W32a ] (main) (special) TOS := innermost loop index.                 

J>   [ -> W32a ] (main) (special) TOS := 2nd innermost loop index.

K>   [ -> W32a ] (main) (special) TOS := 3rd innermost loop index.

TIME [ -> W32a] (main) the value of the number of centi-seconds that have elapsed since the last time the clock was set to zero.

ARRAY [ W32a -> ] (main) a defining word used to create an array W32a words long (e.g. 15 ARRAY ThisArray  which would create an array 15 words =60 bytes long). 

CARRAY [ W32a -> ] (main) a defining word used to create an array W32a bytes long (e.g. 15 ARRAY ThatArray  which would create an array 15 bytes long). 

PRINT_DICT [ W32a -> ] (main) this word is used to print a dictionary to the currently selected output steam.

DICTIONARIES (main) this word prints all the words defined in the CURRENT, COMPILER and SPECIAL dictionaries, using PRINT_DICT above.

TOKEN [ -> B32a ] (main) this word is used to find the next token in the INPUT_BUFFER. It puts it into TOKEN_BUFFER the token in TOKEN_BUFFER ends with a zero byte. If an end of line character (i.e. 0 or 10 or 13) is found before the next printable character a 0 (FALSE) is pushed onto the stack, otherwise a -1 (TRUE) is pusehed onto the stack.


 ------------------------- COMPILER DICTIONARY

;

BEGIN

END

DO

LOOP

+LOOP

IF

ELSE

ENDIF

WHILE


----------------------------- SPECIAL DICTIONARY

."

[I]

[J]

[I]@

[I]!

[J]@

[J]!

00000000  20 20 20 54 68 69 73 20  66 69 6c 65 20 63 6f 6e  |   This file con|
00000010  74 61 69 6e 73 20 74 68  65 20 64 69 63 74 69 6f  |tains the dictio|
00000020  6e 61 72 79 20 65 6e 74  72 69 65 73 20 63 61 6c  |nary entries cal|
00000030  6c 65 64 20 77 6f 72 64  73 20 6f 66 20 74 68 65  |led words of the|
00000040  20 46 4f 52 54 48 0a 63  6f 6d 70 69 6c 65 72 20  | FORTH.compiler |
00000050  2f 20 69 6e 74 65 72 70  72 65 74 65 72 2c 20 69  |/ interpreter, i|
00000060  74 20 73 68 6f 75 6c 64  20 62 65 20 75 73 65 64  |t should be used|
00000070  20 74 6f 20 63 68 65 63  6b 20 74 68 65 20 73 65  | to check the se|
00000080  6d 61 6e 74 69 63 73 20  61 6e 64 20 6e 75 6d 62  |mantics and numb|
00000090  65 72 0a 6f 66 20 73 74  61 63 6b 20 65 6e 74 72  |er.of stack entr|
000000a0  69 65 73 20 6f 66 20 74  68 65 20 77 6f 72 64 73  |ies of the words|
000000b0  2e 20 41 20 73 68 6f 72  74 20 65 78 61 6d 70 6c  |. A short exampl|
000000c0  65 20 66 6f 6c 6c 6f 77  73 20 6f 66 20 74 68 65  |e follows of the|
000000d0  20 73 79 6e 74 61 78 20  75 73 65 64 20 74 6f 0a  | syntax used to.|
000000e0  64 65 73 72 69 62 65 20  74 68 65 6d 2e 0a 0a 44  |desribe them...D|
000000f0  55 50 20 20 5b 20 57 33  32 61 20 2d 3e 20 57 33  |UP  [ W32a -> W3|
00000100  32 61 20 57 33 32 61 20  5d 20 20 28 73 70 65 63  |2a W32a ]  (spec|
00000110  69 61 6c 29 20 74 68 69  73 20 77 6f 72 64 20 69  |ial) this word i|
00000120  73 20 75 73 65 64 20 74  6f 20 64 75 70 6c 69 63  |s used to duplic|
00000130  61 74 65 20 74 68 65 20  74 6f 70 20 33 32 20 62  |ate the top 32 b|
00000140  69 74 20 77 6f 72 64 20  6f 6e 20 74 68 65 20 73  |it word on the s|
00000150  74 61 63 6b 2e 0a 0a 20  20 20 54 68 65 20 65 6e  |tack...   The en|
00000160  74 72 79 20 73 74 61 72  74 73 20 6f 66 20 77 69  |try starts of wi|
00000170  74 68 20 74 68 65 20 77  6f 72 64 20 62 65 69 6e  |th the word bein|
00000180  67 20 64 65 66 69 6e 65  64 2c 20 6e 65 78 74 20  |g defined, next |
00000190  69 6e 20 74 68 65 20 73  71 75 61 72 65 0a 62 72  |in the square.br|
000001a0  61 63 6b 65 74 73 20 63  6f 6d 65 73 20 74 68 65  |ackets comes the|
000001b0  20 73 74 61 63 6b 20 75  73 61 67 65 2e 20 54 68  | stack usage. Th|
000001c0  65 20 76 61 6c 75 65 73  20 6f 6e 20 74 68 65 20  |e values on the |
000001d0  73 74 61 63 6b 20 62 65  66 6f 72 65 20 74 68 65  |stack before the|
000001e0  20 63 61 6c 6c 20 6f 66  0a 44 55 50 20 61 72 65  | call of.DUP are|
000001f0  20 73 68 6f 77 6e 20 74  6f 20 74 68 65 20 6c 65  | shown to the le|
00000200  66 74 20 6f 66 20 74 68  65 20 2d 3e 20 74 68 6f  |ft of the -> tho|
00000210  73 65 20 6c 65 66 74 20  6f 6e 20 74 68 65 20 73  |se left on the s|
00000220  74 61 63 6b 20 61 66 74  65 72 20 74 68 65 20 63  |tack after the c|
00000230  61 6c 6c 0a 61 72 65 20  73 68 6f 77 6e 20 6f 6e  |all.are shown on|
00000240  20 74 68 65 20 72 69 67  68 74 2e 20 45 61 63 68  | the right. Each|
00000250  20 73 74 61 63 6b 20 65  6c 65 6d 65 6e 74 20 64  | stack element d|
00000260  65 66 69 6e 69 74 69 6f  6e 20 69 73 20 6d 61 64  |efinition is mad|
00000270  65 20 75 70 20 6f 66 20  74 68 72 65 65 0a 70 61  |e up of three.pa|
00000280  72 74 73 20 74 68 65 20  66 69 72 73 74 20 70 61  |rts the first pa|
00000290  72 74 20 69 73 20 61 20  6c 65 74 74 65 72 20 73  |rt is a letter s|
000002a0  68 6f 77 69 6e 67 20 74  68 65 20 74 79 70 65 20  |howing the type |
000002b0  6f 66 20 74 68 65 20 73  74 61 63 6b 20 65 6c 65  |of the stack ele|
000002c0  6d 65 6e 74 2e 0a 20 20  20 20 20 20 20 20 20 41  |ment..         A|
000002d0  20 3d 20 61 64 64 72 65  73 73 0a 20 20 20 20 20  | = address.     |
000002e0  20 20 20 20 55 20 3d 20  75 6e 73 69 67 6e 65 64  |    U = unsigned|
000002f0  0a 20 20 20 20 20 20 20  20 20 53 20 3d 20 73 69  |.         S = si|
00000300  67 6e 65 64 20 20 20 20  20 20 20 20 20 20 20 20  |gned            |
00000310  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00000340  20 20 20 0a 20 20 20 20  20 20 20 20 20 57 20 3d  |   .         W =|
00000350  20 61 20 77 6f 72 64 20  28 61 64 64 72 65 73 73  | a word (address|
00000360  20 6f 72 20 75 6e 73 69  67 6e 65 64 20 6f 72 20  | or unsigned or |
00000370  73 69 67 6e 65 64 29 0a  20 20 20 20 20 20 20 20  |signed).        |
00000380  20 42 20 3d 20 61 20 77  6f 72 64 20 77 68 69 63  | B = a word whic|
00000390  68 20 63 61 6e 20 6f 6e  6c 79 20 68 61 76 65 20  |h can only have |
000003a0  74 77 6f 20 76 61 6c 75  65 73 20 28 30 3d 46 41  |two values (0=FA|
000003b0  4c 53 45 2c 20 2d 31 3d  54 52 55 45 29 2e 0a 20  |LSE, -1=TRUE).. |
000003c0  20 20 54 68 65 20 6e 65  78 74 20 70 61 72 74 20  |  The next part |
000003d0  69 73 20 61 20 6e 75 6d  62 65 72 20 73 68 6f 77  |is a number show|
000003e0  69 6e 67 20 74 68 65 20  6e 75 6d 62 65 72 20 6f  |ing the number o|
000003f0  66 20 62 69 74 73 20 74  68 61 74 20 74 68 65 20  |f bits that the |
00000400  65 6c 65 6d 65 6e 74 0a  74 61 6b 65 73 20 75 70  |element.takes up|
00000410  2e 0a 20 20 20 54 68 65  20 66 69 6e 61 6c 20 70  |..   The final p|
00000420  61 72 74 20 69 73 20 61  20 6c 65 74 74 65 72 20  |art is a letter |
00000430  77 68 69 63 68 20 69 73  20 75 73 65 64 20 74 6f  |which is used to|
00000440  20 64 69 73 74 69 6e 67  75 69 73 68 20 62 65 74  | distinguish bet|
00000450  77 65 65 6e 20 73 74 61  63 6b 0a 65 6c 65 6d 65  |ween stack.eleme|
00000460  6e 74 73 20 69 2e 65 2e  0a 0a 52 4f 54 20 5b 20  |nts i.e...ROT [ |
00000470  57 33 32 61 20 57 33 32  62 20 57 33 32 63 20 2d  |W32a W32b W32c -|
00000480  3e 20 57 33 32 62 20 57  33 32 63 20 57 33 32 61  |> W32b W32c W32a|
00000490  5d 20 28 6d 61 69 6e 29  20 74 68 69 73 20 77 6f  |] (main) this wo|
000004a0  72 64 20 69 73 20 75 73  65 64 20 74 6f 20 72 6f  |rd is used to ro|
000004b0  74 61 74 65 0a 20 20 20  20 74 68 65 20 74 6f 70  |tate.    the top|
000004c0  20 74 68 72 65 65 20 73  74 61 63 6b 20 65 6c 65  | three stack ele|
000004d0  6d 65 6e 74 73 2c 20 74  68 65 20 62 6f 74 74 6f  |ments, the botto|
000004e0  6d 20 6f 6e 65 20 6f 66  20 74 68 65 73 65 20 62  |m one of these b|
000004f0  65 63 6f 6d 65 73 20 74  68 65 20 74 6f 70 2e 0a  |ecomes the top..|
00000500  0a 20 20 20 4e 65 78 74  20 63 6f 6d 65 73 20 61  |.   Next comes a|
00000510  20 6e 61 6d 65 20 69 6e  20 62 72 61 63 6b 65 74  | name in bracket|
00000520  73 2c 20 74 68 69 73 20  69 73 20 74 68 65 20 64  |s, this is the d|
00000530  69 63 74 69 6f 6e 61 72  79 20 74 68 61 74 20 74  |ictionary that t|
00000540  68 65 20 77 6f 72 64 20  69 73 0a 63 6f 6e 74 61  |he word is.conta|
00000550  69 6e 65 64 20 69 6e 2c  20 63 75 72 72 65 6e 74  |ined in, current|
00000560  6c 79 20 74 68 65 72 65  20 61 72 65 20 74 68 72  |ly there are thr|
00000570  65 65 20 62 61 73 69 63  20 64 69 63 74 69 6f 6e  |ee basic diction|
00000580  61 72 69 65 73 20 64 65  66 69 6e 65 64 3a 0a 20  |aries defined:. |
00000590  20 20 20 20 20 31 2e 20  6d 61 69 6e 20 2d 20 74  |     1. main - t|
000005a0  68 69 73 20 69 73 20 74  68 65 20 64 69 63 74 69  |his is the dicti|
000005b0  6f 6e 61 72 79 20 77 68  69 63 68 20 63 6f 6e 74  |onary which cont|
000005c0  61 69 6e 73 20 74 68 65  20 77 6f 72 64 73 20 74  |ains the words t|
000005d0  68 61 74 20 61 72 65 0a  69 6e 74 65 72 70 72 65  |hat are.interpre|
000005e0  74 65 64 20 66 72 6f 6d  20 74 68 65 20 70 72 6f  |ted from the pro|
000005f0  6d 70 74 2c 20 61 73 20  77 65 6c 6c 20 61 73 20  |mpt, as well as |
00000600  62 61 73 69 63 20 73 74  61 63 6b 20 6d 61 6e 69  |basic stack mani|
00000610  70 75 6c 61 74 69 6f 6e  20 74 68 65 72 65 20 61  |pulation there a|
00000620  72 65 77 6f 72 64 73 20  66 6f 72 20 49 2f 4f 2c  |rewords for I/O,|
00000630  20 64 69 63 74 69 6f 6e  61 72 79 20 6d 61 6e 69  | dictionary mani|
00000640  70 75 6c 61 74 69 6f 6e  2c 20 65 74 63 2e 0a 20  |pulation, etc.. |
00000650  20 20 20 20 20 32 2e 20  63 6f 6d 70 69 6c 65 72  |     2. compiler|
00000660  20 2d 20 74 68 69 73 20  64 69 63 74 69 6f 6e 61  | - this dictiona|
00000670  72 79 20 69 73 20 6f 6e  6c 79 20 61 76 61 69 6c  |ry is only avail|
00000680  61 62 6c 65 20 77 68 65  6e 20 63 6f 6d 70 69 6c  |able when compil|
00000690  69 6e 67 20 61 20 6e 65  77 20 77 6f 72 64 2c 20  |ing a new word, |
000006a0  69 74 20 63 6f 6e 74 61  69 6e 73 20 77 6f 72 64  |it contains word|
000006b0  73 20 66 6f 72 20 69 74  65 72 61 74 69 6f 6e 2c  |s for iteration,|
000006c0  20 73 65 6c 65 63 74 69  6f 6e 2c 20 65 74 63 2e  | selection, etc.|
000006d0  0a 20 20 20 20 20 20 33  2e 20 73 70 65 63 69 61  |.      3. specia|
000006e0  6c 20 2d 20 74 68 69 73  20 64 69 63 74 69 6f 6e  |l - this diction|
000006f0  61 72 79 20 63 6f 6e 74  61 69 6e 73 20 74 68 65  |ary contains the|
00000700  20 6d 6f 73 74 20 75 73  65 64 20 77 6f 72 64 73  | most used words|
00000710  20 66 72 6f 6d 20 74 68  65 20 6d 61 69 6e 20 64  | from the main d|
00000720  69 63 74 69 6f 6e 61 72  79 2e 20 54 68 65 20 61  |ictionary. The a|
00000730  72 65 20 63 6f 6d 70 69  6c 65 64 20 69 6e 20 61  |re compiled in a|
00000740  20 73 70 65 63 69 61 6c  20 77 61 79 20 73 6f 20  | special way so |
00000750  74 68 61 74 20 74 68 65  79 20 72 75 6e 20 6d 75  |that they run mu|
00000760  63 68 20 66 61 73 74 65  72 20 74 68 61 6e 20 6f  |ch faster than o|
00000770  72 64 69 6e 61 72 79 20  77 6f 72 64 73 2e 20 0a  |rdinary words. .|
00000780  20 20 20 46 69 6e 61 6c  6c 79 20 63 6f 6d 65 73  |   Finally comes|
00000790  20 61 20 64 65 73 63 72  69 70 74 69 6f 6e 20 6f  | a description o|
000007a0  66 20 74 68 65 20 77 6f  72 64 20 69 74 73 20 61  |f the word its a|
000007b0  63 74 69 6f 6e 73 2c 20  73 65 6d 61 6e 74 69 63  |ctions, semantic|
000007c0  73 2c 20 61 6e 64 20 75  73 75 61 6c 20 75 73 65  |s, and usual use|
000007d0  73 2e 0a 0a 0a 0a 3a 20  20 20 20 20 20 5b 20 2d  |s.....:      [ -|
000007e0  3e 20 5d 20 28 6d 61 69  6e 29 20 74 68 69 73 20  |> ] (main) this |
000007f0  77 6f 72 64 20 73 74 61  72 74 73 20 74 68 65 20  |word starts the |
00000800  63 6f 6d 70 69 6c 61 74  69 6f 6e 20 70 72 6f 63  |compilation proc|
00000810  65 73 73 2c 20 74 68 65  20 6e 65 78 74 20 73 74  |ess, the next st|
00000820  72 69 6e 67 20 73 74 61  72 74 69 6e 67 20 61 66  |ring starting af|
00000830  74 65 72 20 74 68 65 20  69 6e 74 65 72 76 65 6e  |ter the interven|
00000840  69 6e 67 20 73 70 61 63  65 20 61 6e 64 20 65 6e  |ing space and en|
00000850  64 69 6e 67 0a 61 74 20  74 68 65 20 6e 65 78 74  |ding.at the next|
00000860  20 73 70 61 63 65 20 61  66 74 65 72 20 74 68 61  | space after tha|
00000870  74 20 69 73 20 74 68 65  20 6e 61 6d 65 20 6f 66  |t is the name of|
00000880  20 74 68 65 20 77 6f 72  64 20 63 6f 6d 70 69 6c  | the word compil|
00000890  65 64 2e 20 28 65 2e 67  2e 20 3a 20 32 44 55 50  |ed. (e.g. : 2DUP|
000008a0  20 44 55 50 20 44 55 50  20 3b 20 20 20 20 63 6f  | DUP DUP ;    co|
000008b0  6d 70 69 6c 65 73 20 74  68 65 20 77 6f 72 64 20  |mpiles the word |
000008c0  32 44 55 50 2c 20 61 20  73 65 6d 69 63 6f 6c 6f  |2DUP, a semicolo|
000008d0  6e 20 65 6e 64 73 0a 74  68 65 20 63 6f 6d 70 69  |n ends.the compi|
000008e0  6c 61 74 69 6f 6e 2e 20  0a 0a 2e 20 20 20 20 20  |lation. ...     |
000008f0  20 5b 20 57 33 32 61 20  2d 3e 20 5d 20 28 6d 61  | [ W32a -> ] (ma|
00000900  69 6e 29 20 74 68 69 73  20 77 6f 72 64 20 70 72  |in) this word pr|
00000910  69 6e 74 73 20 74 68 65  20 54 4f 53 20 74 6f 20  |ints the TOS to |
00000920  74 68 65 20 63 75 72 72  65 6e 74 6c 79 20 73 65  |the currently se|
00000930  6c 65 63 74 65 64 20 6f  75 74 70 75 74 20 28 65  |lected output (e|
00000940  2e 67 2e 20 74 68 65 20  73 63 72 65 65 6e 29 2e  |.g. the screen).|
00000950  0a 0a 2c 20 20 20 20 20  20 5b 20 57 33 32 61 20  |..,      [ W32a |
00000960  2d 3e 20 5d 20 28 6d 61  69 6e 29 20 74 68 69 73  |-> ] (main) this|
00000970  20 77 6f 72 64 20 77 72  69 74 65 73 20 74 68 65  | word writes the|
00000980  20 74 6f 70 20 73 74 61  63 6b 20 65 6e 74 72 79  | top stack entry|
00000990  20 69 6e 74 6f 20 74 68  65 20 63 6f 64 65 2e 20  | into the code. |
000009a0  49 74 20 69 73 20 75 73  65 64 20 64 75 72 69 6e  |It is used durin|
000009b0  67 20 74 68 65 20 63 6f  6d 70 69 6c 61 74 69 6f  |g the compilatio|
000009c0  6e 20 70 72 6f 63 65 73  73 2c 20 73 65 65 20 74  |n process, see t|
000009d0  68 65 20 65 78 61 6d 70  6c 65 20 70 72 6f 67 72  |he example progr|
000009e0  61 6d 20 4f 75 74 65 72  2e 0a 0a 3e 20 20 20 20  |am Outer...>    |
000009f0  20 20 5b 20 53 33 32 61  20 53 33 32 62 20 2d 3e  |  [ S32a S32b ->|
00000a00  20 42 33 32 63 20 5d 20  28 6d 61 69 6e 29 20 28  | B32c ] (main) (|
00000a10  73 70 65 63 69 61 6c 29  20 69 66 20 53 33 32 61  |special) if S32a|
00000a20  20 3e 20 53 33 32 62 20  74 68 65 6e 20 77 72 69  | > S32b then wri|
00000a30  74 65 20 2d 31 20 69 6e  74 6f 20 74 68 65 20 54  |te -1 into the T|
00000a40  4f 53 20 65 6c 73 65 20  77 72 69 74 65 20 30 20  |OS else write 0 |
00000a50  74 6f 20 54 4f 53 2e 20  28 2d 31 20 3d 20 54 52  |to TOS. (-1 = TR|
00000a60  55 45 2c 20 30 3d 46 41  4c 53 45 29 2e 0a 0a 3c  |UE, 0=FALSE)...<|
00000a70  20 20 20 20 20 20 5b 20  53 33 32 61 20 53 33 32  |      [ S32a S32|
00000a80  62 20 2d 3e 20 42 33 32  63 20 5d 20 28 6d 61 69  |b -> B32c ] (mai|
00000a90  6e 29 20 28 73 70 65 63  69 61 6c 29 20 69 66 20  |n) (special) if |
00000aa0  53 33 32 61 20 3c 20 53  33 32 62 20 74 68 65 6e  |S32a < S32b then|
00000ab0  20 77 72 69 74 65 20 2d  31 20 69 6e 74 6f 20 74  | write -1 into t|
00000ac0  68 65 20 54 4f 53 20 65  6c 73 65 20 77 72 69 74  |he TOS else writ|
00000ad0  65 20 30 20 74 6f 20 54  4f 53 2e 20 28 2d 31 20  |e 0 to TOS. (-1 |
00000ae0  3d 20 54 52 55 45 2c 20  30 3d 46 41 4c 53 45 29  |= TRUE, 0=FALSE)|
00000af0  2e 0a 0a 3d 20 20 20 20  20 20 5b 20 57 33 32 61  |...=      [ W32a|
00000b00  20 57 33 32 62 20 2d 3e  20 42 33 32 63 20 5d 20  | W32b -> B32c ] |
00000b10  28 6d 61 69 6e 29 20 28  73 70 65 63 69 61 6c 29  |(main) (special)|
00000b20  20 69 66 20 57 33 32 61  20 3d 20 57 33 32 62 20  | if W32a = W32b |
00000b30  74 68 65 6e 20 77 72 69  74 65 20 2d 31 20 69 6e  |then write -1 in|
00000b40  74 6f 20 74 68 65 20 54  4f 53 20 65 6c 73 65 20  |to the TOS else |
00000b50  77 72 69 74 65 20 30 20  74 6f 20 54 4f 53 2e 20  |write 0 to TOS. |
00000b60  28 2d 31 20 3d 20 54 52  55 45 2c 20 30 3d 46 41  |(-1 = TRUE, 0=FA|
00000b70  4c 53 45 29 2e 0a 0a 2d  20 20 20 20 20 20 5b 20  |LSE)...-      [ |
00000b80  53 33 32 61 20 53 33 32  62 20 2d 3e 20 53 33 32  |S32a S32b -> S32|
00000b90  63 20 5d 20 28 6d 61 69  6e 29 20 28 73 70 65 63  |c ] (main) (spec|
00000ba0  69 61 6c 29 20 73 75 62  74 72 61 63 74 20 74 68  |ial) subtract th|
00000bb0  65 20 74 6f 70 20 73 74  61 63 6b 20 65 6e 74 72  |e top stack entr|
00000bc0  79 20 66 72 6f 6d 20 74  68 65 20 6f 6e 65 20 62  |y from the one b|
00000bd0  65 6c 6f 77 20 69 74 20  6f 6e 20 74 68 65 20 73  |elow it on the s|
00000be0  74 61 63 6b 2e 0a 0a 2b  20 20 20 20 20 20 5b 20  |tack...+      [ |
00000bf0  53 33 32 61 20 53 33 32  62 20 2d 3e 20 53 33 32  |S32a S32b -> S32|
00000c00  63 20 5d 20 28 6d 61 69  6e 29 20 28 73 70 65 63  |c ] (main) (spec|
00000c10  69 61 6c 29 20 61 64 64  20 74 68 65 20 74 6f 70  |ial) add the top|
00000c20  20 74 77 6f 20 73 74 61  63 6b 20 65 6e 74 72 69  | two stack entri|
00000c30  65 73 20 74 6f 67 65 74  68 65 72 0a 0a 2a 20 20  |es together..*  |
00000c40  20 20 20 20 5b 20 53 33  32 61 20 53 33 32 62 20  |    [ S32a S32b |
00000c50  2d 3e 20 53 33 32 63 20  5d 20 28 6d 61 69 6e 29  |-> S32c ] (main)|
00000c60  20 6d 75 6c 74 69 70 6c  79 20 74 68 65 20 74 6f  | multiply the to|
00000c70  70 20 74 77 6f 20 73 74  61 63 6b 20 65 6e 74 72  |p two stack entr|
00000c80  69 65 73 20 74 6f 67 65  74 68 65 72 2e 0a 0a 2f  |ies together.../|
00000c90  20 20 20 20 20 20 5b 20  53 33 32 61 20 53 33 32  |      [ S32a S32|
00000ca0  62 20 2d 3e 20 53 33 32  63 20 5d 20 28 6d 61 69  |b -> S32c ] (mai|
00000cb0  6e 29 20 64 69 76 69 64  65 20 74 68 65 20 73 65  |n) divide the se|
00000cc0  63 6f 6e 64 20 65 6e 74  72 79 20 6f 6e 20 74 68  |cond entry on th|
00000cd0  65 20 73 74 61 63 6b 20  62 79 20 74 68 65 20 74  |e stack by the t|
00000ce0  6f 70 20 73 74 61 63 6b  20 65 6e 74 72 79 2e 0a  |op stack entry..|
00000cf0  0a 40 20 20 20 20 20 20  5b 20 41 33 32 61 20 2d  |.@      [ A32a -|
00000d00  3e 20 57 33 32 61 20 5d  20 28 6d 61 69 6e 29 20  |> W32a ] (main) |
00000d10  28 73 70 65 63 69 61 6c  29 20 74 68 65 20 74 6f  |(special) the to|
00000d20  70 20 73 74 61 63 6b 20  65 6e 74 72 79 20 69 73  |p stack entry is|
00000d30  20 74 72 65 61 74 65 64  20 61 73 20 61 6e 20 61  | treated as an a|
00000d40  64 64 72 65 73 73 2c 20  74 68 65 20 77 6f 72 64  |ddress, the word|
00000d50  20 61 74 20 74 68 69 73  20 61 64 64 72 65 73 73  | at this address|
00000d60  20 69 73 20 6c 6f 61 64  65 64 20 69 6e 74 6f 20  | is loaded into |
00000d70  74 68 65 20 74 6f 70 20  73 74 61 63 6b 20 65 6e  |the top stack en|
00000d80  74 72 79 2e 0a 0a 21 20  20 20 20 20 20 5b 20 57  |try...!      [ W|
00000d90  33 32 61 20 41 33 32 61  20 2d 3e 20 5d 20 28 6d  |32a A32a -> ] (m|
00000da0  61 69 6e 29 20 28 73 70  65 63 69 61 6c 29 20 74  |ain) (special) t|
00000db0  68 65 20 74 6f 70 20 73  74 61 63 6b 20 65 6e 74  |he top stack ent|
00000dc0  72 79 20 69 73 20 74 72  65 61 74 65 64 20 61 73  |ry is treated as|
00000dd0  20 61 6e 20 61 64 64 72  65 73 73 20 61 6e 64 20  | an address and |
00000de0  74 68 65 20 73 65 63 6f  6e 64 20 65 6e 74 72 79  |the second entry|
00000df0  20 6f 6e 20 74 68 65 20  61 64 64 72 65 73 73 20  | on the address |
00000e00  69 73 20 73 74 6f 72 65  64 20 61 74 20 74 68 69  |is stored at thi|
00000e10  73 20 61 64 64 72 65 73  73 2c 20 62 6f 74 68 20  |s address, both |
00000e20  65 6e 74 72 69 65 73 20  61 72 65 20 70 6f 70 65  |entries are pope|
00000e30  64 2e 0a 0a 43 40 20 20  20 20 20 5b 20 41 33 32  |d...C@     [ A32|
00000e40  61 20 2d 3e 20 57 38 61  20 5d 20 28 73 70 65 63  |a -> W8a ] (spec|
00000e50  69 61 6c 29 20 74 68 65  20 74 6f 70 20 73 74 61  |ial) the top sta|
00000e60  63 6b 20 65 6e 74 72 79  20 69 73 20 74 72 65 61  |ck entry is trea|
00000e70  74 65 64 20 61 73 20 61  6e 20 61 64 64 72 65 73  |ted as an addres|
00000e80  73 2c 20 74 68 65 20 62  79 74 65 20 61 74 20 74  |s, the byte at t|
00000e90  68 69 73 20 61 64 64 72  65 73 73 20 69 73 20 6c  |his address is l|
00000ea0  6f 61 64 65 64 20 69 6e  74 6f 20 74 68 65 20 74  |oaded into the t|
00000eb0  6f 70 20 73 74 61 63 6b  20 65 6e 74 72 79 2e 0a  |op stack entry..|
00000ec0  0a 43 21 20 20 20 20 20  5b 20 57 38 61 20 41 33  |.C!     [ W8a A3|
00000ed0  32 61 20 2d 3e 20 5d 20  28 6d 61 69 6e 29 20 28  |2a -> ] (main) (|
00000ee0  73 70 65 63 69 61 6c 29  20 74 68 65 20 74 6f 70  |special) the top|
00000ef0  20 73 74 61 63 6b 20 65  6e 74 72 79 20 69 73 20  | stack entry is |
00000f00  74 72 65 61 74 65 64 20  61 73 20 61 6e 20 61 64  |treated as an ad|
00000f10  64 72 65 73 73 20 61 6e  64 20 74 68 65 20 73 65  |dress and the se|
00000f20  63 6f 6e 64 20 65 6e 74  72 79 20 6f 6e 20 74 68  |cond entry on th|
00000f30  65 20 61 64 64 72 65 73  73 20 69 73 20 73 74 6f  |e address is sto|
00000f40  72 65 64 20 61 73 20 61  20 62 79 74 65 20 61 74  |red as a byte at|
00000f50  20 74 68 69 73 20 61 64  64 72 65 73 73 2c 20 62  | this address, b|
00000f60  6f 74 68 20 65 6e 74 72  69 65 73 20 61 72 65 20  |oth entries are |
00000f70  70 6f 70 65 64 2e 0a 0a  2a 2f 20 20 20 20 20 5b  |poped...*/     [|
00000f80  20 53 33 32 61 20 53 33  32 62 20 53 33 32 63 20  | S32a S32b S32c |
00000f90  2d 3e 20 53 33 32 64 20  5d 20 28 6d 61 69 6e 29  |-> S32d ] (main)|
00000fa0  20 28 73 70 65 63 69 61  6c 29 20 53 33 32 64 20  | (special) S32d |
00000fb0  3a 3d 20 28 53 33 32 61  20 2a 20 53 33 32 62 29  |:= (S32a * S32b)|
00000fc0  20 2f 20 53 33 32 63 2e  20 54 68 69 73 20 69 73  | / S32c. This is|
00000fd0  20 77 72 69 74 74 65 6e  20 73 6f 20 74 68 61 74  | written so that|
00000fe0  20 74 68 65 20 6d 75 6c  74 69 70 6c 69 63 61 74  | the multiplicat|
00000ff0  69 6f 6e 20 70 72 6f 64  75 63 65 73 20 61 74 20  |ion produces at |
00001000  36 34 20 62 69 74 20 70  72 6f 64 75 63 74 20 74  |64 bit product t|
00001010  68 61 74 20 69 73 20 74  68 65 6e 20 64 69 76 69  |hat is then divi|
00001020  64 65 64 20 62 79 20 53  33 32 63 20 74 6f 20 70  |ded by S32c to p|
00001030  72 6f 64 75 63 65 20 74  68 65 20 33 32 20 62 69  |roduce the 32 bi|
00001040  74 20 72 65 73 75 6c 74  2e 0a 0a 44 55 50 20 20  |t result...DUP  |
00001050  20 20 5b 20 57 33 32 61  20 2d 3e 20 57 33 32 61  |  [ W32a -> W32a|
00001060  20 57 33 32 61 20 5d 20  20 28 6d 61 69 6e 29 20  | W32a ]  (main) |
00001070  28 73 70 65 63 69 61 6c  29 20 74 68 69 73 20 77  |(special) this w|
00001080  6f 72 64 20 69 73 20 75  73 65 64 20 74 6f 20 64  |ord is used to d|
00001090  75 70 6c 69 63 61 74 65  20 74 68 65 20 74 6f 70  |uplicate the top|
000010a0  20 33 32 20 62 69 74 20  77 6f 72 64 20 6f 6e 20  | 32 bit word on |
000010b0  74 68 65 20 73 74 61 63  6b 2e 0a 0a 52 4f 54 20  |the stack...ROT |
000010c0  20 20 20 5b 20 57 33 32  61 20 57 33 32 62 20 57  |   [ W32a W32b W|
000010d0  33 32 63 20 2d 3e 20 57  33 32 62 20 57 33 32 63  |32c -> W32b W32c|
000010e0  20 57 33 32 61 5d 20 28  6d 61 69 6e 29 20 74 68  | W32a] (main) th|
000010f0  69 73 20 77 6f 72 64 20  69 73 20 75 73 65 64 20  |is word is used |
00001100  74 6f 20 72 6f 74 61 74  65 20 74 68 65 20 74 6f  |to rotate the to|
00001110  70 20 74 68 72 65 65 20  73 74 61 63 6b 20 65 6c  |p three stack el|
00001120  65 6d 65 6e 74 73 2c 20  74 68 65 20 62 6f 74 74  |ements, the bott|
00001130  6f 6d 20 6f 6e 65 20 6f  66 20 74 68 65 73 65 20  |om one of these |
00001140  62 65 63 6f 6d 65 73 20  74 68 65 20 74 6f 70 2e  |becomes the top.|
00001150  0a 0a 30 3d 20 20 20 20  20 5b 20 57 33 32 61 20  |..0=     [ W32a |
00001160  2d 3e 20 42 33 32 62 20  5d 20 28 6d 61 69 6e 29  |-> B32b ] (main)|
00001170  20 69 66 20 74 68 65 20  54 4f 53 20 69 73 20 7a  | if the TOS is z|
00001180  65 72 6f 20 74 68 65 20  42 33 32 62 3d 2d 31 20  |ero the B32b=-1 |
00001190  28 54 52 55 45 29 20 65  6c 73 65 20 42 33 32 62  |(TRUE) else B32b|
000011a0  3d 30 20 28 46 41 4c 53  45 29 2e 0a 0a 30 3c 20  |=0 (FALSE)...0< |
000011b0  20 20 20 20 5b 20 53 33  32 61 20 2d 3e 20 42 33  |    [ S32a -> B3|
000011c0  32 62 20 5d 20 28 6d 61  69 6e 29 20 69 66 20 74  |2b ] (main) if t|
000011d0  68 65 20 54 4f 53 20 69  73 20 6c 65 73 73 20 74  |he TOS is less t|
000011e0  68 61 6e 20 7a 65 72 6f  20 74 68 65 20 42 33 32  |han zero the B32|
000011f0  62 3d 2d 31 20 28 54 52  55 45 29 20 65 6c 73 65  |b=-1 (TRUE) else|
00001200  20 42 33 32 62 3d 30 20  28 46 41 4c 53 45 29 2e  | B32b=0 (FALSE).|
00001210  0a 0a 31 2d 20 20 20 20  20 5b 20 53 33 32 61 20  |..1-     [ S32a |
00001220  2d 3e 20 53 33 32 62 20  5d 20 28 6d 61 69 6e 29  |-> S32b ] (main)|
00001230  20 28 73 70 65 63 69 61  6c 29 20 53 33 32 62 20  | (special) S32b |
00001240  3a 3d 20 53 33 32 61 2d  31 2e 0a 0a 31 2b 20 20  |:= S32a-1...1+  |
00001250  20 20 20 5b 20 53 33 32  61 20 2d 3e 20 53 33 32  |   [ S32a -> S32|
00001260  62 20 5d 20 28 6d 61 69  6e 29 20 28 73 70 65 63  |b ] (main) (spec|
00001270  69 61 6c 29 20 53 33 32  62 20 3a 3d 20 53 33 32  |ial) S32b := S32|
00001280  61 2b 31 2e 0a 0a 32 2d  20 20 20 20 20 5b 20 53  |a+1...2-     [ S|
00001290  33 32 61 20 2d 3e 20 53  33 32 62 20 5d 20 28 6d  |32a -> S32b ] (m|
000012a0  61 69 6e 29 20 28 73 70  65 63 69 61 6c 29 20 53  |ain) (special) S|
000012b0  33 32 62 20 3a 3d 20 53  33 32 61 2d 32 2e 0a 0a  |32b := S32a-2...|
000012c0  32 2b 20 20 20 20 20 5b  20 53 33 32 61 20 2d 3e  |2+     [ S32a ->|
000012d0  20 53 33 32 62 20 5d 20  28 6d 61 69 6e 29 20 28  | S32b ] (main) (|
000012e0  73 70 65 63 69 61 6c 29  20 53 33 32 62 20 3a 3d  |special) S32b :=|
000012f0  20 53 33 32 61 2b 32 2e  0a 0a 32 2a 20 20 20 20  | S32a+2...2*    |
00001300  20 5b 20 53 33 32 61 20  2d 3e 20 53 33 32 62 20  | [ S32a -> S32b |
00001310  5d 20 28 6d 61 69 6e 29  20 53 33 32 62 20 3a 3d  |] (main) S32b :=|
00001320  20 53 33 32 61 20 3c 3c  20 31 2e 0a 0a 32 2f 20  | S32a << 1...2/ |
00001330  20 20 20 20 5b 20 53 33  32 61 20 2d 3e 20 53 33  |    [ S32a -> S3|
00001340  32 62 20 5d 20 28 6d 61  69 6e 29 20 53 33 32 62  |2b ] (main) S32b|
00001350  20 3a 3d 20 53 33 32 61  20 3e 3e 20 31 2e 0a 0a  | := S32a >> 1...|
00001360  34 2d 20 20 20 20 20 5b  20 53 33 32 61 20 2d 3e  |4-     [ S32a ->|
00001370  20 53 33 32 62 20 5d 20  28 6d 61 69 6e 29 20 28  | S32b ] (main) (|
00001380  73 70 65 63 69 61 6c 29  20 53 33 32 62 20 3a 3d  |special) S32b :=|
00001390  20 53 33 32 61 2d 34 2e  0a 0a 34 2b 20 20 20 20  | S32a-4...4+    |
000013a0  20 5b 20 53 33 32 61 20  2d 3e 20 53 33 32 62 20  | [ S32a -> S32b |
000013b0  5d 20 28 6d 61 69 6e 29  20 28 73 70 65 63 69 61  |] (main) (specia|
000013c0  6c 29 20 53 33 32 62 20  3a 3d 20 53 33 32 61 2b  |l) S32b := S32a+|
000013d0  34 2e 0a 0a 34 2a 20 20  20 20 20 5b 20 53 33 32  |4...4*     [ S32|
000013e0  61 20 2d 3e 20 53 33 32  62 20 5d 20 28 6d 61 69  |a -> S32b ] (mai|
000013f0  6e 29 20 53 33 32 62 20  3a 3d 20 53 33 32 61 20  |n) S32b := S32a |
00001400  3c 3c 20 32 2e 0a 0a 34  2f 20 20 20 20 20 5b 20  |<< 2...4/     [ |
00001410  53 33 32 61 20 2d 3e 20  53 33 32 62 20 5d 20 28  |S32a -> S32b ] (|
00001420  6d 61 69 6e 29 20 53 33  32 62 20 3a 3d 20 53 33  |main) S32b := S3|
00001430  32 61 20 3e 3e 20 32 2e  0a 0a 3c 52 20 20 20 20  |2a >> 2...<R    |
00001440  20 5b 20 57 33 32 61 20  2d 3e 20 5d 20 20 28 6d  | [ W32a -> ]  (m|
00001450  61 69 6e 29 20 70 6f 70  73 20 74 68 65 20 74 6f  |ain) pops the to|
00001460  70 20 77 6f 72 64 20 6f  66 66 20 74 68 65 20 73  |p word off the s|
00001470  74 61 63 6b 20 61 6e 64  20 70 75 74 73 20 69 74  |tack and puts it|
00001480  20 6f 6e 74 6f 20 74 68  65 20 70 72 6f 63 65 73  | onto the proces|
00001490  73 6f 72 20 73 74 61 63  6b 2e 0a 0a 52 3e 20 20  |sor stack...R>  |
000014a0  20 20 20 5b 20 2d 3e 20  57 33 32 61 20 5d 20 20  |   [ -> W32a ]  |
000014b0  28 6d 61 69 6e 29 20 70  6f 70 73 20 74 68 65 20  |(main) pops the |
000014c0  74 6f 70 20 77 6f 72 64  20 6f 66 66 20 74 68 65  |top word off the|
000014d0  20 70 72 6f 63 65 73 73  6f 72 20 73 74 61 63 6b  | processor stack|
000014e0  20 61 6e 64 20 70 75 74  73 20 69 74 20 6f 6e 74  | and puts it ont|
000014f0  6f 20 74 68 65 20 73 74  61 63 6b 2e 0a 0a 2b 21  |o the stack...+!|
00001500  20 20 20 20 20 5b 20 57  33 32 61 20 41 33 32 62  |     [ W32a A32b|
00001510  20 2d 3e 20 5d 20 28 6d  61 69 6e 29 20 70 6f 70  | -> ] (main) pop|
00001520  73 20 74 77 6f 20 73 74  61 63 6b 20 65 6e 74 72  |s two stack entr|
00001530  69 65 73 20 61 6e 64 20  61 64 64 73 20 74 68 65  |ies and adds the|
00001540  20 77 6f 72 64 20 69 6e  20 74 68 65 20 73 65 63  | word in the sec|
00001550  6f 6e 64 20 65 6e 74 72  79 20 74 6f 20 74 68 65  |ond entry to the|
00001560  20 77 6f 72 64 20 77 68  6f 73 65 20 61 64 64 72  | word whose addr|
00001570  65 73 73 20 69 73 20 74  68 65 20 74 6f 70 20 65  |ess is the top e|
00001580  6e 74 72 79 2e 0a 0a 75  44 2a 20 20 20 20 5b 20  |ntry...uD*    [ |
00001590  57 33 32 61 20 57 33 32  62 20 2d 3e 20 57 36 34  |W32a W32b -> W64|
000015a0  63 20 5d 20 28 6d 61 69  6e 29 20 6d 75 6c 74 69  |c ] (main) multi|
000015b0  70 6c 69 65 73 20 74 68  65 20 74 6f 70 20 74 77  |plies the top tw|
000015c0  6f 20 33 32 20 62 69 74  20 75 6e 73 69 67 6e 65  |o 32 bit unsigne|
000015d0  64 20 65 6e 74 72 69 65  73 20 6f 6e 20 74 68 65  |d entries on the|
000015e0  20 73 74 61 63 6b 20 61  6e 64 20 70 6c 61 63 65  | stack and place|
000015f0  73 20 74 68 65 20 36 34  20 62 69 74 20 72 65 73  |s the 64 bit res|
00001600  75 6c 74 20 62 61 63 6b  20 6f 6e 20 74 68 65 20  |ult back on the |
00001610  73 74 61 63 6b 20 28 68  69 67 68 20 77 6f 72 64  |stack (high word|
00001620  20 69 73 20 61 74 20 74  68 65 20 54 4f 53 29 2e  | is at the TOS).|
00001630  0a 0a 75 44 2f 20 20 20  20 5b 20 57 36 34 61 20  |..uD/    [ W64a |
00001640  57 33 32 62 20 2d 3e 20  57 33 32 63 20 5d 20 28  |W32b -> W32c ] (|
00001650  6d 61 69 6e 29 20 64 69  76 69 64 65 73 20 74 68  |main) divides th|
00001660  65 20 36 34 20 62 69 74  20 75 6e 73 69 67 6e 65  |e 64 bit unsigne|
00001670  64 20 65 6e 74 72 79 20  62 79 20 74 68 65 20 54  |d entry by the T|
00001680  4f 53 20 61 6e 64 20 70  6c 61 63 65 73 20 74 68  |OS and places th|
00001690  65 20 72 65 73 75 6c 74  20 6f 6e 20 74 68 65 20  |e result on the |
000016a0  73 74 61 63 6b 2e 0a 0a  44 2a 20 20 20 20 20 5b  |stack...D*     [|
000016b0  20 57 33 32 61 20 57 33  32 62 20 2d 3e 20 57 36  | W32a W32b -> W6|
000016c0  34 63 20 5d 20 28 6d 61  69 6e 29 20 6d 75 6c 74  |4c ] (main) mult|
000016d0  69 70 6c 69 65 73 20 74  68 65 20 74 6f 70 20 74  |iplies the top t|
000016e0  77 6f 20 33 32 20 62 69  74 20 73 69 67 6e 65 64  |wo 32 bit signed|
000016f0  20 65 6e 74 72 69 65 73  20 6f 6e 20 74 68 65 20  | entries on the |
00001700  73 74 61 63 6b 20 61 6e  64 20 70 6c 61 63 65 73  |stack and places|
00001710  20 74 68 65 20 36 34 20  62 69 74 20 72 65 73 75  | the 64 bit resu|
00001720  6c 74 20 62 61 63 6b 20  6f 6e 20 74 68 65 20 73  |lt back on the s|
00001730  74 61 63 6b 20 28 68 69  67 68 20 77 6f 72 64 20  |tack (high word |
00001740  69 73 20 61 74 20 74 68  65 20 54 4f 53 29 2e 0a  |is at the TOS)..|
00001750  0a 44 2f 20 20 20 20 20  5b 20 57 36 34 61 20 57  |.D/     [ W64a W|
00001760  33 32 62 20 2d 3e 20 57  33 32 63 20 5d 20 28 6d  |32b -> W32c ] (m|
00001770  61 69 6e 29 20 64 69 76  69 64 65 73 20 74 68 65  |ain) divides the|
00001780  20 36 34 20 62 69 74 20  73 69 67 6e 65 64 20 65  | 64 bit signed e|
00001790  6e 74 72 79 20 62 79 20  74 68 65 20 54 4f 53 20  |ntry by the TOS |
000017a0  61 6e 64 20 70 6c 61 63  65 73 20 74 68 65 20 72  |and places the r|
000017b0  65 73 75 6c 74 20 6f 6e  20 74 68 65 20 73 74 61  |esult on the sta|
000017c0  63 6b 2e 0a 0a 3f 53 50  20 20 20 20 5b 20 2d 3e  |ck...?SP    [ ->|
000017d0  20 41 33 32 61 20 5d 20  28 6d 61 69 6e 29 20 70  | A32a ] (main) p|
000017e0  75 73 68 65 73 20 74 68  65 20 63 75 72 72 65 6e  |ushes the curren|
000017f0  74 20 73 74 61 63 6b 20  70 6f 69 6e 74 65 72 20  |t stack pointer |
00001800  28 62 65 66 6f 72 65 20  74 68 65 20 65 78 65 63  |(before the exec|
00001810  75 74 69 6f 6e 20 6f 66  20 3f 53 50 29 20 6f 6e  |ution of ?SP) on|
00001820  74 6f 20 74 68 65 20 73  74 61 63 6b 2e 0a 0a 2b  |to the stack...+|
00001830  53 50 20 20 20 20 5b 20  57 33 32 61 20 2d 3e 20  |SP    [ W32a -> |
00001840  57 33 32 62 20 5d 20 28  6d 61 69 6e 29 20 41 64  |W32b ] (main) Ad|
00001850  64 20 74 68 65 20 63 75  72 72 65 6e 74 20 73 74  |d the current st|
00001860  61 63 6b 20 70 6f 69 6e  74 65 72 20 74 6f 20 74  |ack pointer to t|
00001870  68 65 20 6e 75 6d 62 65  72 20 6f 6e 20 74 6f 70  |he number on top|
00001880  20 6f 66 20 74 68 65 20  73 74 61 63 6b 2e 0a 0a  | of the stack...|
00001890  30 53 45 54 20 20 20 5b  20 41 33 32 61 20 2d 3e  |0SET   [ A32a ->|
000018a0  20 5d 20 28 6d 61 69 6e  29 20 73 65 74 20 74 68  | ] (main) set th|
000018b0  65 20 33 32 20 62 69 74  20 77 6f 72 64 20 77 68  |e 32 bit word wh|
000018c0  6f 73 65 20 61 64 64 72  65 73 73 20 69 73 20 74  |ose address is t|
000018d0  68 65 20 74 6f 70 20 73  74 61 63 6b 20 65 6e 74  |he top stack ent|
000018e0  72 79 20 74 6f 20 30 2e  0a 0a 31 53 45 54 20 20  |ry to 0...1SET  |
000018f0  20 5b 20 41 33 32 61 20  2d 3e 20 5d 20 28 6d 61  | [ A32a -> ] (ma|
00001900  69 6e 29 20 73 65 74 20  74 68 65 20 33 32 20 62  |in) set the 32 b|
00001910  69 74 20 77 6f 72 64 20  77 68 6f 73 65 20 61 64  |it word whose ad|
00001920  64 72 65 73 73 20 69 73  20 74 68 65 20 74 6f 70  |dress is the top|
00001930  20 73 74 61 63 6b 20 65  6e 74 72 79 20 74 6f 20  | stack entry to |
00001940  31 2e 0a 0a 43 30 53 45  54 20 20 5b 20 41 33 32  |1...C0SET  [ A32|
00001950  61 20 2d 3e 20 5d 20 28  6d 61 69 6e 29 20 73 65  |a -> ] (main) se|
00001960  74 20 74 68 65 20 62 79  74 65 20 77 68 6f 73 65  |t the byte whose|
00001970  20 61 64 64 72 65 73 73  20 69 73 20 74 68 65 20  | address is the |
00001980  74 6f 70 20 73 74 61 63  6b 20 65 6e 74 72 79 20  |top stack entry |
00001990  74 6f 20 30 2e 0a 0a 43  31 53 45 54 20 20 5b 20  |to 0...C1SET  [ |
000019a0  41 33 32 61 20 2d 3e 20  5d 20 28 6d 61 69 6e 29  |A32a -> ] (main)|
000019b0  20 73 65 74 20 74 68 65  20 62 79 74 65 20 77 68  | set the byte wh|
000019c0  6f 73 65 20 61 64 64 72  65 73 73 20 69 73 20 74  |ose address is t|
000019d0  68 65 20 74 6f 70 20 73  74 61 63 6b 20 65 6e 74  |he top stack ent|
000019e0  72 79 20 74 6f 20 31 2e  0a 0a 43 2b 21 20 20 20  |ry to 1...C+!   |
000019f0  20 5b 20 57 38 61 20 41  33 32 62 20 2d 3e 20 5d  | [ W8a A32b -> ]|
00001a00  20 28 6d 61 69 6e 29 20  70 6f 70 73 20 74 77 6f  | (main) pops two|
00001a10  20 73 74 61 63 6b 20 65  6e 74 72 69 65 73 20 61  | stack entries a|
00001a20  6e 64 20 61 64 64 73 20  74 68 65 20 6c 65 61 73  |nd adds the leas|
00001a30  74 20 73 69 67 6e 69 66  69 63 61 6e 74 20 62 79  |t significant by|
00001a40  74 65 20 69 6e 20 74 68  65 20 73 65 63 6f 6e 64  |te in the second|
00001a50  20 65 6e 74 72 79 20 74  6f 20 74 68 65 20 62 79  | entry to the by|
00001a60  74 65 20 77 68 6f 73 65  20 61 64 64 72 65 73 73  |te whose address|
00001a70  20 69 73 20 74 68 65 20  74 6f 70 20 65 6e 74 72  | is the top entr|
00001a80  79 2e 0a 0a 41 42 53 20  20 20 20 5b 20 53 33 32  |y...ABS    [ S32|
00001a90  61 20 2d 3e 20 57 33 32  62 20 5d 20 28 6d 61 69  |a -> W32b ] (mai|
00001aa0  6e 29 20 6d 61 6b 65 73  20 74 68 65 20 54 4f 53  |n) makes the TOS|
00001ab0  20 70 6f 73 69 74 69 76  65 2c 20 62 79 20 6e 65  | positive, by ne|
00001ac0  67 61 74 69 6e 67 20 69  73 20 74 6f 70 20 62 69  |gating is top bi|
00001ad0  74 20 73 65 74 20 28 69  2e 65 2e 20 6e 65 67 61  |t set (i.e. nega|
00001ae0  74 69 76 65 29 20 62 65  66 6f 72 65 20 63 61 6c  |tive) before cal|
00001af0  6c 20 6f 66 20 41 42 53  2e 0a 0a 52 45 4d 20 20  |l of ABS...REM  |
00001b00  20 0a 0a 52 41 4e 44 4f  4d 0a 0a 41 4e 44 20 20  | ..RANDOM..AND  |
00001b10  20 20 5b 20 57 33 32 61  20 57 33 32 62 20 2d 3e  |  [ W32a W32b ->|
00001b20  20 57 33 32 63 20 5d 20  28 6d 61 69 6e 29 20 64  | W32c ] (main) d|
00001b30  6f 65 73 20 61 20 62 69  74 77 69 73 65 20 6c 6f  |oes a bitwise lo|
00001b40  67 69 63 61 6c 20 41 4e  44 20 6f 6e 20 74 68 65  |gical AND on the|
00001b50  20 74 6f 70 20 74 77 6f  20 73 74 61 63 6b 20 65  | top two stack e|
00001b60  6e 74 72 69 65 73 20 61  6e 64 20 70 75 73 68 65  |ntries and pushe|
00001b70  73 20 74 68 65 20 72 65  73 75 6c 74 2e 0a 0a 43  |s the result...C|
00001b80  4c 45 41 52 0a 0a 43 52  45 54 20 20 20 5b 20 2d  |LEAR..CRET   [ -|
00001b90  3e 20 5d 20 28 6d 61 69  6e 29 20 77 72 69 74 65  |> ] (main) write|
00001ba0  20 61 20 63 61 72 72 69  61 67 65 2d 72 65 74 75  | a carriage-retu|
00001bb0  72 6e 20 6c 69 6e 65 2d  66 65 65 64 20 74 6f 20  |rn line-feed to |
00001bc0  74 68 65 20 63 75 72 72  65 6e 74 20 6f 75 74 70  |the current outp|
00001bd0  75 74 20 73 74 72 65 61  6d 73 2e 0a 0a 44 52 4f  |ut streams...DRO|
00001be0  50 20 20 20 5b 20 57 33  32 61 20 2d 3e 20 5d 20  |P   [ W32a -> ] |
00001bf0  28 73 70 65 63 69 61 6c  29 20 28 6d 61 69 6e 29  |(special) (main)|
00001c00  20 72 65 6d 6f 76 65 20  74 68 65 20 74 6f 70 20  | remove the top |
00001c10  73 74 61 63 6b 20 65 6e  74 72 79 20 77 69 74 68  |stack entry with|
00001c20  6f 75 74 20 64 6f 69 6e  67 20 61 6e 79 20 70 72  |out doing any pr|
00001c30  6f 63 65 73 73 69 6e 67  20 6f 6e 20 69 74 2e 0a  |ocessing on it..|
00001c40  0a 45 43 48 4f 20 20 20  5b 20 57 38 61 20 2d 3e  |.ECHO   [ W8a ->|
00001c50  20 5d 20 28 6d 61 69 6e  29 20 70 6f 70 73 20 74  | ] (main) pops t|
00001c60  68 65 20 74 6f 70 20 73  74 61 63 6b 20 65 6e 74  |he top stack ent|
00001c70  72 79 20 61 6e 64 20 77  72 69 74 65 20 74 68 65  |ry and write the|
00001c80  20 6c 6f 77 2d 6f 72 64  65 72 20 62 79 74 65 20  | low-order byte |
00001c90  74 6f 20 61 6c 6c 20 74  68 65 20 63 75 72 72 65  |to all the curre|
00001ca0  6e 74 20 6f 75 74 70 75  74 20 73 74 72 65 61 6d  |nt output stream|
00001cb0  73 2e 0a 0a 4d 41 58 20  20 20 20 5b 20 53 33 32  |s...MAX    [ S32|
00001cc0  61 20 53 33 32 62 20 2d  3e 20 53 33 32 63 20 5d  |a S32b -> S32c ]|
00001cd0  20 28 6d 61 69 6e 29 20  70 6f 70 73 20 74 68 65  | (main) pops the|
00001ce0  20 74 6f 70 20 74 77 6f  20 73 74 61 63 6b 20 65  | top two stack e|
00001cf0  6e 74 72 69 65 73 2c 20  63 6f 6d 70 61 72 65 73  |ntries, compares|
00001d00  20 74 68 65 6d 20 61 6e  64 20 74 68 65 6e 20 70  | them and then p|
00001d10  75 73 68 65 73 20 74 68  65 20 68 69 67 68 65 72  |ushes the higher|
00001d20  20 76 61 6c 75 65 20 62  61 63 6b 20 6f 6e 74 6f  | value back onto|
00001d30  20 74 68 65 20 73 74 61  63 6b 2e 20 49 46 20 53  | the stack. IF S|
00001d40  33 32 61 20 3e 20 53 33  32 62 20 54 48 45 4e 20  |32a > S32b THEN |
00001d50  53 33 32 63 20 3a 3d 20  53 33 32 61 20 45 4c 53  |S32c := S32a ELS|
00001d60  45 20 53 33 32 63 20 3a  3d 20 53 33 32 62 20 45  |E S32c := S32b E|
00001d70  4e 44 49 46 2e 0a 0a 4d  49 4e 20 20 20 20 5b 20  |NDIF...MIN    [ |
00001d80  53 33 32 61 20 53 33 32  62 20 2d 3e 20 53 33 32  |S32a S32b -> S32|
00001d90  63 20 5d 20 28 6d 61 69  6e 29 20 70 6f 70 73 20  |c ] (main) pops |
00001da0  74 68 65 20 74 6f 70 20  74 77 6f 20 73 74 61 63  |the top two stac|
00001db0  6b 20 65 6e 74 72 69 65  73 2c 20 63 6f 6d 70 61  |k entries, compa|
00001dc0  72 65 73 20 74 68 65 6d  20 61 6e 64 20 74 68 65  |res them and the|
00001dd0  6e 20 70 75 73 68 65 73  20 74 68 65 20 6c 6f 77  |n pushes the low|
00001de0  65 65 72 20 76 61 6c 75  65 20 62 61 63 6b 20 6f  |eer value back o|
00001df0  6e 74 6f 20 74 68 65 20  73 74 61 63 6b 2e 20 49  |nto the stack. I|
00001e00  46 20 53 33 32 61 20 3c  20 53 33 32 62 20 54 48  |F S32a < S32b TH|
00001e10  45 4e 20 53 33 32 63 20  3a 3d 20 53 33 32 61 20  |EN S32c := S32a |
00001e20  45 4c 53 45 20 53 33 32  63 20 3a 3d 20 53 33 32  |ELSE S32c := S32|
00001e30  62 20 45 4e 44 49 46 2e  0a 0a 4e 4f 54 20 20 20  |b ENDIF...NOT   |
00001e40  20 5b 20 57 33 32 61 20  2d 3e 20 57 33 32 62 20  | [ W32a -> W32b |
00001e50  5d 20 28 6d 61 69 6e 29  20 64 6f 65 73 20 61 20  |] (main) does a |
00001e60  62 69 74 77 69 73 65 20  4e 4f 54 20 6f 6e 20 74  |bitwise NOT on t|
00001e70  68 65 20 74 6f 70 20 73  74 61 63 6b 20 65 6e 74  |he top stack ent|
00001e80  72 79 2e 0a 0a 4f 52 20  20 20 20 20 5b 20 57 33  |ry...OR     [ W3|
00001e90  32 61 20 57 33 32 62 20  2d 3e 20 57 33 32 63 20  |2a W32b -> W32c |
00001ea0  5d 20 28 6d 61 69 6e 29  20 64 6f 65 73 20 61 20  |] (main) does a |
00001eb0  62 69 74 77 69 73 65 20  6c 6f 67 69 63 61 6c 20  |bitwise logical |
00001ec0  4f 52 20 6f 6e 20 74 68  65 20 74 6f 70 20 74 77  |OR on the top tw|
00001ed0  6f 20 73 74 61 63 6b 20  65 6e 74 72 69 65 73 20  |o stack entries |
00001ee0  61 6e 64 20 70 75 73 68  65 73 20 74 68 65 20 72  |and pushes the r|
00001ef0  65 73 75 6c 74 2e 0a 0a  2e 52 20 20 20 20 20 5b  |esult....R     [|
00001f00  20 53 33 32 61 20 57 33  32 62 20 2d 3e 20 5d 20  | S32a W32b -> ] |
00001f10  28 6d 61 69 6e 29 20 44  69 73 70 6c 61 79 73 20  |(main) Displays |
00001f20  74 68 65 20 73 65 63 6f  6e 64 20 73 74 61 63 6b  |the second stack|
00001f30  20 65 6e 74 72 79 20 61  73 20 61 20 6e 75 6d 62  | entry as a numb|
00001f40  65 72 20 6f 6e 20 61 6c  6c 20 74 68 65 20 63 75  |er on all the cu|
00001f50  72 72 65 6e 74 20 6f 75  74 70 75 74 20 73 74 72  |rrent output str|
00001f60  65 61 6d 73 20 69 6e 20  61 20 66 69 65 6c 64 20  |eams in a field |
00001f70  77 69 64 74 68 20 64 65  74 65 72 6d 69 6e 65 64  |width determined|
00001f80  20 62 79 20 74 68 65 20  74 6f 70 20 73 74 61 63  | by the top stac|
00001f90  6b 20 65 6e 74 72 79 2e  20 54 68 65 20 6e 75 6d  |k entry. The num|
00001fa0  62 65 72 20 69 73 20 72  69 67 68 74 20 6a 75 73  |ber is right jus|
00001fb0  74 69 66 69 65 64 20 77  69 74 68 69 6e 20 74 68  |tified within th|
00001fc0  65 20 66 69 65 6c 64 20  61 6e 64 20 66 6f 6c 6c  |e field and foll|
00001fd0  6f 77 65 64 20 62 79 20  61 20 73 70 61 63 65 2e  |owed by a space.|
00001fe0  20 54 68 65 20 66 69 65  6c 64 20 77 69 64 74 68  | The field width|
00001ff0  20 69 73 20 74 68 65 20  74 68 65 20 6d 69 6e 69  | is the the mini|
00002000  6d 75 6d 20 66 69 65 6c  64 20 77 69 64 74 68 20  |mum field width |
00002010  61 6e 64 20 73 6f 20 61  20 6e 75 6d 62 65 72 20  |and so a number |
00002020  77 68 69 63 68 20 74 61  6b 65 73 20 6d 6f 72 65  |which takes more|
00002030  20 64 69 67 69 74 73 20  74 6f 20 64 69 73 70 6c  | digits to displ|
00002040  61 79 20 74 68 65 6e 20  61 72 65 20 61 6c 6c 6f  |ay then are allo|
00002050  77 65 64 20 66 6f 72 20  69 74 20 63 61 6e 20 6f  |wed for it can o|
00002060  76 65 72 66 6c 6f 77 2e  0a 0a 2e 48 0a 0a 41 53  |verflow....H..AS|
00002070  50 41 43 45 20 5b 20 2d  3e 20 57 33 32 61 20 5d  |PACE [ -> W32a ]|
00002080  20 28 6d 61 69 6e 29 20  70 75 73 68 65 73 20 74  | (main) pushes t|
00002090  68 65 20 41 53 43 49 49  20 28 33 32 20 64 65 63  |he ASCII (32 dec|
000020a0  69 6d 61 6c 29 20 73 70  61 63 65 20 63 68 61 72  |imal) space char|
000020b0  61 63 74 65 72 20 6f 6e  74 6f 20 74 68 65 20 73  |acter onto the s|
000020c0  74 61 63 6b 2e 0a 0a 54  59 50 45 20 20 20 5b 20  |tack...TYPE   [ |
000020d0  41 33 32 61 20 2d 3e 20  5d 20 28 6d 61 69 6e 29  |A32a -> ] (main)|
000020e0  20 75 73 65 73 20 74 68  65 20 74 6f 70 20 77 6f  | uses the top wo|
000020f0  72 64 20 6f 6e 20 74 68  65 20 73 74 61 63 6b 20  |rd on the stack |
00002100  61 73 20 61 20 70 6f 69  6e 74 65 72 20 74 6f 20  |as a pointer to |
00002110  61 20 73 74 72 69 6e 67  20 28 73 65 71 75 65 6e  |a string (sequen|
00002120  63 65 20 6f 66 20 62 79  74 65 73 20 66 6f 6c 6c  |ce of bytes foll|
00002130  6f 77 65 64 20 62 79 20  61 20 30 20 62 79 74 65  |owed by a 0 byte|
00002140  20 74 65 72 6d 69 6e 61  74 6f 72 29 2e 20 49 74  | terminator). It|
00002150  20 70 72 69 6e 74 73 20  74 68 69 73 20 73 74 72  | prints this str|
00002160  69 6e 67 20 6f 75 74 20  74 6f 20 74 68 65 20 63  |ing out to the c|
00002170  75 72 72 65 6e 74 20 6f  75 74 70 75 74 20 73 74  |urrent output st|
00002180  72 65 61 6d 73 2e 0a 0a  57 41 49 54 20 20 20 5b  |reams...WAIT   [|
00002190  20 2d 3e 20 5d 20 28 6d  61 69 6e 29 20 69 66 20  | -> ] (main) if |
000021a0  61 6e 79 20 6b 65 79 20  68 61 73 20 62 65 65 6e  |any key has been|
000021b0  20 70 72 65 73 73 65 64  20 74 68 65 6e 20 65 6e  | pressed then en|
000021c0  74 65 72 20 61 20 6c 6f  6f 70 20 77 61 69 74 69  |ter a loop waiti|
000021d0  6e 67 20 66 6f 72 20 74  68 65 20 6e 65 78 74 20  |ng for the next |
000021e0  6b 65 79 20 74 6f 20 62  65 20 70 72 65 73 73 65  |key to be presse|
000021f0  64 2e 0a 0a 4b 45 59 20  20 20 20 5b 20 2d 3e 20  |d...KEY    [ -> |
00002200  57 39 61 20 5d 20 28 6d  61 69 6e 29 20 77 61 69  |W9a ] (main) wai|
00002210  74 20 66 6f 72 20 61 20  6b 65 79 20 74 6f 20 62  |t for a key to b|
00002220  65 20 70 72 65 73 73 65  64 20 61 6e 64 20 74 68  |e pressed and th|
00002230  65 20 70 75 73 68 20 74  68 65 20 6c 6f 77 65 73  |e push the lowes|
00002240  74 20 39 20 62 69 74 73  20 6f 6e 74 6f 20 74 68  |t 9 bits onto th|
00002250  65 20 73 74 61 63 6b 2e  0a 0a 49 4e 4b 45 59 20  |e stack...INKEY |
00002260  20 5b 20 57 33 32 61 20  2d 3e 20 57 39 62 20 5d  | [ W32a -> W9b ]|
00002270  20 28 6d 61 69 6e 29 20  77 61 69 74 20 66 6f 72  | (main) wait for|
00002280  20 61 20 6b 65 79 20 74  6f 20 62 65 20 70 72 65  | a key to be pre|
00002290  73 73 65 64 20 66 6f 72  20 74 68 65 20 6e 75 6d  |ssed for the num|
000022a0  62 65 72 20 6f 66 20 63  65 6e 74 69 73 65 63 6f  |ber of centiseco|
000022b0  6e 64 73 20 67 69 76 65  6e 20 62 79 20 57 33 32  |nds given by W32|
000022c0  61 20 61 6e 64 20 74 68  65 20 70 75 73 68 20 74  |a and the push t|
000022d0  68 65 20 6c 6f 77 65 73  74 20 39 20 62 69 74 73  |he lowest 9 bits|
000022e0  20 6f 6e 74 6f 20 74 68  65 20 73 74 61 63 6b 2e  | onto the stack.|
000022f0  0a 0a 54 41 42 20 20 20  20 5b 20 57 33 32 61 20  |..TAB    [ W32a |
00002300  57 33 32 62 20 2d 3e 20  5d 20 28 6d 61 69 6e 29  |W32b -> ] (main)|
00002310  20 6d 6f 76 65 20 74 6f  20 63 68 61 72 61 63 74  | move to charact|
00002320  65 72 20 70 6f 73 69 74  69 6f 6e 20 58 3d 57 33  |er position X=W3|
00002330  32 61 2c 20 59 3d 57 33  32 62 20 77 68 65 72 65  |2a, Y=W32b where|
00002340  20 28 30 2c 30 29 20 69  73 20 74 68 65 20 74 6f  | (0,0) is the to|
00002350  70 20 6c 65 66 74 20 63  6f 72 6e 65 72 20 6f 66  |p left corner of|
00002360  20 74 68 65 20 73 63 72  65 65 6e 2e 0a 0a 53 50  | the screen...SP|
00002370  41 43 45 20 20 5b 20 2d  3e 20 5d 20 28 6d 61 69  |ACE  [ -> ] (mai|
00002380  6e 29 20 77 72 69 74 65  20 61 20 73 70 61 63 65  |n) write a space|
00002390  20 63 68 61 72 61 63 74  65 72 20 74 68 65 20 74  | character the t|
000023a0  68 65 20 63 75 72 72 65  6e 74 20 6f 75 74 70 75  |he current outpu|
000023b0  74 20 73 74 72 65 61 6d  73 2e 20 45 71 75 69 76  |t streams. Equiv|
000023c0  61 6c 65 6e 74 20 6f 66  20 3a 20 53 50 41 43 45  |alent of : SPACE|
000023d0  20 33 32 20 45 43 48 4f  20 3b 0a 0a 58 4f 52 20  | 32 ECHO ;..XOR |
000023e0  20 20 20 5b 20 57 33 32  61 20 57 33 32 62 20 2d  |   [ W32a W32b -|
000023f0  3e 20 57 33 32 63 20 5d  20 28 6d 61 69 6e 29 20  |> W32c ] (main) |
00002400  64 6f 65 73 20 61 20 62  69 74 77 69 73 65 20 6c  |does a bitwise l|
00002410  6f 67 69 63 61 6c 20 58  4f 52 20 28 6f 72 20 45  |ogical XOR (or E|
00002420  4f 52 20 69 66 20 79 6f  75 20 70 72 65 66 65 72  |OR if you prefer|
00002430  29 20 6f 6e 20 74 68 65  20 74 6f 70 20 74 77 6f  |) on the top two|
00002440  20 73 74 61 63 6b 20 65  6e 74 72 69 65 73 20 61  | stack entries a|
00002450  6e 64 20 70 75 73 68 65  73 20 74 68 65 20 72 65  |nd pushes the re|
00002460  73 75 6c 74 2e 0a 0a 41  42 4f 52 54 20 20 5b 20  |sult...ABORT  [ |
00002470  2d 3e 20 5d 20 28 6d 61  69 6e 29 20 61 62 6f 72  |-> ] (main) abor|
00002480  74 73 20 74 68 65 20 63  75 72 72 65 6e 74 20 6f  |ts the current o|
00002490  70 65 72 61 74 69 6f 6e  20 61 6e 64 20 72 65 73  |peration and res|
000024a0  65 74 73 20 74 68 65 20  46 4f 52 54 48 20 73 79  |ets the FORTH sy|
000024b0  73 74 65 6d 2e 20 52 65  69 6e 69 74 69 61 6c 69  |stem. Reinitiali|
000024c0  73 65 73 20 6f 75 74 70  75 74 20 73 74 72 65 61  |ses output strea|
000024d0  6d 2c 20 73 74 61 63 6b  73 2c 20 63 6f 6d 70 69  |m, stacks, compi|
000024e0  6c 65 72 20 76 61 72 69  61 62 6c 65 73 2c 62 75  |ler variables,bu|
000024f0  74 20 6c 65 61 76 65 73  20 74 68 65 20 64 69 63  |t leaves the dic|
00002500  74 69 6f 6e 61 72 69 65  73 20 61 6c 6f 6e 65 2e  |tionaries alone.|
00002510  0a 0a 32 4f 56 45 52 20  20 5b 20 57 33 32 61 20  |..2OVER  [ W32a |
00002520  57 33 32 62 20 57 33 32  63 20 2d 3e 20 57 33 32  |W32b W32c -> W32|
00002530  61 20 57 33 32 62 20 57  33 32 63 20 57 33 32 61  |a W32b W32c W32a|
00002540  20 5d 20 28 6d 61 69 6e  29 20 64 75 70 6c 69 63  | ] (main) duplic|
00002550  61 74 65 73 20 74 68 65  20 74 68 69 72 64 20 73  |ates the third s|
00002560  74 61 63 6b 20 65 6e 74  72 79 20 6f 6e 74 6f 20  |tack entry onto |
00002570  74 68 65 20 54 4f 53 2e  0a 0a 4f 56 45 52 20 20  |the TOS...OVER  |
00002580  20 5b 20 57 33 32 61 20  57 33 32 62 20 2d 3e 20  | [ W32a W32b -> |
00002590  57 33 32 61 20 57 33 32  62 20 57 33 32 61 20 5d  |W32a W32b W32a ]|
000025a0  20 28 73 70 65 63 69 61  6c 29 20 28 6d 61 69 6e  | (special) (main|
000025b0  29 20 64 75 70 6c 69 63  61 74 65 73 20 74 68 65  |) duplicates the|
000025c0  20 73 65 63 6f 6e 64 20  73 74 61 63 6b 20 65 6e  | second stack en|
000025d0  74 72 79 20 6f 6e 74 6f  20 74 68 65 20 54 4f 53  |try onto the TOS|
000025e0  2e 0a 0a 32 53 57 41 50  20 20 5b 20 57 33 32 61  |...2SWAP  [ W32a|
000025f0  20 57 33 32 62 20 57 33  32 63 20 2d 3e 20 57 33  | W32b W32c -> W3|
00002600  32 63 20 57 33 32 62 20  57 33 32 61 20 5d 20 28  |2c W32b W32a ] (|
00002610  6d 61 69 6e 29 20 69 6e  74 65 72 63 68 61 6e 67  |main) interchang|
00002620  65 73 20 74 68 65 20 74  68 69 72 64 20 73 74 61  |es the third sta|
00002630  63 6b 20 65 6e 74 72 79  20 61 6e 64 20 74 68 65  |ck entry and the|
00002640  20 54 4f 53 2e 0a 0a 53  57 41 50 20 20 20 5b 20  | TOS...SWAP   [ |
00002650  57 33 32 61 20 57 33 32  62 20 2d 3e 20 57 33 32  |W32a W32b -> W32|
00002660  62 20 57 33 32 61 20 5d  20 28 73 70 65 63 69 61  |b W32a ] (specia|
00002670  6c 29 20 28 6d 61 69 6e  29 20 69 6e 74 65 72 63  |l) (main) interc|
00002680  68 61 6e 67 65 73 20 74  68 65 20 73 65 63 6f 6e  |hanges the secon|
00002690  64 20 73 74 61 63 6b 20  65 6e 74 72 79 20 61 6e  |d stack entry an|
000026a0  64 20 74 68 65 20 54 4f  53 2e 0a 0a 4c 52 4f 54  |d the TOS...LROT|
000026b0  20 20 20 5b 20 57 33 32  61 20 57 33 32 62 20 57  |   [ W32a W32b W|
000026c0  33 32 63 20 2d 3e 20 57  33 32 63 20 57 33 32 61  |32c -> W32c W32a|
000026d0  20 57 33 32 62 20 5d 20  28 6d 61 69 6e 29 20 72  | W32b ] (main) r|
000026e0  6f 74 61 74 65 20 74 68  65 20 74 6f 70 20 74 68  |otate the top th|
000026f0  72 65 65 20 73 74 61 63  6b 20 65 6e 74 72 69 65  |ree stack entrie|
00002700  73 20 28 65 2e 67 2e 20  31 20 32 20 33 20 52 4f  |s (e.g. 1 2 3 RO|
00002710  54 20 20 67 69 76 65 73  20 32 20 31 20 33 29 2e  |T  gives 2 1 3).|
00002720  0a 0a 52 52 4f 54 20 20  20 5b 20 57 33 32 61 20  |..RROT   [ W32a |
00002730  57 33 32 62 20 57 33 32  63 20 2d 3e 20 57 33 32  |W32b W32c -> W32|
00002740  62 20 57 33 32 63 20 57  33 32 61 20 5d 20 28 6d  |b W32c W32a ] (m|
00002750  61 69 6e 29 20 72 6f 74  61 74 65 20 74 68 65 20  |ain) rotate the |
00002760  74 6f 70 20 74 68 72 65  65 20 73 74 61 63 6b 20  |top three stack |
00002770  65 6e 74 72 69 65 73 20  28 65 2e 67 2e 20 31 20  |entries (e.g. 1 |
00002780  32 20 33 20 52 4f 54 20  20 67 69 76 65 73 20 31  |2 3 ROT  gives 1|
00002790  20 33 20 32 29 2e 0a 0a  44 55 50 20 20 20 20 5b  | 3 2)...DUP    [|
000027a0  20 57 33 32 61 20 2d 3e  20 57 33 32 61 20 57 33  | W32a -> W32a W3|
000027b0  32 61 20 5d 20 28 73 70  65 63 69 61 6c 29 20 28  |2a ] (special) (|
000027c0  6d 61 69 6e 29 20 64 75  70 6c 69 63 61 74 65 73  |main) duplicates|
000027d0  20 74 68 65 20 54 4f 53  2c 20 63 72 65 61 74 69  | the TOS, creati|
000027e0  6e 67 20 74 77 6f 20 77  6f 72 64 73 20 74 68 65  |ng two words the|
000027f0  20 77 69 74 68 20 74 68  65 20 73 61 6d 65 20 76  | with the same v|
00002800  61 6c 75 65 2e 0a 0a 32  44 55 50 20 20 20 5b 20  |alue...2DUP   [ |
00002810  57 33 32 61 20 2d 3e 20  57 33 32 61 20 57 33 32  |W32a -> W32a W32|
00002820  61 20 57 33 32 61 20 5d  20 28 6d 61 69 6e 29 20  |a W32a ] (main) |
00002830  64 75 70 6c 69 63 61 74  65 73 20 74 68 65 20 54  |duplicates the T|
00002840  4f 53 20 74 77 69 63 65  2c 20 63 72 65 61 74 69  |OS twice, creati|
00002850  6e 67 20 74 68 72 65 65  20 77 6f 72 64 73 20 74  |ng three words t|
00002860  68 65 20 77 69 74 68 20  74 68 65 20 73 61 6d 65  |he with the same|
00002870  20 76 61 6c 75 65 2e 0a  0a 54 52 55 45 20 20 20  | value...TRUE   |
00002880  5b 20 2d 3e 20 57 33 32  61 20 5d 20 28 6d 61 69  |[ -> W32a ] (mai|
00002890  6e 29 20 70 75 73 68 65  73 20 61 20 54 52 55 45  |n) pushes a TRUE|
000028a0  20 76 61 6c 75 65 20 6f  6e 74 6f 20 74 68 65 20  | value onto the |
000028b0  73 74 61 63 6b 2c 20 65  71 75 69 76 61 6c 65 6e  |stack, equivalen|
000028c0  74 20 74 6f 20 3a 20 54  52 55 45 20 2d 31 20 3b  |t to : TRUE -1 ;|
000028d0  0a 0a 46 41 4c 53 45 20  20 5b 20 2d 3e 20 57 33  |..FALSE  [ -> W3|
000028e0  32 61 20 5d 20 28 6d 61  69 6e 29 20 70 75 73 68  |2a ] (main) push|
000028f0  65 73 20 61 20 46 41 4c  53 45 20 76 61 6c 75 65  |es a FALSE value|
00002900  20 6f 6e 74 6f 20 74 68  65 20 73 74 61 63 6b 2c  | onto the stack,|
00002910  20 65 71 75 69 76 61 6c  65 6e 74 20 74 6f 20 3a  | equivalent to :|
00002920  20 46 41 4c 53 45 20 2d  31 20 3b 0a 0a 53 54 41  | FALSE -1 ;..STA|
00002930  54 45 20 20 5b 20 2d 3e  20 41 33 32 61 20 5d 20  |TE  [ -> A32a ] |
00002940  28 6d 61 69 6e 29 20 70  75 73 68 65 73 20 74 68  |(main) pushes th|
00002950  65 20 61 64 64 72 65 73  73 20 6f 66 20 74 68 65  |e address of the|
00002960  20 53 54 41 54 45 20 76  61 72 69 61 62 6c 65 20  | STATE variable |
00002970  6f 6e 74 6f 20 74 68 65  20 73 74 61 63 6b 2e 20  |onto the stack. |
00002980  54 68 65 20 53 54 41 54  45 20 76 61 72 69 61 62  |The STATE variab|
00002990  6c 65 20 69 73 20 75 73  65 64 20 74 6f 20 69 6e  |le is used to in|
000029a0  64 69 63 61 74 65 20 77  65 74 68 65 72 20 61 20  |dicate wether a |
000029b0  77 6f 72 64 20 73 68 6f  75 6c 64 20 62 65 20 63  |word should be c|
000029c0  6f 6d 70 69 6c 65 64 20  6f 72 20 65 78 65 63 75  |ompiled or execu|
000029d0  74 65 64 2e 20 41 6c 6c  20 74 68 65 20 6d 61 69  |ted. All the mai|
000029e0  6e 20 76 6f 63 61 62 75  6c 61 72 79 20 77 6f 72  |n vocabulary wor|
000029f0  64 73 20 73 68 6f 75 6c  64 20 62 65 20 65 78 65  |ds should be exe|
00002a00  63 75 74 65 64 20 69 6e  20 69 6e 74 65 72 70 72  |cuted in interpr|
00002a10  65 74 20 6d 6f 64 65 2c  20 62 75 74 20 6f 6e 6c  |et mode, but onl|
00002a20  79 20 74 68 6f 73 65 20  69 6e 20 74 68 65 20 63  |y those in the c|
00002a30  6f 6d 70 69 6c 65 72 20  64 69 63 74 69 6f 6e 61  |ompiler dictiona|
00002a40  72 79 20 69 6e 20 63 6f  6d 70 69 6c 65 20 6d 6f  |ry in compile mo|
00002a50  64 65 2e 20 49 6e 20 63  6f 6d 70 69 6c 65 20 6d  |de. In compile m|
00002a60  6f 64 65 20 74 68 6f 73  65 20 77 6f 72 64 73 20  |ode those words |
00002a70  6e 6f 74 20 69 6e 20 74  68 65 20 63 6f 6d 70 69  |not in the compi|
00002a80  6c 65 72 20 64 69 63 74  69 6f 6e 61 72 79 20 73  |ler dictionary s|
00002a90  68 6f 75 6c 64 20 62 65  20 63 6f 6d 70 69 6c 65  |hould be compile|
00002aa0  64 20 69 6e 74 6f 20 74  68 65 20 77 6f 72 64 20  |d into the word |
00002ab0  63 75 72 72 65 6e 74 6c  79 20 62 65 69 6e 67 20  |currently being |
00002ac0  64 65 66 69 6e 65 64 2e  0a 0a 42 41 53 45 20 20  |defined...BASE  |
00002ad0  20 5b 20 2d 3e 20 41 33  32 61 20 5d 20 28 6d 61  | [ -> A32a ] (ma|
00002ae0  69 6e 29 20 70 6c 61 63  65 73 20 74 68 65 20 61  |in) places the a|
00002af0  64 64 72 65 73 73 20 6f  66 20 74 68 65 20 6e 75  |ddress of the nu|
00002b00  6d 62 65 72 20 62 61 73  65 20 6f 6e 74 6f 20 74  |mber base onto t|
00002b10  68 65 20 73 74 61 63 6b  2c 20 63 75 72 72 65 6e  |he stack, curren|
00002b20  74 6c 79 20 74 68 65 20  6f 6e 6c 79 20 6e 75 6d  |tly the only num|
00002b30  62 65 72 20 62 61 73 65  20 77 68 69 63 68 20 73  |ber base which s|
00002b40  68 6f 75 6c 64 20 62 65  20 75 73 65 64 20 69 73  |hould be used is|
00002b50  20 64 65 63 69 6d 61 6c  2e 0a 0a 4d 4f 44 45 20  | decimal...MODE |
00002b60  20 20 5b 20 2d 3e 20 42  33 32 61 20 5d 20 28 6d  |  [ -> B32a ] (m|
00002b70  61 69 6e 29 20 69 66 20  74 68 65 20 46 4f 52 54  |ain) if the FORT|
00002b80  48 20 73 79 73 74 65 6d  20 69 73 20 69 6e 74 65  |H system is inte|
00002b90  72 70 72 65 74 69 76 65  20 6d 6f 64 65 20 74 68  |rpretive mode th|
00002ba0  65 6e 20 70 75 74 20 30  20 28 46 41 4c 53 45 29  |en put 0 (FALSE)|
00002bb0  20 6f 6e 74 6f 20 74 68  65 20 73 74 61 63 6b 20  | onto the stack |
00002bc0  6f 74 68 65 72 77 69 73  65 20 69 74 20 69 73 20  |otherwise it is |
00002bd0  69 6e 20 63 6f 6d 70 69  6c 65 20 6d 6f 64 65 20  |in compile mode |
00002be0  61 6e 64 20 73 6f 20 69  74 20 70 6c 61 63 65 73  |and so it places|
00002bf0  20 2d 31 20 28 46 41 4c  53 45 29 20 6f 6e 74 6f  | -1 (FALSE) onto|
00002c00  20 74 68 65 20 73 74 61  63 6b 2e 0a 0a 45 4e 54  | the stack...ENT|
00002c10  52 59 20 20 5b 20 41 33  32 61 20 2d 3e 20 5d 20  |RY  [ A32a -> ] |
00002c20  28 6d 61 69 6e 29 20 0a  0a 4c 49 4e 45 5f 42 55  |(main) ..LINE_BU|
00002c30  46 46 45 52 20 20 5b 20  2d 3e 20 41 33 32 61 20  |FFER  [ -> A32a |
00002c40  5d 20 28 6d 61 69 6e 29  20 70 6c 61 63 65 73 20  |] (main) places |
00002c50  74 68 65 20 61 64 64 72  65 73 73 20 6f 66 20 74  |the address of t|
00002c60  68 65 20 70 6f 69 6e 74  65 72 20 74 6f 20 74 68  |he pointer to th|
00002c70  65 20 63 75 72 72 65 6e  74 20 69 6e 70 75 74 20  |e current input |
00002c80  6c 69 6e 65 20 6f 6e 20  74 68 65 20 73 74 61 63  |line on the stac|
00002c90  6b 2e 0a 0a 54 4f 4b 45  4e 5f 42 55 46 46 45 52  |k...TOKEN_BUFFER|
00002ca0  20 5b 20 2d 3e 20 41 33  32 61 20 5d 20 28 6d 61  | [ -> A32a ] (ma|
00002cb0  69 6e 29 20 70 6c 61 63  65 73 20 74 68 65 20 61  |in) places the a|
00002cc0  64 64 72 65 73 73 20 6f  66 20 74 68 65 20 70 6f  |ddress of the po|
00002cd0  69 6e 74 65 72 20 74 6f  20 74 68 65 20 63 75 72  |inter to the cur|
00002ce0  72 65 6e 74 6c 79 20 64  65 63 6f 64 65 64 20 74  |rently decoded t|
00002cf0  6f 6b 65 6e 2e 0a 0a 43  4f 44 45 20 20 20 5b 20  |oken...CODE   [ |
00002d00  2d 3e 20 41 33 32 61 20  5d 20 28 6d 61 69 6e 29  |-> A32a ] (main)|
00002d10  20 70 6c 61 63 65 73 20  74 68 65 20 61 64 64 72  | places the addr|
00002d20  65 73 73 20 6f 66 20 74  68 65 20 63 6f 64 65 20  |ess of the code |
00002d30  70 6f 69 6e 74 65 72 20  6f 6e 74 6f 20 74 68 65  |pointer onto the|
00002d40  20 54 4f 53 2e 20 54 68  65 20 63 6f 64 65 20 70  | TOS. The code p|
00002d50  6f 69 6e 74 65 72 20 70  6f 69 6e 74 73 20 74 6f  |ointer points to|
00002d60  20 74 68 65 20 70 6c 61  63 65 20 77 68 65 72 65  | the place where|
00002d70  20 74 68 65 20 6e 65 78  74 20 62 79 74 65 20 28  | the next byte (|
00002d80  77 6f 72 64 29 20 6f 66  20 63 6f 64 65 20 77 69  |word) of code wi|
00002d90  6c 6c 20 62 65 20 63 6f  6d 70 69 6c 65 64 20 74  |ll be compiled t|
00002da0  6f 2e 0a 0a 43 4f 52 45  20 20 20 5b 20 2d 3e 20  |o...CORE   [ -> |
00002db0  5d 20 28 6d 61 69 6e 29  20 73 65 74 20 74 68 65  |] (main) set the|
00002dc0  20 64 69 63 74 69 6f 6e  61 72 69 65 73 20 62 61  | dictionaries ba|
00002dd0  63 6b 20 74 6f 20 74 68  65 20 64 65 66 61 75 6c  |ck to the defaul|
00002de0  74 20 64 69 63 74 69 6f  6e 61 72 69 65 73 2c 20  |t dictionaries, |
00002df0  69 2e 65 20 66 6f 72 67  65 74 73 20 61 6c 6c 20  |i.e forgets all |
00002e00  75 73 65 72 20 64 65 66  69 6e 65 64 20 77 6f 72  |user defined wor|
00002e10  64 73 2e 0a 0a 43 4f 4e  54 45 58 54 20 20 5b 20  |ds...CONTEXT  [ |
00002e20  2d 3e 20 41 33 32 61 20  5d 20 28 6d 61 69 6e 29  |-> A32a ] (main)|
00002e30  20 70 75 73 68 65 73 20  74 68 65 20 61 64 64 72  | pushes the addr|
00002e40  65 73 73 20 6f 66 20 74  68 65 20 61 64 64 72 65  |ess of the addre|
00002e50  73 73 20 6f 66 20 74 68  65 20 64 69 63 74 69 6f  |ss of the dictio|
00002e60  6e 61 72 79 20 74 6f 20  73 65 61 72 63 68 20 69  |nary to search i|
00002e70  6e 69 74 69 61 6c 6c 79  20 66 6f 72 20 77 6f 72  |nitially for wor|
00002e80  64 20 64 65 66 69 6e 69  74 69 6f 6e 73 2e 0a 0a  |d definitions...|
00002e90  43 55 52 52 45 4e 54 20  20 5b 20 2d 3e 20 41 33  |CURRENT  [ -> A3|
00002ea0  32 61 20 5d 20 28 6d 61  69 6e 29 20 70 75 73 68  |2a ] (main) push|
00002eb0  65 73 20 74 68 65 20 61  64 64 72 65 73 73 20 6f  |es the address o|
00002ec0  66 20 74 68 65 20 63 75  72 72 65 6e 74 20 75 73  |f the current us|
00002ed0  65 72 20 64 69 63 74 69  6f 6e 61 72 79 20 6f 6e  |er dictionary on|
00002ee0  74 6f 20 74 68 65 20 73  74 61 63 6b 2e 0a 0a 43  |to the stack...C|
00002ef0  4f 4d 50 49 4c 45 52 20  5b 20 2d 3e 20 41 33 32  |OMPILER [ -> A32|
00002f00  61 20 5d 20 28 6d 61 69  6e 29 20 70 75 73 68 65  |a ] (main) pushe|
00002f10  73 20 74 68 65 20 61 64  64 72 65 73 73 20 6f 66  |s the address of|
00002f20  20 74 68 65 20 63 6f 6d  70 69 6c 65 72 20 64 69  | the compiler di|
00002f30  63 74 69 6f 6e 61 72 79  20 6f 6e 74 6f 20 74 68  |ctionary onto th|
00002f40  65 20 73 74 61 63 6b 2e  0a 0a 53 50 45 43 49 41  |e stack...SPECIA|
00002f50  4c 20 20 5b 20 2d 3e 20  41 33 32 61 20 5d 20 28  |L  [ -> A32a ] (|
00002f60  6d 61 69 6e 29 20 70 75  73 68 65 73 20 74 68 65  |main) pushes the|
00002f70  20 61 64 64 72 65 73 73  20 6f 66 20 74 68 65 20  | address of the |
00002f80  73 70 65 63 69 61 6c 20  64 69 63 74 69 6f 6e 61  |special dictiona|
00002f90  72 79 20 6f 6e 74 6f 20  74 68 65 20 73 74 61 63  |ry onto the stac|
00002fa0  6b 2e 0a 0a 53 45 41 52  43 48 20 20 20 5b 20 41  |k...SEARCH   [ A|
00002fb0  33 32 61 20 2d 3e 20 41  33 32 62 20 54 52 55 45  |32a -> A32b TRUE|
00002fc0  20 20 20 6f 72 20 20 46  41 4c 53 45 20 5d 20 28  |   or  FALSE ] (|
00002fd0  6d 61 69 6e 29 20 73 65  61 63 68 65 73 20 74 68  |main) seaches th|
00002fe0  65 20 64 69 63 74 69 6f  6e 61 72 79 20 66 72 6f  |e dictionary fro|
00002ff0  6d 20 61 64 64 72 65 73  73 20 41 33 32 61 20 6c  |m address A32a l|
00003000  6f 6f 6b 69 6e 67 20 66  6f 72 20 74 68 65 20 74  |ooking for the t|
00003010  6f 6b 65 6e 20 77 68 69  63 68 20 69 73 20 69 6e  |oken which is in|
00003020  20 74 68 65 20 54 4f 4b  45 4e 5f 42 55 46 46 45  | the TOKEN_BUFFE|
00003030  52 2e 20 49 46 20 74 68  65 20 74 6f 6b 65 6e 20  |R. IF the token |
00003040  69 73 20 66 6f 75 6e 64  20 74 68 65 20 70 6c 61  |is found the pla|
00003050  63 65 20 74 68 65 20 65  78 65 63 75 74 65 20 61  |ce the execute a|
00003060  64 64 72 65 73 73 20 6f  66 20 74 68 65 20 74 6f  |ddress of the to|
00003070  6b 65 6e 20 6f 6e 74 6f  20 74 68 65 20 73 74 61  |ken onto the sta|
00003080  63 6b 20 61 6e 64 20 74  68 65 6e 20 70 6c 61 63  |ck and then plac|
00003090  65 20 61 20 2d 31 20 28  54 52 55 45 29 20 6f 6e  |e a -1 (TRUE) on|
000030a0  74 6f 20 74 68 65 0a 73  74 61 63 6b 2e 20 49 66  |to the.stack. If|
000030b0  20 74 68 65 20 74 6f 6b  65 6e 20 69 73 20 6e 6f  | the token is no|
000030c0  74 20 66 6f 75 6e 64 20  6a 75 73 74 20 70 75 74  |t found just put|
000030d0  20 61 20 30 20 28 46 41  4c 53 45 29 20 6f 6e 74  | a 0 (FALSE) ont|
000030e0  6f 20 74 68 65 20 73 74  61 63 6b 2e 0a 0a 51 55  |o the stack...QU|
000030f0  45 53 54 49 4f 4e 20 20  20 20 20 5b 20 2d 3e 20  |ESTION     [ -> |
00003100  41 33 32 61 20 5d 20 28  6d 61 69 6e 29 20 70 6c  |A32a ] (main) pl|
00003110  61 63 65 73 20 74 68 65  20 61 64 64 72 65 73 73  |aces the address|
00003120  20 6f 66 20 74 68 65 20  73 74 72 69 6e 67 20 22  | of the string "|
00003130  3c 63 72 3e 20 3f 20 22  20 6f 6e 74 6f 20 74 68  |<cr> ? " onto th|
00003140  65 20 73 74 61 63 6b 2e  0a 0a 45 58 45 43 55 54  |e stack...EXECUT|
00003150  45 20 20 20 20 20 20 5b  20 41 33 32 61 20 2d 3e  |E      [ A32a ->|
00003160  20 5d 20 28 6d 61 69 6e  29 20 65 78 65 63 75 74  | ] (main) execut|
00003170  65 73 20 74 68 65 20 63  6f 64 65 20 61 74 20 61  |es the code at a|
00003180  64 64 72 65 73 73 20 41  33 32 61 2c 20 77 68 69  |ddress A32a, whi|
00003190  63 68 20 63 6f 75 6c 64  20 6f 66 20 63 61 75 73  |ch could of caus|
000031a0  65 20 63 68 61 6e 67 65  20 74 68 65 20 73 74 61  |e change the sta|
000031b0  63 6b 2e 0a 0a 49 4e 4c  49 4e 45 20 20 20 20 20  |ck...INLINE     |
000031c0  20 20 5b 20 2d 3e 20 5d  20 28 6d 61 69 6e 29 20  |  [ -> ] (main) |
000031d0  72 65 61 64 73 20 61 20  6c 69 6e 65 20 28 75 70  |reads a line (up|
000031e0  20 74 6f 20 32 35 35 20  63 68 61 72 61 63 74 65  | to 255 characte|
000031f0  72 73 29 20 69 6e 74 6f  20 74 68 65 20 62 75 66  |rs) into the buf|
00003200  66 65 72 20 70 6f 69 6e  74 65 64 20 74 6f 20 62  |fer pointed to b|
00003210  79 20 74 68 65 20 4c 49  4e 45 5f 42 55 46 46 45  |y the LINE_BUFFE|
00003220  52 20 76 61 72 69 61 62  6c 65 20 66 72 6f 6d 20  |R variable from |
00003230  74 68 65 20 63 75 72 72  65 6e 74 6c 79 20 73 65  |the currently se|
00003240  6c 65 63 74 65 64 20 69  6e 70 75 74 20 73 74 65  |lected input ste|
00003250  61 6d 2e 20 41 6c 77 61  79 73 20 65 6e 64 73 20  |am. Always ends |
00003260  74 68 65 20 6c 69 6e 65  20 77 69 74 68 20 61 20  |the line with a |
00003270  30 20 42 79 74 65 20 73  6f 20 74 68 61 74 20 54  |0 Byte so that T|
00003280  59 50 45 20 77 6f 72 6b  73 2e 0a 0a 4e 55 4d 42  |YPE works...NUMB|
00003290  45 52 20 20 20 20 20 20  20 5b 20 2d 3e 20 57 33  |ER       [ -> W3|
000032a0  32 61 20 54 52 55 45 20  20 6f 72 20 46 41 4c 53  |2a TRUE  or FALS|
000032b0  45 20 5d 20 28 6d 61 69  6e 29 20 69 66 20 74 68  |E ] (main) if th|
000032c0  65 20 74 6f 6b 65 6e 20  69 6e 20 74 68 65 20 54  |e token in the T|
000032d0  4f 4b 45 4e 5f 42 55 46  46 45 52 20 69 73 20 61  |OKEN_BUFFER is a|
000032e0  20 76 61 6c 69 64 20 6e  75 6d 62 65 72 20 69 6e  | valid number in|
000032f0  20 74 68 65 20 63 75 72  72 65 6e 74 20 6e 75 6d  | the current num|
00003300  62 65 72 20 62 61 73 65  20 28 6d 75 73 74 20 62  |ber base (must b|
00003310  65 20 64 65 63 69 6d 61  6c 20 66 6f 72 20 6e 6f  |e decimal for no|
00003320  77 29 2c 20 74 68 65 6e  20 70 6c 61 63 65 20 74  |w), then place t|
00003330  68 61 74 20 6e 75 6d 62  65 72 20 6f 6e 20 74 68  |hat number on th|
00003340  65 20 73 74 61 63 6b 20  61 6e 64 20 70 75 74 20  |e stack and put |
00003350  61 20 74 72 75 65 20 6f  6e 20 74 6f 70 2c 20 6f  |a true on top, o|
00003360  74 68 65 72 77 69 73 65  20 70 75 74 20 61 20 66  |therwise put a f|
00003370  61 6c 73 65 20 6f 6e 20  74 68 65 20 73 74 61 63  |alse on the stac|
00003380  6b 2e 0a 0a 2a 53 54 41  43 4b 20 20 20 20 20 20  |k...*STACK      |
00003390  20 5b 20 2d 3e 20 5d 20  28 6d 61 69 6e 29 20 63  | [ -> ] (main) c|
000033a0  68 65 63 6b 73 20 74 68  65 20 73 74 61 63 6b 20  |hecks the stack |
000033b0  66 6f 72 20 6f 76 65 72  66 6c 6f 77 20 2f 20 75  |for overflow / u|
000033c0  6e 64 65 72 66 6c 6f 77  2c 20 62 75 74 20 6e 6f  |nderflow, but no|
000033d0  77 20 69 6d 70 6c 65 6d  65 6e 74 65 64 20 61 74  |w implemented at|
000033e0  20 74 68 65 20 6d 6f 6d  65 6e 74 2e 0a 0a 53 45  | the moment...SE|
000033f0  54 55 50 5f 53 54 41 43  4b 20 20 5b 20 2d 3e 20  |TUP_STACK  [ -> |
00003400  5d 20 20 28 6d 61 69 6e  29 20 75 73 65 64 20 69  |]  (main) used i|
00003410  6e 20 74 68 65 20 6f 75  74 65 72 20 69 6e 74 65  |n the outer inte|
00003420  72 70 72 65 74 65 72 2f  63 6f 6d 70 69 6c 65 72  |rpreter/compiler|
00003430  20 74 6f 20 63 72 65 61  74 65 20 74 68 65 20 63  | to create the c|
00003440  6f 64 65 20 73 6f 20 74  68 61 74 20 74 68 65 20  |ode so that the |
00003450  54 4f 53 20 77 6f 75 6c  64 20 62 65 20 69 6e 20  |TOS would be in |
00003460  52 30 20 61 6e 64 20 74  68 65 20 64 61 74 61 5f  |R0 and the data_|
00003470  53 50 20 70 6f 69 6e 74  65 72 20 77 6f 75 6c 64  |SP pointer would|
00003480  20 70 6f 69 6e 74 20 74  6f 20 74 68 65 20 4e 4f  | point to the NO|
00003490  53 2e 0a 0a 43 52 45 41  54 45 5f 42 4c 20 20 20  |S...CREATE_BL   |
000034a0  20 5b 20 41 33 32 61 20  2d 3e 20 57 33 32 62 20  | [ A32a -> W32b |
000034b0  5d 20 28 6d 61 69 6e 29  20 75 73 65 64 20 69 6e  |] (main) used in|
000034c0  20 74 68 65 20 6f 75 74  65 72 20 69 6e 74 65 72  | the outer inter|
000034d0  70 72 65 74 65 72 2f 63  6f 6d 70 69 6c 65 72 20  |preter/compiler |
000034e0  74 6f 20 63 72 65 61 74  65 20 74 68 65 20 42 4c  |to create the BL|
000034f0  20 69 6e 73 74 72 75 63  74 69 6f 6e 20 74 6f 20  | instruction to |
00003500  63 61 6c 6c 20 74 68 65  20 63 6f 64 65 20 61 74  |call the code at|
00003510  20 61 64 64 72 65 73 73  20 41 33 32 61 2e 20 54  | address A32a. T|
00003520  68 69 73 20 61 73 73 75  6d 65 73 20 74 68 61 74  |his assumes that|
00003530  20 74 68 65 20 63 6f 64  65 20 70 75 74 20 61 74  | the code put at|
00003540  20 74 68 65 20 61 64 64  72 65 73 73 20 43 4f 44  | the address COD|
00003550  45 20 28 73 65 65 20 61  62 6f 76 65 29 2e 0a 0a  |E (see above)...|
00003560  54 4f 50 5f 52 45 47 20  20 20 20 20 20 5b 20 2d  |TOP_REG      [ -|
00003570  3e 20 57 33 32 61 20 5d  20 28 6d 61 69 6e 29 20  |> W32a ] (main) |
00003580  75 73 65 64 20 69 6e 20  74 68 65 20 6f 75 74 65  |used in the oute|
00003590  72 20 69 6e 74 65 72 70  72 65 74 65 72 2f 63 6f  |r interpreter/co|
000035a0  6d 70 69 6c 65 72 2e 20  54 4f 50 5f 52 45 47 20  |mpiler. TOP_REG |
000035b0  63 6f 6e 74 61 69 6e 73  20 61 20 76 61 6c 75 65  |contains a value|
000035c0  20 66 72 6f 6d 20 30 20  74 6f 20 35 2c 20 30 20  | from 0 to 5, 0 |
000035d0  6d 65 61 6e 73 20 74 68  61 74 20 74 68 65 20 54  |means that the T|
000035e0  4f 53 20 69 73 20 61 74  20 74 68 65 20 61 64 64  |OS is at the add|
000035f0  72 65 73 73 20 64 61 74  61 5f 53 50 2c 20 31 20  |ress data_SP, 1 |
00003600  6d 65 61 6e 73 20 74 68  61 74 20 69 74 20 69 73  |means that it is|
00003610  20 63 6f 6e 74 61 69 6e  65 64 20 69 6e 20 52 30  | contained in R0|
00003620  2c 20 20 2e 2e 20 35 20  6d 65 61 6e 73 20 74 68  |,  .. 5 means th|
00003630  61 74 20 69 74 20 69 73  20 63 6f 6e 74 61 69 6e  |at it is contain|
00003640  65 64 20 69 6e 20 52 34  2c 20 77 69 74 68 20 4e  |ed in R4, with N|
00003650  4f 53 20 69 6e 20 52 33  2c 20 65 74 63 2e 0a 0a  |OS in R3, etc...|
00003660  43 4f 4d 50 49 4c 45 43  4f 4e 53 54 20 5b 20 57  |COMPILECONST [ W|
00003670  33 32 61 20 2d 3e 20 5d  20 28 6d 61 69 6e 29 20  |32a -> ] (main) |
00003680  74 68 69 73 20 69 73 20  75 73 65 64 20 74 6f 20  |this is used to |
00003690  63 6f 6d 70 69 6c 65 20  61 20 63 6f 6e 73 74 61  |compile a consta|
000036a0  6e 74 20 69 6e 74 6f 20  74 68 65 20 63 6f 64 65  |nt into the code|
000036b0  2e 20 0a 0a 43 4f 4e 53  54 41 4e 54 20 20 20 20  |. ..CONSTANT    |
000036c0  20 5b 20 57 33 32 61 20  2d 3e 20 5d 20 28 6d 61  | [ W32a -> ] (ma|
000036d0  69 6e 29 20 64 65 66 69  6e 65 73 20 61 20 63 6f  |in) defines a co|
000036e0  6e 73 74 61 6e 74 20 77  68 69 63 68 20 68 61 73  |nstant which has|
000036f0  20 74 68 65 20 76 61 6c  75 65 20 57 33 32 61 2c  | the value W32a,|
00003700  20 69 2e 65 2e 20 27 33  32 20 43 4f 4e 53 54 41  | i.e. '32 CONSTA|
00003710  4e 54 20 73 70 61 63 65  27 20 20 64 65 66 69 6e  |NT space'  defin|
00003720  65 73 20 61 20 6e 65 77  20 77 6f 72 64 20 73 70  |es a new word sp|
00003730  61 63 65 20 77 68 69 63  68 20 68 61 73 20 74 68  |ace which has th|
00003740  65 20 76 61 6c 75 65 20  33 32 2e 20 57 68 65 6e  |e value 32. When|
00003750  20 73 70 61 63 65 20 69  73 20 65 78 65 63 75 74  | space is execut|
00003760  65 64 20 69 74 20 70 6c  61 63 65 73 20 74 68 65  |ed it places the|
00003770  20 76 61 6c 75 65 20 33  32 20 6f 6e 74 6f 20 74  | value 32 onto t|
00003780  68 65 20 73 74 61 63 6b  2e 0a 0a 43 43 4f 4e 53  |he stack...CCONS|
00003790  54 41 4e 54 20 20 20 20  5b 20 57 38 61 20 2d 3e  |TANT    [ W8a ->|
000037a0  20 5d 20 28 6d 61 69 6e  29 20 64 65 66 69 6e 65  | ] (main) define|
000037b0  73 20 61 20 62 79 74 65  20 28 6f 72 20 63 68 61  |s a byte (or cha|
000037c0  72 61 63 74 65 72 29 20  63 6f 6e 73 74 61 6e 74  |racter) constant|
000037d0  20 77 68 69 63 68 20 68  61 73 20 74 68 65 20 76  | which has the v|
000037e0  61 6c 75 65 20 57 33 32  61 2c 20 69 2e 65 2e 20  |alue W32a, i.e. |
000037f0  27 33 32 20 43 43 4f 4e  53 54 41 4e 54 20 73 70  |'32 CCONSTANT sp|
00003800  61 63 65 27 20 20 64 65  66 69 6e 65 73 20 61 20  |ace'  defines a |
00003810  6e 65 77 20 77 6f 72 64  20 73 70 61 63 65 20 77  |new word space w|
00003820  68 69 63 68 20 68 61 73  20 74 68 65 20 76 61 6c  |hich has the val|
00003830  75 65 20 33 32 2e 20 57  68 65 6e 20 73 70 61 63  |ue 32. When spac|
00003840  65 20 69 73 20 65 78 65  63 75 74 65 64 20 69 74  |e is executed it|
00003850  20 70 6c 61 63 65 73 20  74 68 65 20 76 61 6c 75  | places the valu|
00003860  65 20 33 32 20 6f 6e 74  6f 20 74 68 65 20 73 74  |e 32 onto the st|
00003870  61 63 6b 2e 0a 0a 56 41  52 49 41 42 4c 45 20 20  |ack...VARIABLE  |
00003880  20 20 20 5b 20 57 33 32  61 20 2d 3e 20 5d 20 28  |   [ W32a -> ] (|
00003890  6d 61 69 6e 29 20 64 65  66 69 6e 65 73 20 61 20  |main) defines a |
000038a0  76 61 72 69 61 62 6c 65  20 77 68 69 63 68 20 68  |variable which h|
000038b0  61 73 20 74 68 65 20 69  6e 69 74 69 61 6c 20 76  |as the initial v|
000038c0  61 6c 75 65 20 57 33 32  61 2c 20 69 2e 65 2e 20  |alue W32a, i.e. |
000038d0  27 33 32 20 56 41 52 49  41 42 4c 45 20 73 70 61  |'32 VARIABLE spa|
000038e0  63 65 27 20 20 64 65 66  69 6e 65 73 20 61 20 6e  |ce'  defines a n|
000038f0  65 77 20 77 6f 72 64 20  73 70 61 63 65 20 77 68  |ew word space wh|
00003900  69 63 68 20 68 61 73 20  74 68 65 20 76 61 6c 75  |ich has the valu|
00003910  65 20 33 32 2e 20 57 68  65 6e 20 73 70 61 63 65  |e 32. When space|
00003920  20 69 73 20 65 78 65 63  75 74 65 64 20 69 74 20  | is executed it |
00003930  70 6c 61 63 65 73 20 61  6e 20 61 64 64 72 65 73  |places an addres|
00003940  73 20 6f 6e 20 74 68 65  20 73 74 61 63 6b 20 77  |s on the stack w|
00003950  68 69 63 68 20 70 6f 69  6e 74 73 20 74 6f 20 61  |hich points to a|
00003960  20 77 6f 72 64 20 77 68  69 63 68 20 63 6f 6e 74  | word which cont|
00003970  61 69 6e 73 20 33 32 20  28 69 6e 69 74 69 61 6c  |ains 32 (initial|
00003980  6c 79 29 2e 0a 0a 43 56  41 52 49 41 42 4c 45 20  |ly)...CVARIABLE |
00003990  20 20 20 5b 20 57 38 61  20 2d 3e 20 5d 20 28 6d  |   [ W8a -> ] (m|
000039a0  61 69 6e 29 20 64 65 66  69 6e 65 73 20 61 20 62  |ain) defines a b|
000039b0  79 74 65 20 28 6f 72 20  63 68 61 72 61 63 74 65  |yte (or characte|
000039c0  72 29 20 76 61 72 69 61  62 6c 65 20 77 68 69 63  |r) variable whic|
000039d0  68 20 68 61 73 20 74 68  65 20 69 6e 69 74 69 61  |h has the initia|
000039e0  6c 20 76 61 6c 75 65 20  57 33 32 61 2c 20 69 2e  |l value W32a, i.|
000039f0  65 2e 20 27 33 32 20 43  56 41 52 49 41 42 4c 45  |e. '32 CVARIABLE|
00003a00  20 73 70 61 63 65 27 20  20 64 65 66 69 6e 65 73  | space'  defines|
00003a10  20 61 20 6e 65 77 20 77  6f 72 64 20 73 70 61 63  | a new word spac|
00003a20  65 20 77 68 69 63 68 20  68 61 73 20 74 68 65 20  |e which has the |
00003a30  76 61 6c 75 65 20 33 32  2e 20 57 68 65 6e 20 73  |value 32. When s|
00003a40  70 61 63 65 20 69 73 20  65 78 65 63 75 74 65 64  |pace is executed|
00003a50  20 69 74 20 70 6c 61 63  65 73 20 61 6e 20 61 64  | it places an ad|
00003a60  64 72 65 73 73 20 6f 6e  20 74 68 65 20 73 74 61  |dress on the sta|
00003a70  63 6b 20 77 68 69 63 68  20 70 6f 69 6e 74 73 20  |ck which points |
00003a80  74 6f 20 61 20 77 6f 72  64 20 77 68 69 63 68 20  |to a word which |
00003a90  63 6f 6e 74 61 69 6e 73  20 33 32 20 28 69 6e 69  |contains 32 (ini|
00003aa0  74 69 61 6c 6c 79 29 2e  0a 0a 56 41 52 53 20 20  |tially)...VARS  |
00003ab0  20 20 20 20 20 20 20 5b  20 2d 3e 20 41 33 32 61  |       [ -> A32a|
00003ac0  20 5d 20 28 6d 61 69 6e  29 20 70 75 73 68 65 73  | ] (main) pushes|
00003ad0  20 74 68 65 20 61 64 64  72 65 73 73 20 74 68 61  | the address tha|
00003ae0  74 20 74 68 65 20 6e 65  78 74 20 76 61 72 69 61  |t the next varia|
00003af0  62 6c 65 20 77 69 6c 6c  20 62 65 20 70 6c 61 63  |ble will be plac|
00003b00  65 64 20 61 74 2e 0a 0a  49 3e 20 20 20 5b 20 2d  |ed at...I>   [ -|
00003b10  3e 20 57 33 32 61 20 5d  20 28 6d 61 69 6e 29 20  |> W32a ] (main) |
00003b20  28 73 70 65 63 69 61 6c  29 20 54 4f 53 20 3a 3d  |(special) TOS :=|
00003b30  20 69 6e 6e 65 72 6d 6f  73 74 20 6c 6f 6f 70 20  | innermost loop |
00003b40  69 6e 64 65 78 2e 20 20  20 20 20 20 20 20 20 20  |index.          |
00003b50  20 20 20 20 20 20 20 0a  0a 4a 3e 20 20 20 5b 20  |       ..J>   [ |
00003b60  2d 3e 20 57 33 32 61 20  5d 20 28 6d 61 69 6e 29  |-> W32a ] (main)|
00003b70  20 28 73 70 65 63 69 61  6c 29 20 54 4f 53 20 3a  | (special) TOS :|
00003b80  3d 20 32 6e 64 20 69 6e  6e 65 72 6d 6f 73 74 20  |= 2nd innermost |
00003b90  6c 6f 6f 70 20 69 6e 64  65 78 2e 0a 0a 4b 3e 20  |loop index...K> |
00003ba0  20 20 5b 20 2d 3e 20 57  33 32 61 20 5d 20 28 6d  |  [ -> W32a ] (m|
00003bb0  61 69 6e 29 20 28 73 70  65 63 69 61 6c 29 20 54  |ain) (special) T|
00003bc0  4f 53 20 3a 3d 20 33 72  64 20 69 6e 6e 65 72 6d  |OS := 3rd innerm|
00003bd0  6f 73 74 20 6c 6f 6f 70  20 69 6e 64 65 78 2e 0a  |ost loop index..|
00003be0  0a 54 49 4d 45 20 5b 20  2d 3e 20 57 33 32 61 5d  |.TIME [ -> W32a]|
00003bf0  20 28 6d 61 69 6e 29 20  74 68 65 20 76 61 6c 75  | (main) the valu|
00003c00  65 20 6f 66 20 74 68 65  20 6e 75 6d 62 65 72 20  |e of the number |
00003c10  6f 66 20 63 65 6e 74 69  2d 73 65 63 6f 6e 64 73  |of centi-seconds|
00003c20  20 74 68 61 74 20 68 61  76 65 20 65 6c 61 70 73  | that have elaps|
00003c30  65 64 20 73 69 6e 63 65  20 74 68 65 20 6c 61 73  |ed since the las|
00003c40  74 20 74 69 6d 65 20 74  68 65 20 63 6c 6f 63 6b  |t time the clock|
00003c50  20 77 61 73 20 73 65 74  20 74 6f 20 7a 65 72 6f  | was set to zero|
00003c60  2e 0a 0a 41 52 52 41 59  20 5b 20 57 33 32 61 20  |...ARRAY [ W32a |
00003c70  2d 3e 20 5d 20 28 6d 61  69 6e 29 20 61 20 64 65  |-> ] (main) a de|
00003c80  66 69 6e 69 6e 67 20 77  6f 72 64 20 75 73 65 64  |fining word used|
00003c90  20 74 6f 20 63 72 65 61  74 65 20 61 6e 20 61 72  | to create an ar|
00003ca0  72 61 79 20 57 33 32 61  20 77 6f 72 64 73 20 6c  |ray W32a words l|
00003cb0  6f 6e 67 20 28 65 2e 67  2e 20 31 35 20 41 52 52  |ong (e.g. 15 ARR|
00003cc0  41 59 20 54 68 69 73 41  72 72 61 79 20 20 77 68  |AY ThisArray  wh|
00003cd0  69 63 68 20 77 6f 75 6c  64 20 63 72 65 61 74 65  |ich would create|
00003ce0  20 61 6e 20 61 72 72 61  79 20 31 35 20 77 6f 72  | an array 15 wor|
00003cf0  64 73 20 3d 36 30 20 62  79 74 65 73 20 6c 6f 6e  |ds =60 bytes lon|
00003d00  67 29 2e 20 0a 0a 43 41  52 52 41 59 20 5b 20 57  |g). ..CARRAY [ W|
00003d10  33 32 61 20 2d 3e 20 5d  20 28 6d 61 69 6e 29 20  |32a -> ] (main) |
00003d20  61 20 64 65 66 69 6e 69  6e 67 20 77 6f 72 64 20  |a defining word |
00003d30  75 73 65 64 20 74 6f 20  63 72 65 61 74 65 20 61  |used to create a|
00003d40  6e 20 61 72 72 61 79 20  57 33 32 61 20 62 79 74  |n array W32a byt|
00003d50  65 73 20 6c 6f 6e 67 20  28 65 2e 67 2e 20 31 35  |es long (e.g. 15|
00003d60  20 41 52 52 41 59 20 54  68 61 74 41 72 72 61 79  | ARRAY ThatArray|
00003d70  20 20 77 68 69 63 68 20  77 6f 75 6c 64 20 63 72  |  which would cr|
00003d80  65 61 74 65 20 61 6e 20  61 72 72 61 79 20 31 35  |eate an array 15|
00003d90  20 62 79 74 65 73 20 6c  6f 6e 67 29 2e 20 0a 0a  | bytes long). ..|
00003da0  50 52 49 4e 54 5f 44 49  43 54 20 5b 20 57 33 32  |PRINT_DICT [ W32|
00003db0  61 20 2d 3e 20 5d 20 28  6d 61 69 6e 29 20 74 68  |a -> ] (main) th|
00003dc0  69 73 20 77 6f 72 64 20  69 73 20 75 73 65 64 20  |is word is used |
00003dd0  74 6f 20 70 72 69 6e 74  20 61 20 64 69 63 74 69  |to print a dicti|
00003de0  6f 6e 61 72 79 20 74 6f  20 74 68 65 20 63 75 72  |onary to the cur|
00003df0  72 65 6e 74 6c 79 20 73  65 6c 65 63 74 65 64 20  |rently selected |
00003e00  6f 75 74 70 75 74 20 73  74 65 61 6d 2e 0a 0a 44  |output steam...D|
00003e10  49 43 54 49 4f 4e 41 52  49 45 53 20 28 6d 61 69  |ICTIONARIES (mai|
00003e20  6e 29 20 74 68 69 73 20  77 6f 72 64 20 70 72 69  |n) this word pri|
00003e30  6e 74 73 20 61 6c 6c 20  74 68 65 20 77 6f 72 64  |nts all the word|
00003e40  73 20 64 65 66 69 6e 65  64 20 69 6e 20 74 68 65  |s defined in the|
00003e50  20 43 55 52 52 45 4e 54  2c 20 43 4f 4d 50 49 4c  | CURRENT, COMPIL|
00003e60  45 52 20 61 6e 64 20 53  50 45 43 49 41 4c 20 64  |ER and SPECIAL d|
00003e70  69 63 74 69 6f 6e 61 72  69 65 73 2c 20 75 73 69  |ictionaries, usi|
00003e80  6e 67 20 50 52 49 4e 54  5f 44 49 43 54 20 61 62  |ng PRINT_DICT ab|
00003e90  6f 76 65 2e 0a 0a 54 4f  4b 45 4e 20 5b 20 2d 3e  |ove...TOKEN [ ->|
00003ea0  20 42 33 32 61 20 5d 20  28 6d 61 69 6e 29 20 74  | B32a ] (main) t|
00003eb0  68 69 73 20 77 6f 72 64  20 69 73 20 75 73 65 64  |his word is used|
00003ec0  20 74 6f 20 66 69 6e 64  20 74 68 65 20 6e 65 78  | to find the nex|
00003ed0  74 20 74 6f 6b 65 6e 20  69 6e 20 74 68 65 20 49  |t token in the I|
00003ee0  4e 50 55 54 5f 42 55 46  46 45 52 2e 20 49 74 20  |NPUT_BUFFER. It |
00003ef0  70 75 74 73 20 69 74 20  69 6e 74 6f 20 54 4f 4b  |puts it into TOK|
00003f00  45 4e 5f 42 55 46 46 45  52 20 74 68 65 20 74 6f  |EN_BUFFER the to|
00003f10  6b 65 6e 20 69 6e 20 54  4f 4b 45 4e 5f 42 55 46  |ken in TOKEN_BUF|
00003f20  46 45 52 20 65 6e 64 73  20 77 69 74 68 20 61 20  |FER ends with a |
00003f30  7a 65 72 6f 20 62 79 74  65 2e 20 49 66 20 61 6e  |zero byte. If an|
00003f40  20 65 6e 64 20 6f 66 20  6c 69 6e 65 20 63 68 61  | end of line cha|
00003f50  72 61 63 74 65 72 20 28  69 2e 65 2e 20 30 20 6f  |racter (i.e. 0 o|
00003f60  72 20 31 30 20 6f 72 20  31 33 29 20 69 73 20 66  |r 10 or 13) is f|
00003f70  6f 75 6e 64 20 62 65 66  6f 72 65 20 74 68 65 20  |ound before the |
00003f80  6e 65 78 74 20 70 72 69  6e 74 61 62 6c 65 20 63  |next printable c|
00003f90  68 61 72 61 63 74 65 72  20 61 20 30 20 28 46 41  |haracter a 0 (FA|
00003fa0  4c 53 45 29 20 69 73 20  70 75 73 68 65 64 20 6f  |LSE) is pushed o|
00003fb0  6e 74 6f 20 74 68 65 20  73 74 61 63 6b 2c 20 6f  |nto the stack, o|
00003fc0  74 68 65 72 77 69 73 65  20 61 20 2d 31 20 28 54  |therwise a -1 (T|
00003fd0  52 55 45 29 20 69 73 20  70 75 73 65 68 65 64 20  |RUE) is pusehed |
00003fe0  6f 6e 74 6f 20 74 68 65  20 73 74 61 63 6b 2e 0a  |onto the stack..|
00003ff0  0a 0a 20 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |.. -------------|
00004000  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 20 43 4f 4d  |------------ COM|
00004010  50 49 4c 45 52 20 44 49  43 54 49 4f 4e 41 52 59  |PILER DICTIONARY|
00004020  0a 0a 3b 0a 0a 42 45 47  49 4e 0a 0a 45 4e 44 0a  |..;..BEGIN..END.|
00004030  0a 44 4f 0a 0a 4c 4f 4f  50 0a 0a 2b 4c 4f 4f 50  |.DO..LOOP..+LOOP|
00004040  0a 0a 49 46 0a 0a 45 4c  53 45 0a 0a 45 4e 44 49  |..IF..ELSE..ENDI|
00004050  46 0a 0a 57 48 49 4c 45  0a 0a 0a 2d 2d 2d 2d 2d  |F..WHILE...-----|
00004060  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00004070  2d 2d 2d 2d 2d 2d 2d 2d  20 53 50 45 43 49 41 4c  |-------- SPECIAL|
00004080  20 44 49 43 54 49 4f 4e  41 52 59 0a 0a 2e 22 0a  | DICTIONARY...".|
00004090  0a 5b 49 5d 0a 0a 5b 4a  5d 0a 0a 5b 49 5d 40 0a  |.[I]..[J]..[I]@.|
000040a0  0a 5b 49 5d 21 0a 0a 5b  4a 5d 40 0a 0a 5b 4a 5d  |.[I]!..[J]@..[J]|
000040b0  21 0a 0a                                          |!..|
000040b3