spinix-hive/pfth/chkcore.fth

146 lines
2.2 KiB
Forth

( This program checks for all 133 ANS Forth core words )
: checkword 1 + ' 0 =
if swap 1 + swap source type ." failed" 13 emit 10 emit then ;
: checkdone swap dup
if swap dup rot rot swap - . ." out of "
else drop ." All " then
. ." ANS Forth core words implemented" 13 emit 10 emit ;
0 0
checkword !
checkword #
checkword #>
checkword #S
checkword '
checkword (
checkword *
checkword */
checkword */MOD
checkword +
checkword +!
checkword +LOOP
checkword ,
checkword -
checkword .
checkword ."
checkword /
checkword /MOD
checkword 0<
checkword 0=
checkword 1+
checkword 1-
checkword 2!
checkword 2*
checkword 2/
checkword 2@
checkword 2DROP
checkword 2DUP
checkword 2OVER
checkword 2SWAP
checkword :
checkword ;
checkword <
checkword <#
checkword =
checkword >
checkword >BODY
checkword >IN
checkword >NUMBER
checkword >R
checkword ?DUP
checkword @
checkword ABORT
checkword ABORT"
checkword ABS
checkword ACCEPT
checkword ALIGN
checkword ALIGNED
checkword ALLOT
checkword AND
checkword BASE
checkword BEGIN
checkword BL
checkword C!
checkword C,
checkword C@
checkword CELL+
checkword CELLS
checkword CHAR
checkword CHAR+
checkword CHARS
checkword CONSTANT
checkword COUNT
checkword CR
checkword CREATE
checkword DECIMAL
checkword DEPTH
checkword DO
checkword DOES>
checkword DROP
checkword DUP
checkword ELSE
checkword EMIT
checkword ENVIRONMENT?
checkword EVALUATE
checkword EXECUTE
checkword EXIT
checkword FILL
checkword FIND
checkword FM/MOD
checkword HERE
checkword HOLD
checkword I
checkword IF
checkword IMMEDIATE
checkword INVERT
checkword J
checkword KEY
checkword LEAVE
checkword LITERAL
checkword LOOP
checkword LSHIFT
checkword M*
checkword MAX
checkword MIN
checkword MOD
checkword MOVE
checkword NEGATE
checkword OR
checkword OVER
checkword POSTPONE
checkword QUIT
checkword R>
checkword R@
checkword RECURSE
checkword REPEAT
checkword ROT
checkword RSHIFT
checkword S"
checkword S>D
checkword SIGN
checkword SM/REM
checkword SOURCE
checkword SPACE
checkword SPACES
checkword STATE
checkword SWAP
checkword THEN
checkword TYPE
checkword U.
checkword U<
checkword UM*
checkword UM/MOD
checkword UNLOOP
checkword UNTIL
checkword VARIABLE
checkword WHILE
checkword WORD
checkword XOR
checkword [
checkword [']
checkword [CHAR]
checkword ]
checkdone