This is an old revision of the document!
FORTH-10 is a Forth language interpreter included in the Panda TOPS-20 distribution. The anonymous programmer describes the implementation as “NOT totally standard”. The interpreter can be started with the following command on TWENEX:
@FORTH
MIDAS assembly language source is available in file TOPS20:<UTILITIES>FORTH.MID
.
The following Forth words are hard-coded in the FORTH-10 dictionary.
+ ( n1 n2 – n1+n2 )
1+ ( n – n+1 )
- ( n1 n2 – n1-n2 )
1- ( n – n-1 )
* ( n1 n2 – n1*n2 )
MINUS ( n – -n )
ABS ( n – |n| )
MAX ( n1 n2 – n ) n is the greater of n1 or n2
MIN ( n1 n2 – n ) n is the lesser of n1 or n2
/ ( n1 n2 – n1/n2 ) integer division
MOD ( n1 n2 – n ) n is the modulus of n1/n2
/MOD ( n1 n2 – n3 n4 ) n3 is the modulus of n1/n2, n4 is the integer quotient (n1 = n2*n4+n3)
F+ ( r1 r2 – r1+r2 ) floating point addition
F- ( r1 r2 – r1-r2 ) floating point subtraction
F* ( r1 r2 – r1*r2 ) floating point multiplication
F/ ( r1 r2 – r1/r2 ) floating point division
DROP ( n – )
DUP ( n – n n )
OVER ( n1 n2 – n1 n2 n1 )
PICK ( n1 – n2 ) n2 is the n1th item from the top of the stack
SWAP ( n1 n2 – n2 n1 )
ROT ( n1 n2 n3 – n2 n3 n1 ) rotate
-DUP ( n – 0 | n n ) duplicate n if non-zero
?DUP ( n – 0 | n n ) duplicate n if non-zero
ROLL ( – ) (BROKEN)
: ( – ) colon definition
: name ( ... -- ... ) word1 word2 ... ;
Create a word name that executes word1 word2 ….
; ( – ) close colon definition
( ( – ) remark (includes following words until next “)”)
@ ( address – n ) n is contents of address
! ( n address – ) store n in address
+! ( n address – ) add n to contents of address
At start-up, FORTH-10 searches the user's log-in directory for a file named AUTO-LOAD.4TH
. If such a file exists, it is loaded automatically. If the file does not exist, FORTH-10 displays a standard greeting message.