go-first

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

help.th (1774B)


      1 : help key  ( flush the carriage return form the input buffer )
      2 
      3 " The following are the standard known words; words marked with (*) are
      4 immediate words, which cannot be used from command mode, but only in
      5 word definitions.  Words marked by (**) declare new words, so are always
      6 followed by the new word.
      7 
      8 	! @		fetch, store
      9 	+ - * / mod	standard arithmetic operations
     10 	= < > <= >=	standard comparison operations
     11 
     12 	not		boolean not of top of stack
     13 	logical		turn top of stack into 0 or 1
     14 
     15 	dup over	duplicate the top of stack or second of stack
     16 	swap drop	reverse top two elements or drop topmost
     17 
     18 	inc dec		increment/decrement the value at address from stack
     19 	add		add a value from 2nd of stack into address from top
     20 
     21 	echo key	output character from, or input to, top of stack
     22 	. #		print out number on top of stack without/with cr
     23 	cr		print a carriage return
     24 
     25 [more]" key
     26 " (**)	var		declare variable with initial value taken from stack
     27 (**)	constant	declare constant with initial value taken from stack
     28 (**)	array		declare an array with size taken from stack
     29 
     30 (*)	if...else...then	FORTH branching construct
     31 (*)	do...loop		FORTH looping construct
     32 	i j			loop values (not variables)
     33 
     34 	print		print the string pointed to on screen
     35 
     36 (*)(**) :		declare a new THIRD word
     37 (*)	<build does>	declare a data types compile-time and run-time
     38 (*)	;		terminate a word definition
     39 
     40 [more]" key
     41 " Advanced words:
     42 	here		current location in dictionary
     43 	h		pointer into dictionary
     44 	r		pointer to return stack
     45 	fromr tor	pop a value from or to the return stack
     46 
     47 	,		write the top of stack to dictionary
     48 	'		store the address of the following word on the stack
     49 	allot		leave space on the dictionary
     50 
     51 	::		compile a ':' header
     52 	[		switch into command mode
     53 	]		continue doing : definitions
     54 " ;