
Zx81 Forth Compiler.
--------------------



Revised and adapted by Dominique Contant 2009/10

Change done :

Ascii ZX81 conversion table:

		+------------+----------------+
		| ZX81 Forth | Standard Forth |
		+------------+----------------+
		|    (?)     |       '        |
		|   -( )-    |       [ ]      |
		|    +$      |       +!       |
		|    $       |       !        |
		|    C$      |       C!       |
		|    C£      |       C@       |
		|    £       |       @        |
		|    N>      |       #>       |
		|    <N      |       <#       |
		|    N       |       #        |
		|    NS      |       #S       |
		|    NIN     |       #IN      |
		|    *N      |       *#       |
		|    CAR     |       ASCII    |
		+------------+----------------+

For better FIG FORTH’s Standard 
1 - WE RENAME the original words
PAGE to CLS
PTC to AT
TYPE to TIPE (For later correct FIG Standard definition of TYPE) 

2 - Change on the following definition given by the Author:

a) In order to prevent problems with the IMMEDIATE dictionary, FORGET became now 
: FORGET CURRENT £ CONTEXT $ (?) DUP BEGIN COMPILER £ OVER OVER < WHILE DUP C£ + 1+ £ COMPILER $ REPEAT DROP 2 - £ CURRENT £ $ DP £ C£ 3 + - DP $ ;

b) Correction of some tipo with the GRAF routine.
c) several words as ARRAY REVERSE INKEY etc were not included in this file, as they will be included later in specific binary files such as GameUtility – MathUtility – GraficUtility aso  Remembering that they can be included at any time 

d) We switched STATE and MODE, giving back to STATE his original FIG purpose of Interpretation/compilation flag.
So,  in the THOMAS LÖW document

CASE: became 
: CASE: <BUILDS STATE 1SET DOES> SWAP 2 * + £  EXECUT ;

;CODE became
: ;CODE *N SCODE , STATE 0SET ; IMMEDIATE


3 - A Forth Editor written in Forth, beginning at h8000, were included. 


4 - VLIST list the dictionary.

EDIT            EP              COPY            S-AR            
S-AV            RETI            NIN             AJO             
REC             AVA             MP              LECIN$          
LECIN£          LECIN           LEC             DELETE          
INSERT          (IS)            (DS)            (DL)            
(IL)            CMOVE>          FORMAT          CLEAR           
ERASE           FILL            WRITE           -->             
COMPIL          READ            CMOVE           (LOOP-SCR)      
(LOOP-LINE)     (CS)            (CL)            (WL)            
(RL)            ENTETE          LIST            SCR             
(SCR)           (LINE)          FIRST           LIMIT           
SCR/DISK        L/SCR           B/LIN           R0              
S0              >R              MAX             MIN             
*               MULT            L-EDIT          VLIST           
LIST-VOC        LIST-WORD       LIST            L-EDIT          
LOAD            AT              /MOD            NOT             
XOR             OR              /               ALLOT           
MAX             MIN             HEX             DECIMAL         
FORGET          IMMEDIATE       <BUILDS         OUTIN           
VARIABLE        CONSTANT        DOES>           (?)             
:               CREATE          ?NUMBER         SCODE           
.               NS              N               PICK            
NEXT            END,            ?SEARCH         ENTRY           
?EXECUTE        DO,             D/MOD           NUMBER          
*               CAR             <N              C£              
J               N>              TYPE            SIGN            
R>              I               1SET            0SET            
AND             0=              +SP             EXECUT          
£               CLS             SWAP            -               
+               ,               *N              $               
ABS             TOKEN           SEARCH          KEY             
DROP            EMIT            ROT             0<              
>               <               DUP             DP              
STATE           COMPILER        CURRENT         CONTEXT         
ASPACE          BASE            FTOKEN          MODE            
CURSOR          LBP             INPUT           QUESTION        
=               HERE            CR              C$              
OVER            C,              1+              *(              
2+              +$              *WHILE          *END            
*ELSE           *IF             
                         
."              LEAVE           +LOOP           REPEAT          
WHILE           UNTIL           BEGIN           LOOP            
DO              ELSE            THEN            IF              
;                               
                             

5 - HERE point at h5EDB



Original project by
Professor Antonio Costa for "Compilador FORTH" Micro Sistemas N° 22 - august 1983.
http://www.datacassete.com.br/revistas/ms/20/micro_sistemas_22.pdf\

Zx81 conversion by
Tomas Löw for his conversion to ZX81 computer
Based on Ericson Benjamim's scans and the PDF documents.

Dominique Contant.
http://retroforth.com