





	WORKING FORTH HANDY REFERENCE
			For version 2.5 of Working Forth


    STACK COMMENTS:	    The top stack value appears last in any list.
	Data Stack values listed as	(s inputs -> outputs )
	Return stack values listed as	(r inputs -> outputs )

	c  is 7-bit ASCII character	a  is a 16-bit address.
	    in a 16-bit field.		    dictionary definition fields:
	b  is an 8-bit byte		     apf  addr of the parameter field.
	    in a 16-bit field.		     acf  addr of the code field.
	n  is 16-bit signed integer.	     alf  addr of the link field.
	u  is 16-bit unsigned		     anf  addr of the name field.
		integer.		    astring  is addr of character
	#  is 16-bit positive integer,	      string with count in 1st byte.
	    used as a count value.	d  is a 32-bit signed integer.
	f  is a truth value in a 16-	ud is a 32-bit unsigned integer.
	  bit field; 0=false, <>0=true.	t  is a 48-bit signed integer.

    [CR] represents pushing the Carriage Return key (or equivalently named
	key:  RETURN  ENTER )

    COMPATIBILITY:	Each word below has an indication if it is implemented
	in and compatible with a word of the same name in other systems:
			S   stands for the Starting Forth book
			F   stands for Fig Forth release 1.
			79  stands for Forth's 79-Standard
			All means all of above.
			W+ is available after loading optional source.


WORD	STACK DATA		DESCRIPTION			    COMPATI-
NAME								     BILITY

SYSTEM CONTROL
OK	(s -> )			Loads standard screens after booting.
BYE	(s -> )			Leave FORTH, enter CP/M.		F
COLD	(s -> )		 	Initialize system to boot-status.	F
WARM	(s -> )			Initialize system keeping dictionary.	F
PERMANENT
	(s -> )			Makes current dictionary the COLD start
				  one.  Used before a CP/M SAVE command.

