User Tools

Site Tools


tutorials:forth

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.

Primitive Dictionary

The following Forth words are hard-coded in the FORTH-10 dictionary.

DUP  SWAP  ROLL  PICK  DROP  OVER  ROT  -DUP  ?DUP  LEVEL  DEPTH  FLOAT  +  -
*  /  ^  F+  F-  F*  F/  FIX  MOD  /MOD  0=  0=_  0<  0<=  0>  0>=  EXCHANGE
JSYS  =  =_  <  <=  >  >=  FLUSH  TRACE  @  !  +!  -!  FILL  '  '#  ]  QUIT
<#  #  HOLD  #N  SIGN  #S  #>  HOME  CR  CLEAR  SPACE  SPACES  EMIT  TYPE
[TYPE]  KEY  ?TERMINAL  EXPECT  [EXPECT]  C@  C!  C>  C<  .  .R  F.  ."  :"
(")  ["]  VLIST  (  ABS  MINUS  +-  1+  1-  MAX  MIN  SINE  COSINE  ROOT  LN
<-,,  SW,,AP  ,,->  AND  OR  NOT  XOR  EXECUTE  FORGET  :  ;  <BUILDS  DOES>
,  ALLOT  LOAD  [LOAD]  UNLOAD  DECIMAL  OCTAL  BINARY  IF  ELSE  THEN  DO
LOOP  +LOOP  I  J  IJ..N  RUNT  REPEAT  UNTIL  CMOVE  [CMOVE]  HERE  LEAVE
ERROR  [NUMBER]  WHILE  BEGIN  END
123456789
!->= BINARY DROP F. KEY [NUMBER] SPACE
#-!@<BUILDSDUPF/LEAVEOCTALSPACES
#>.]C!-DUPFILLLEVELORSW,,AP
'.“0<C<?DUPFIXLNOVERSWAP
'#/0⇐C>ELSEFLOATLOADPICK?TERMINAL
(^0=C@EMITFLUSH[LOAD]QUITTHEN
(”):0=_CLEARENDFORGETLOOP.RTRACE
[“]:“0>CMOVEERRORHERE+LOOPREPEATTYPE
*;0>=[CMOVE]EXCHANGEHOLDMAXROLL[TYPE]
+<1+COSINEEXECUTEHOMEMINROOTUNLOAD
+!<#1-CREXPECTIMINUSROTUNTIL
+-ABSDECIMAL[EXPECT]IFMODRUNTVLIST
,=ALLOTDEPTHF*IJ..N/MOD#SWHILE
,,→=_ANDDOF+J#NSIGNXOR
←,,>BEGINDOES>F-JSYSNOTSINE

Start-Up File

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.

tutorials/forth.1641461397.txt.gz · Last modified: 2022/01/06 09:29 by papa