(Following available after LOADing screens.)
DIR	(s -> #screen )		Constant giving screen # of disk 	W+
				  DIRectory.

   

ARITHMETIC & LOGICAL
16-BIT INTEGER:
+	(s n1 n2 -> nsum )	Add.					All
-	(s n1 n2 -> ndiff )	Subtract n1-n2.				All
1+	(s n -> n+1 )		Add 1.					All
1-	(s n -> n-1 )		Subtract 1.				All
2+	(s n -> n+2 )		Add 2.					All
2-	(s n -> n-2 )		Subtract 2.				All
*	(s n1 n2 -> nprod )	Multiply.				All
2*	(s n -> n*2 )		Arithmetic left shift.			S
/	(s n1 n2 -> nquot )	Divide n1/n2, leave quotient.		All
2/	(s n -> n/2 )		Arithmetic right shift.			S
MOD	(s n1 n2 -> nrem )	Divide n1/n2, leave remainder.		All
/MOD	(s n1 n2 -> nrem nquot )  Divide, leave both.			All
*/	(s n1 n2 n3 -> nquot )	Multiply n1 by n2/n3.			All
*/MOD	(s n1 n2 n3 -> 
	  nrem nquot )		Divide n1*n2 by n3, leave remainder	All
				  and quotient.
MAX	(s n1 n2 -> nmax )	Select maximum, discard other.		All
MIN	(s n1 n2 -> nmin )	Select minimum, discard other.		All
ABS	(s n -> |u| )		Absolute value of n.			All
NEGATE	(s n -> -n )		Two's complement of n.			All
FLIP	(s n1 -> n2 )		One's complement of n1.
AND	(s n1 n2 -> n3 )	Bitwise logical AND.			All
OR	(s n1 n2 -> n3 )	Bitwise logical OR.			All
XOR	(s n1 n2 -> n3 )	Bitwise logical eXclusive-OR.		All

32-BIT, 48-BIT, and MIXED INTEGER:
S->D	(s n -> d )		Convert Single n to Double d.		F
M+	(s d n -> dsum )	Add double to single.			S F
M*	(s n1 n2 -> dprod )	Multiply singles yielding double.	S F
M/	(s d n -> nquot )	Divide d by n.
M/MOD	(s d n -> nrem nquot )	Divide d by n, leave remainder
				  & quotient.
M*/	(s d n1 n2 -> dquot )	Multiply d by n1/n2 giving double.	S
D+	(s d1 d2 -> dsum )	Add double.				All
D-	(s d1 d2 -> d1-d2 )	Subtract double.			All
DABS	(s d -> |d| )		Absolute value double.			All
DNEGATE	(s d -> -d )		Two's complement double.		S 79
DMAX	(s d1 d2 -> dmax )	Select maximum double.			S
DMIN	(s d1 d2 -> dmin )	Select minimum double.			S
MT*	(s d n -> tprod )	Multiply d*n giving triple product.
MT/	(s t n -> tquot )	Divide t/n giving triple quotient.
T+	(s t1 t2 -> tsum )	Add triple.
T-	(s t1 t2 -> tdiff )	Subtract t1-t2 triple.
TABS	(s t -> |t| )		Absolute value triple.
TNEGATE	(s t -> -t )		Two's complement triple.
U*	(s u1 u2 -> ud )	Multiply u1*u2.				F
U/MOD	(s ud u1 -> urem uquot )  Divide ud by u1, leave remainder
				    & quotient.
UM/MOD	(s ud u1 -> urem udquot )  Divide ud by u1, leave remainder
				     & double quotient.

   


MEMORY
8-BIT OPERATIONS:
C@	(s a -> b )		Fetch least significant byte only.	All
C!	(s b a -> )		Store least significant byte at a.	All
CMOVE	(s a1 a2 # -> )		Copy # bytes starting from a1 to a2,	All
				  first byte moved first.
<CMOVE	(s a1 a2 # -> )		Same as CMOVE but 1st byte moved last.	S
ERASE	(s a # -> )		Store # bytes of 0's starting at a.	S F
BLANK	(s a # -> )		Store # bytes of blanks starting at a.	S
FILL	(s a # b -> )		Store # bytes of b's starting at a.	S F

16-BIT OPERATIONS:
@	(s a -> n )		Fetch contents of address a.		All
!	(s n a -> )		Store n at a.				All
+!	(s n a -> )		Add n to contents at a.			All
?	(s a -> )		Print contents of address a.		All
TOGGLE	(s a b -> )		Bitwise complement of bits set in b	F
				  at address a.

32-BIT OPERATIONS:
2@	(s a -> d )		Fetch double at address a.		S
2!	(s d a -> )		Store d at a.				S





STACK MANIPULATION
16-BIT OPERATIONS:
DUP	(s n -> n n )		DUPlicate top value of stack.		All
DROP	(s n -> )		Discard top value.			All
SWAP	(s n1 n2 -> n2 n1 )	Exchange top 2 values.			All
OVER	(s n1 n2 -> n1 n2 n1 )	Put extra copy of 2nd value onto top.	All
ROT	(s n1 n2 n3 -> n2 n3 n1 )
				Permute top 3 values; 3rd goes to top.	All
-ROT	(s n1 n2 n3 -> n3 n1 n2 )
				Permute top 3 values; top goes to 3rd.
?DUP	(s n -> n n )		DUPlicate if n is non-zero,		All
	(s 0 -> 0 )		  Else do nothing.
DEPTH	(s -> # )		Leave # of values on stack.		S 79
S0	(s -> a )		Variable contains address of botton	S
				  of stack.
'S	(s -> a )		Leave address of top of stack.		S
SP@	(s -> a )		Synonym for 'S.				F
SP!	(s -> )			Clear the stack.			F
?STACK	(s -> f )		True if stack has underflowed.		S
?ENOUGH	(s # -> )		Aborts if fewer than # items on stack.

>R	(s n -> )		Remove n; put onto Return stack.	All
	(r -> n )
R>	(s -> n )		Remove top of Return stack;		All
	(r n -> )		  put onto data stack.
R@	(s -> n )		Copy top of Return stack to data stack.	All
	(s n -> n )
R0	(s -> a )		Variable containing address of bottom
				  of Return stack.
RP@	(s -> a )		Returns address of top of Return stack.	F
RP!	(s -> )			Clear Return stack.			F

(Following available after loading screens.)
PICK	(s # -> n )		Push a copy of the #th cell of the	W+
				  stack; the count starts at 1.
ROLL	(s # -> )		Permute the top # cells of the stack	W+
				  by bringing the #th cell to the top
				  and pushing the rest down. ( # >= 1 )


32-BIT OPERATIONS:
2DUP	(s d -> d d )		DUPlicate top 32-bits of stack.		S
2DROP	(s d -> )		Discard top 32-bits.			S
2SWAP	(s d1 d2 -> d2 d1 )	Exchange 2 32-bit values.		S
2OVER	(s d1 d2 -> d1 d2 d1 )	Put extra copy of 2nd 32-bit value	S
				  onto top of stack.

(Following available after LOADing screens.)
2ROT	(s d1 d2 d3 -> d2 d3 d1 )  Rotate the third 32-bit value to	W+
				     the top.




COMPARISON
16-BIT OPERATIONS:
0>	(s n -> f )		Leave true if n>0.			S 79
0<	(s n -> f )		Leave true if n<0.			All
0=	(s n -> f )		Leave true if n=0.			All
NOT	(s n -> f )		Leave true if n is false & vice versa.	All
=	(s n1 n2 -> f )		Leave true if n1=n2.			All
<>	(s n1 n2 -> f )		Leave true if n1 <> n2.
>	(s n1 n2 -> f )		Leave true if n1>n2.			All
<	(s n1 n2 -> f )		Leave true if n1<n2.			All
U<	(s u1 u2 -> f )		Leave true if u1<u2, unsigned test.	S
WITHIN	(s n nmin nmax -> f )	Leave true if nmin <= n < nmax.		S

32-BIT OPERATIONS:
D0<	(s d -> f )		Leave true if d<0.			S
D0=	(s d -> f )		Leave true if d=0.			S
D=	(s d1 d2 -> f )		Leave true if d1=d2.			S
D<	(s d1 d2 -> f )		Leave true if d1 < d2.			S
DU<	(s ud1 ud2 -> f )	Leave true if ud1 < ud2.		S




INTERPRETER
( xxx )	(s -> )			Begin comment after space; ended by ).	All
EXECUTE	(s apf -> )		Perform word whos parameter field	S
				  address (apf) is on the stack.
INTERPRET (s -> )		Interpret source.		F
QUIT	(s -> )			Terminal monitor loop.  Reads input	All
				  source and INTERPRETs it.
(QUIT)	(s -> )			First word in QUIT loop; executes	
				  contents of '(QUIT) .
'(QUIT)	(s -> a )		Variable containing parameter field	
				  address of word executed by (QUIT)
				  Initially is a NOOP .

(Following available after LOADing screens.)
TIMES	(s # -> )		Reinterpret input stream # TIMES.	W+
\	(s -> )			Ignore rest of current line.  Used for	W+
				  comments following \ .


   

DICTIONARY
' name	(s -> apf )		Locate & return parameter field address	S 
				  of word "name"; abort if not found.
				  ' is deferred if in a : definition.
['] nm	(s -> apf )		Same as ' but not deferred in a : def.	S 
-' nm	(s -> apf 0 )		Search dictionary for word "nm".	S
	(s -> 1 )		  If found return param. addr & false.
				  Else return true.
FIND? nm
	(s -> apf 1 )		Search the dictionary for word "nm".	
	(s -> 0 )		  If found return true & param. address.
				  Else, return false.
'?FIND	(s -> a )		Variable containing apf of definition
				  executed by FIND? .
(FIND?)				Default value of '?FIND .
<FIND?>	(s astring anf -> apf 1 )  Code primitive for (FIND?) .
	(s astring anf -> 0 )
HERE	(s -> a )		Return address of top of dictionary.	All
H	(s -> a )		Variable containing address of top of	S 
				  dictionary.
H0	(s -> a )		Variable containing address of start	
				  of dictionary.
CFA	(s apf -> acf )		Convert a word's parameter field addr.	F
				  to its code field address.
LFA	(s apf -> alf )		Convert parameter field addr. to link	F
				  field address.
NFA	(s apf -> anf )		Convert parameter field addr. to name	F
				  field address.
PFA	(s anf -> apf )		Convert name field addr. to parameter	F
				  field address.
EMPTY	(s -> )			Discard dictionary added since system	S 
				  was started.
FORGET name
	(s -> )			Discard dictionary added since "name"	All
				  was added. (Discards name also.)
(FORGET)
	(s apf -> )		FORGET dictionary added since word	
				  whos parameter field address is given.
FENCE	(s -> a )		Variable containing limit for FORGETs.	F
				  If try to forget below FENCE, get
				  error message.
GIVEN	(s -> a )		Constant retuning boot-time HERE.	




VOCABULARIES
VOCABULARY name
	(s -> )			Define new vocabulary named "name".	F
				  It is chained to CURRENT vocabulary.
CONTEXT	(s -> a )		Variable containing pointer to last	F 79
				  definition of CONTEXT vocabulary.
				  Indicates vocabularies searched now.
CURRENT	(s -> a )		Variable containing pointer to last	F 79
				  definition of CURRENT vocabulary.
				  Indicates vocabulary new definitions
				  are appended to.
FORTH	(s -> )			Makes FORTH the CONTEXT vocabulary.	All
				  This is the main and first vocabulary.
DEFINITIONS
	(s -> )			Makes the CONTEXT vocabulary the	All
				  CURRENT vocabulary.
VOC-LINK	
	(s -> )			Variable containing back-link of all	F
				  vocabularies; used by FORGET.

(Following available after LOADing screens.)
VOC'S	(s -> )			Print existing vocabulary names and	W+
				  show which are CONTEXT & CURRENT.




STRING OPERATIONS
ASCII c	(s -> c )		Compiles character c into : definition.	
				  When executed, c is pushed onto stack.
WORD	(s c -> astring )	Get next string delimited by char. c	S 
				  from input stream and move to HERE.
				  Leave address of string with count
				  in first byte.
'WORD	(s -> a )		Variable containing apf of definition
				  executed by WORD.
(WORD)	(s c -> astring )	Default contents of 'WORD.
>IN	(s -> a )		Variable containing index into input	S 79
				  stream where WORD will start looking.
BLK	(s -> a )		Variable which determines input stream	All
				  device.  0 is console, >0 is disk
				  block number.
COUNT	(s astring -> a+1 # )	Given the address of a string, returns	All
				  the # characters and address of 1st.
-TRAILING
	(s astring #1 -> astring #2 )
				Given address and length of a string,	All
				  returns count after removing TRAILING
				  blanks.
BL	(s -> c )		Returns ASCII code for a BLank.
PAD	(s -> a )		Returns address of a string buffer.	All
TEXT	(s c -> )		Get string from input stream delimited	F
				  by c and move it to PAD.
DELETE	(s am #m # -> )		Delete # characters from string at am	
				  with length #m.
REPLACE	(s as #s am #m -> )	Replace main string at "am" for #m chars
				  with substring at "as" for #s chars.
				  (Minimum of #s and #m replaced.)
INSERT	(s as #s am #m -> )	Insert substring at "as" for #s chars	
				  into main string at "am", #m long.
MATCH?	(s am # as -> f )	Compare 2 strings at "am" and "as" for	
				  # characters.  Return true if matched.
SEARCH	(s as #s am #m -> a f )	Search for a substring at "as" for #s	
				  characters in a main string at "am"
				  for #m chars.  If found, return true
				  and address of next main string char.
				  Else, return false & address of 1st
				  non-matching char. in main string.
-TEXT	(s a1 # s2 -> f )	Compare 2 strings at "a1" and "a2" for	S
				  # characters.  Returns FALSE if they
				  matched; 1 if string 1 > string 2;
				  and -1 if string 1 < string 2.


   

TERMINAL INPUT/OUTPUT
KEY	(s -> c )		Wait and return next character entered	All
				  from keyboard.
KEY?	(s -> f )		True if any key struck since last KEY.
?TERMINAL
	(s -> f )		Synonym for KEY? .			F
EXPECT	(s a # -> )		Get # characters (or until RETURN hit)	All
				  and store into buffer at "a".  Null
				  character stored after string.
QUERY	(s -> )			Read a line from the terminal for 	F 79
				  interpretation.
TIB	(s -> a )		Variable containing address of Text	F
				  Input Buffer (destination for EXPECT,
				  source for WORD).
EMIT	(s c -> )		Write character c to terminal.		All
TYPE	(s a # -> )		Type string at "a" for # characters to	All
				  terminal.
>TYPE	(s a # -> )		Synonym for TYPE.  Moves string to PAD	S
				  before executing TYPE.
>OUT	(s -> a )		Variable containing # characters	
				  written since last CR.
SPACE	(s -> )			Write 1 blank to terminal.		All
SPACES	(s # -> )		Write # blanks to terminal.		All
CR	(s -> )			Write Carriage Return & Line Feed to	All
				  terminal.  (Executes contents of 'CR )
PAGE	(s -> )			Write Line Feed to terminal (or print-	S 
				  er).  (Executes contents of 'PAGE ).
BS	(s -> )			Write Back Space to terminal.		
." xxx"	(s -> )			Type string following blank & up to "	All
'KEY  '?KEY  'EMIT  'CR  'PAGE
	(s -> a )		Variables containing address of word	
				  executed by words main words.
(KEY)  (KEY?) (EMIT) (CR) (PAGE)
				Default values of above variables.	
?PRINT	(s -> a )		Variable controlling output to the	
				  printer.  0 = off, 1 = on.
				  Toggled by ^P from keyboard.
MESSAGE (s # -> )		Write message in disk screen MESSAGES	F
				  line # to terminal (& printer).
WARNING	(s -> a )		Variable controlling MESSAGE.		F
				  0 = ignore, 1 = get string from disk.
MESSAGES	
	(s -> # )		Returns screen number of messages.	
.LINE	(s #line #scr -> )	Writes line #line from screen #scr.	F
(LINE)	(s #line #scr -> a 64 )	Return buffer address and a count of 64	F
				  for line #line of screen #scr.


  


NUMERIC CONVERSION & INPUT/OUTPUT
.	(s n -> )		Write n to terminal as signed integer.	All
?	(s a -> )		Write contents of address "a" signed.	All
.R	(s n # -> )		Write n Right justified in # columns.	S
(.)	(s n -> a # )		Convert n to signed integer string at
				  address "a" for # characters.
U.	(s u -> )		Write u to terminal unsigned.		All
U.R	(s u # -> )		Write u Unsigned & Right justified in	S F
				  # columns.
(U.)	(s u -> a # )		Convert u to unsigned integer string
				  at "a" for # characters.
D.	(s d -> )		Write 32-bit d signed.			S F
D.R	(s d # -> )		Write d signed & Right justified in	All
				  # columns.
(D.)	(s d -> a # )		Convert d to signed interger string
				  at "a" for # characters.
UD.	(s ud -> )		Write d unsigned.			S F
(UD.)	(s ud -> a # )		Convert ud to unsigned integer string
				  at "a" for # characters.

DECIMAL	(s -> )			Make input & output numeric conversion	All
				  radix = 10.
HEX	(s -> )			Make radix = 16 (HEXadecimal).		All
OCTAL	(s -> )			Make radix = 8.				
BINARY	(s -> )			Make radix = 2.				

BASE	(s -> a )		Variable containing conversion radix.	All

SIGNED	(s n -> n ud )		Prepare for output conversion of n.
				  Use before <# and use SIGN inside.
UNSIGNED (s u -> ud )		Prepare for output conversion of u.
				  Use before <# and don't use SIGN.
DSIGNED	(s d -> n ud )		Prepare for output conversion of d.
				  Use before <# and use SIGN inside.
DUNSIGNED  (s ud -> ud )	Prepare for output conversion of ud.
				  Use before <# and don't use SIGN.
<#	(s -> )			Start numeric output conversion.	All
				  Must be used inside a : definition.
#	(s ud1 -> ud2 )		Convert one digit.			All
#S 	(s ud -> 0 0 )		Convert all remaining digits.		All
HOLD	(s c -> )		Output character c to output string.	All
SIGN	(s n d -> d )		Output minus sign to string if n<0.	F S
#>	(s d -> a # )		End output conversion leaving address	All
				  and character count of string.

NUMBER	(s astring -> d )	Convert numeric string at "astring" to	S
				  double interger d.  Accepts punctua-
				  tion in string:   . , - / :
'NUMBER	(s -> a )		Variable containing apf of word executed
				  by NUMBER.
(NUMBER)			Default value of 'NUMBER.
PTR	(s -> a )		Variable containing status of last	S
				  string converted by NUMBER.
				  <0 = no punctuation; >= 0 = # digits
				  past last punctuation.


   

DEFINING WORDS
: pnm	(s -> )			Start : definition named "pnm".		All
;	(s -> )			End : definition.			All
VARIABLE vname
	(s -> )			Create 16-bit variable named "vname"	S 79
				  "vname" returns address when used.
2VARIABLE vname
	(s -> )			Create 32-bit variable named "vname"	S
				  "vname" returns address when used.
CONSTANT cname
	(s n -> )		Create 16-bit constant "cname" with 	All
				  value n.  "cname" returns n when used.
2CONSTANT cname
	(s d -> )		Create 32-bit constant "cname" with	S
				  value d.  "cname" returns d when used.
CREATE name
	(s -> )			Create definition "name" with no body.	S 79
				  "name" returns address when used.
DOES>	(s -> a )		Used inside a : definition to make a	All
				  new defining word.
USER uname
	(s b -> )		Create a user variable b bytes into the	S F
				  user variable memory area.  
				  "uname" returns address when used.
'CREATE	(s -> a )		Variable containing address of routine	
				  executed by CREATE.
(CREATE)			Default value of 'CREATE .		
VCREATE				Contents of 'CREATE which also makes	
				  a VIEW field in each definition.
WIDTH	(s -> a )		Variable containing maximum # of char-	F
				  acters to save when defining words.
LATEST	(s -> a )		Returns the name field address of the	F
				  last word defined.
SMUDGE	(s -> )			Makes the last word defined unfindable	F
				  when first used, and findable if used
				  again.


   

COMPILER
,	(s n -> )		Compile n into dictionary at HERE.	All
C,	(s b -> )		Compile byte b into dictionary.		All
ALLOT	(s n -> )		Allocate n more bytes to dictionary	All
				  if n>0.  Delete n bytes if n<0.
IMMEDIATE	
	(s -> )			Make last defined word IMMEDIATE.	All
				  Subsequently it will be executed when
				  in a : definition.
LITERAL	(s n -> )		Compile n into definition as a literal.	All
				  When the def. is executed, n will be
				  pushed onto the stack.
DLITERAL
	(s d -> )		Compile 32-bit d into definition as a	F
				  literal.  When the def. is executed,
				  d will be pushed onto the stack.
STATE	(s -> a )		Variable controlling whether interpret-	F
				  ing or compiling.
0STATE	(s -> )			Set STATE to 0 (interpreting).
[	(s -> )			Stop compiling & start interpreting.	All
				  Exit the compiler loop.
]	(s -> )			Stop interpreting & start compiling.	All
				  (The compiler loop.)
COMPILE	name
	(s -> )			Defer the compilation of "name" until	All
				  the def. which this is used in is
				  executed.
[COMPILE] name
	(s -> )			Force the compilation of "name" even	All
				  if it is IMMEDIATE.
BRANCH	(s -> )			Code primitive for unconditional branch.
?BRANCH	(s f -> )		Code primitive for conditional branch.
>MARK	(s -> a )		Mark a forward branch.
>RESOLVE
	(s a -> )		Resolve a forward branch.
<MARK	(s -> a )		Mark a backward branch.
<RESOLVE
	(s a -> )		Resolve a backward branch.


   

CONTROL STRUCTURES
IF true-part
	(s n -> )		If n <> 0, execute true-part.		All
ELSE false-part
	(s -> )			Optional between IF & THEN, executed	All
				  if n=0 (supplied to IF).
THEN	(s -> )			Continue execution after IF or ELSE.	All
BEGIN loop-body
	(s -> )			Start loop.  "loop-body" executed	All
				  at least once.
UNTIL	(s n -> )		After BEGIN, exits if n <> 0,		All
				  otherwise branches back to BEGIN.
AGAIN	(s -> )			After BEGIN, repeats always.		F
WHILE 2nd-loop-body
	(s n -> )		Between BEGIN & REPEAT, continues if	All
				  n <> 0, else exits past REPEAT.
REPEAT	(s -> )			After WHILE, branches back to BEGIN.	All
DO	(s nlimit n1st -> )	Start a DO-loop.			All
	(r -> nlimit n1st )
LOOP	(s -> )			After DO, increments loop index by 1,	All
	(r nlimit nindex -> )	  exits if nlimit >= index,
	(r nl ni -> nl ni )	  else branches back to DO.
+LOOP	(s n -> )		After DO, increments loop index by n,	
				  branches back to DO unless:
				    if n >= 0, exits if nlimit >= index;
				    else n < 0, exits if nlimit < index.
/LOOP	(s u -> )		After DO, like +LOOP but increment is	S
				  unsigned, u>0.
I	(s -> n )		Returns current DO-loop index value.	All
	(r n -> n )
I'	(s -> n )		Returns current DO-loop limit value.	S
	(r n n1 -> n n1 )
J	(s -> n )		Returns 2nd DO-loop's index value.	All
	(r n n1 n2 -> n n1 n2 )
LEAVE	(s -> )			Forces exit at next execution of LOOP,	All
	(r nl ni -> nl nl )	  +LOOP, or /LOOP.
EXIT	(s -> )			Forces exit from : definition.		S 79
	(r a -> )		  (Use cautiously!)
				  Also terminates loading a screen if
				  interpreted.
ABORT" string"
	(s f -> )		If f <> 0, prints the string & aborts.	S
				  Else, executes word following string.
(ABORT")			Conditionally executed by ABORT"
				  Executes contents of '(ABORT")
'(ABORT")
	(s -> a )		Variable containing abort routine.
<ABORT">			Default contents of '(ABORT") .
ABORT	(s -> )			Clears stack & QUITs.


   

MASS STORAGE INPUT/OUTPUT
BLOCK	(s # -> a )		Return address of data for block #.	All
				  If not in memory, read it from disk.
UPDATE	(s -> )			Mark last accessed BLOCK as changed.	All
				  Will be written to disk later.
BUFFER	(s # -> a )		Get buffer for block #.  Not read from	All
				  disk.
FLUSH	(s -> )			Force all UPDATEd buffers to be written	F S
				  to disk.  Also all buffers are marked
				  as empty.  Use before removing or
				  changing disks.
SAVE-BUFFERS
	(s -> )			Synonym for FLUSH.			79
EMPTY-BUFFERS
	(s -> )			Clobber all buffers without writing	All
				  anything to disk.
B/BUF	(s -> 1024 )		Constant returning Bytes per BUFfer.	F
C/L	(s -> 64 )		Constant returning Characters per Line.	F
DRIVE	(s # -> )		Select DRIVE # (0 to #DRIVES-1 )	S
DR0	(s -> )			Select DRive 0 (or A:)			F
DR1	(s -> )			Select DRive 1 (or B:)			F
OFFSET	(s -> a )		Variable with block # offset.  		F S
				  0 = start with drive 0.
#DRIVES	(s -> a )		Variable containing # disk DRIVES used.
B/SEC	(s -> a )		Variable with Bytes per SECtor.
SEC/TRK	(s -> a )		Variable with SECtors per TRacK.
TRK/DRV	(s -> a )		Variable with TRacKs per DRiVe.
SEC/BLK	(s -> a )		Variable with SECtors per BLocK.
SEC/DRV	(s -> a )		Variable with usable SECtors per DRiVe.
CAPACITY
	(s -> a )		Variable with screens per drive.
SKEWS	(s -> a )		Byte array with sector skewing table.
?SKEW	(s -> a )		Variable with control for sector skew-
				  ing.  0 = no skewing; 1 = yes.
#BUFFERS
	(s -> # )		Constant of # buffers in system.
DISK-ERROR
	(s -> a )		Variable with disk error code for last
				  disk access.  0 = no error.
BLOCKS	(s -> a )		2Variable with block #'s for enabling
				  writes to the disk.  Writes outside
				  this range will give error message.


   

PROGRAM MANIPULATION
LIST	(s #screen -> )		Display screen #screen and make it	All
				  current.  #screen is saved in SCR .
L	(s -> )			Relist current screen.			S
N	(s -> )			Make the next screen current.		S
B	(s -> )			Make the previous screen current.	S
SCR	(s -> a )		Variable with screen # of last screen	All
				  listed.
INDEX	(s #1st-screen #last-screen -> )
				Display 1st line (line 0) of range	All
				  of screens.
TRIAD	(s #screen -> )		Print 3 screens starting with #screen .	F
SHOW	(s #1st-screen #last-screen -> )
				Print range of screens, 3 to a page.

LOAD	(s #screen -> )		Compile & interpret from screen		All
				  #screen .  #screen is saved in BLK .
THRU	(s #1st-screen #last-screen -> )
				Load range of screens.			
-->	(s -> )			Load next screen.			F
INITIAL	(s -> #screen )		Constant of the first screen to be
				  loaded after booting.

(Following available after LOADing screens.)
+LOAD	(s # -> )		Load screen # from current one.		W+
				  (Relative screen #).
+THRU	(s #1st #last -> )	Load range of screens relative to the	W+
				  current one.



EDITOR
LIST	(s #screen -> )		Display screen #screen and make it	All
				  current for editing.
				  ( #screen is put into SCR.)
L	(s -> )			Relist current screen.			S F
N	(s -> )			Make next screen current.		S
B	(s -> )			Make the previous screen current.	S
				  (Back 1 screen)
SCR	(s -> a )		Variable containing screen # of current	S F
				  editing screen.

EDITOR	(s -> )			Name of the Editor's vocabulary.	All
				  Used to start editing.

FOLLOWING ARE IN THE EDITOR VOCABULARY:
WIPE	(s -> )			Blank all of the current screen.	S
TOP	(s -> )			Move the cursor to the start of the	S F
				  current screen.

Line editing operations:
T	(s #line -> )		Move cursor to start of #line & Type it. S F
P text^	(s -> )			Put "text" into current line & the	S
				  insert buffer.  "text" may be ended
				  by ^ or [CR].
P	(s -> )			Put insert buffer's text into current	S
				  line.
X	(s -> )			Copy current line into insert buffer,	S
				  then delete the current line, moving
				  lower lines up.
U text^	(s -> )			Copy "text" into insert buffer, then	S
				  insert it Under current line, moving
				  lower lines down.  Line 15 is lost.
				  "text" may be ended by ^ or [CR].
U	(s -> )			Insert insert buffer's text Under the	S
				  current line, moving lower lines
				  down.  Line 15 is lost.
M	(s #screen #line -> )	Insert current line under #line of	S
				  #screen. (Move line)

String editing operations:
F text^	(s -> )			Copy "text" into find buffer, then	S
				  Find "text" after cursor on current
				  screen.  If found, cursor moved after
				  it; else cursor is not moved.  "text"
				  may be ended by ^ or [CR].
F	(s -> )			Find next occurrence of find buffer's	S
				  text after the cursor on the current
				  screen.  If found, cursor moved after
				  it; else cursor is not moved.
S text^	(s #screen -> )		Copy "text" into find buffer, then	S
				  Search for "text" after cursor in
				  current screen through end of #screen.
				  If found, cursor is moved after match,
				  and that screen is made current.
S	(s -> )			Search for next occurrence of find	S
				  buffer's text after cursor to end
				  of #screen (given on first use of S).
				  After final screen has been searched,
				  #screen is dropped.
I text^	(s -> )			Copy "text" into insert buffer, then	S
				  insert it after cursor on current
				  line.  "text" may be ended by
				  ^ or [CR].
I	(s -> )			Insert insert buffer's text after the	S
				  cursor on current line.
D text^	(s -> )			Copy "text" into find buffer, then	S
				  Delete next occurrence of it
				  after cursor on the current line.
D	(s -> )			Delete next occurrence of find buffer's	S
				  text after cursor on current line.
TILL text^
	(s -> )			Copy "text" into find buffer, then	S
				  delete all characters from cursor
				  through the end of "text" on the
				  current line.
TILL	(s -> )			Delete from cursor through the next
				  occurrence of find buffer's text
				  on the current line.
E	(s -> )			Erase (delete) the last text found	S
				  by F or S.
R text^	(s -> )			Copy "text" into insert buffer, then	S
				  delete the last string matched by
				  F or S, then insert "text".
R	(s -> )			Delete last string matched by F or S,	S
				  then insert insert buffer's text.

WHERE	(s -> )			Print current line showing cursor's
				  position.
.INSERT	(s -> )			Print insert buffer's text.
.FIND	(s -> )			Print find buffer's text.
K	(s -> )			Exchange contents of insert & find	S
				  buffers.
R#	(s -> a )		Variable containing cursor position.	F
				  Range: 0 to 1023 .

COPY	(s #source #dest -> )	Copy #source screen to #dest screen.	S F
				  Follow each use with a FLUSH.

(Following available after LOADing screens.)
NEW	(s #line -> )		Multiline replacement of lines on the	W+
				  current screen.  Starts with line
				  #line and ends when [CR] only entered.
UNDER	(s #line -> )		Multiline insert of lines on the	W+
				  current screen.  Starts UNDER line
				  #line and ends when [CR] only entered.
WIPES	(s #1st-screen #last-screen -> )
				Blank all screens from #1st through	W+
				  #last.
A	(s -> )			Make Alternate screen current.		W+
				  Used to toggle between primary screen
				  and "shadow" screen.  Follow by L to
				  display the new screen.


DISK BLOCK COPY & BACKUP UTILITIES:
BACKING	(s -> #screen )		Constant containing screen # of start	W+
				  of disk copy utilities.

After BACKING LOAD :
(The following in the EDITOR vocabulary.)
BACKUP	(s -> )			Copies all of disk in DRive 0		W+
				  (CP/M's A: ) to DRive 1 ( B: ).
COPY-0TO1
	(s #1st-block #last-block -> )
				Copies range of blocks from #1st	W+
				  through #last of DRive 0 ( A: )
				  to the same block numbers of
				  DRive 1 ( B: ).
SKIP	(s n -> )		Set block offset for use by COPY-BLOCKS. W+
				  If n>0, blocks are copied down
				  (towards higher block numbers).
				  If n is negative, blocks are copied
				  up (towards lower block numbers).
SKIPPED	(s -> a )		Variable containing number of blocks	W+
				  to be skipped by COPY-BLOCKS.
				  To see its value, say  SKIPPED ?
COPY-BLOCKS
	(s #1st-source-block   #last-source-block   -> )
				Copy range of blocks from #1st		W+
				  through #last of the current
				  drive to (#1st + #SKIPPED) through
				  (#last + #SKIPPED).  Overlapping
				  source & destination ranges are
				  allowed.
TO #1st-dest-block
	(s #1st-source-block  #last-source-block  -> #1st #last )
				Sets SKIP for the number of screens	W+
				  needed to map block #1st-source
				  onto #1st-destination .
ON1	(s -> )			Specifies that the destination blocks	W+
				  are on DRive 1.

				Example:  To copy blocks 10 thru 15
				  of DRive 0 to blocks 50 thru 55 of
				  of DRive 1, start from DR0 and type:

				  10 15   TO 50 ON1   COPY-BLOCKS

0BLOCK	(s -> )			Guarantee access to 0 BLOCK immediately	W+
				  after 0BLOCK is executed.


   

ASSEMBLER
ASSEMBLER
	(s -> )			Name of the assembler vocabulary.	S 79

(Following available after LOADing screens.)
ASSEMBLING
	(s -> #screen )		Constant containing screen # of start	W+
				  of non-resident assembler source.
				  To use the assembler, it must be
				  loaded by saying: ASSEMBLING LOAD .

After ASSEMBLING LOAD :
CODE name
	(s -> )			Start definition of new procedure	W+ S 79
				  named "name" using this assembler.
C;	(s -> )			End assembler definition (optional).	W+
LABEL name
	(s -> )			Start definition of assembler procedure	W+
				  named "name".  When used, "name"
				  returns the address of 1st machine
				  instruction of this definition.
;CODE	(s -> )			Used inside : definition to create a new All
				  defining word.  Terminates the : def.
				  and starts a CODE definition.

THE FOLLOWING APPLY ONLY TO THE 8080 CPU's INSTRUCTION SET
  & are in the ASSEMBLER vocabulary:
NEXT	(s -> a )		Label of Forth's address interpreter.
				  Code ending:  NEXT JMP
HPUSH	(s -> a )		Label of code ending.  Pushes contents	W+
				  of HL registers then executes NEXT .
DPUSH	(s -> a )		Label of code ending.  Pushes contents	W+
				  of DE and then HL registers, then
				  executes NEXT .
WPUSH	(s -> a )		Synonym for DPUSH.			W+
R	(s -> a )		Returns address of mem. cell used for
				  Forth's Return Stack.
UP	(s -> a )		Returns address of mem. cell used for
				  Forth's User variable Pointer reg.

A	(s -> # )		Constant for the Accumulator register.	W+
B C	(s -> # )		Constants for the B & C registers.	W+
				  Use only B for the pair.
I I'	(s -> # )		Synonyms for B & C.  Used for Forth's	W+
				  interpreter pointer register.
IP IP'	(s -> # )		Synonyms for B & C.			W+
D E	(s -> # )		Constants for the D & E registers.	W+
				  Use only D for the pair.
W W'	(s -> # )		Synonyms for D & E.  Used for Forth's	W+
				  Word register.
H L	(s -> # )		Constants for the H & L registers.	W+
				  Use only H for the pair.
SP	(s -> # )		Constant for the Stack Pointer reg.	W+
				  Used for the data stack.
S	(s -> # )		Synonym for the S register.		W+
M	(s -> # )		Constant for Memory addressing mode.	W+
PSW	(s -> # )		Constant for the Program Status Word.	W+

Mnemonics			Same as Intel's 8080 mnemonic names.	W+
				  Postfix order for operands.
				  Order for 2 operand instructions:
				    source  destination mnemonic .

COMPARISONS:
0=	(s -> # )		True if the "zero" flag is set.		W+
0<	(s -> # )		True if the "negative" flag is set.	W+
CS	(s -> # )		True if the Carry flag is Set.		W+
PE	(s -> # )		True if the "Parity" flag is Even.	W+
NOT	(s #1 -> #2 )		Reverses truth of above tests.		W+

CONTROL STRUCTURES:
IF true-part
	(s # -> )		Execute "true-part" if test is true.	W+
ELSE false-part
	(s -> )			Optional between IF & THEN.		W+
THEN	(s -> )			Continue after IF (or ELSE).		W+
BEGIN body
	(s -> )			Start loop; "body" executed at least 	W+
				  once.
UNTIL	(s # -> )		After BEGIN.  Exit if true; branch back	W+
				  to BEGIN if false.
AGAIN	(s -> )			After BEGIN.  Branch back to	 	W+
				  BEGIN always.
WHILE 2nd-part
	(s # -> )		Between BEGIN & REPEAT,			W+
				  Continue if true,
				  else exit past REPEAT.
REPEAT
	(s -> )			After WHILE.  Branch back to BEGIN.	W+



MISCELLANEOUS
NOOP	(s -> )			NO OPeration.
P@	(s # -> b )		Fetch byte from 8080 IO Port # .
P!	(s b # -> )		Store byte to 8080 IO Port # .
0 1 2 3	(s -> # )		Constants.
0.	(s -> 0 0 )		32-bit constant.			S
.CPU	(s -> )			Prints "8080".
TASK	(s -> )			Name of word at top of booted dict-	F
				  ionary.
*S	(s # -> )		Print # astericks.





UTILITIES
.S	(s -> )			Print contents of data stack without
				  changing it.
WORDS	(s -> )			Print names of CONTEXT vocabularies'
				  words.
VLIST	(s -> )			Synonym for WORDS.			F
LENGTH	(s -> a )		Variable with line length for WORDS
				  display.
DUMP	(s a # -> )		Memory dump starting at address a for	S
				  # bytes.
VIEW name
	(s -> )			List screen containing source for word
				  "name".
LOCATE name			Synonym for VIEW.

(Following available after LOADing screens.)
R.	(s -> )			Print contents of Return stack.		W+
				  Only addresses (& data) are printed.
R.N	(s -> )			Print contents of Return stack showing	W+
				  numeric value and names corresponding
				  to each address.  Note: non-address
				  values will show garbage names.


