beyond this: I want to be able to, with a couple of exceptions, be compatible
with the description of forth contained in the second edition of Leo Brodie's
book "Starting Forth".) I'm fairly happy with my progress so far. Of the
-131 required F83 words, only 26 remain unimplemented. These words fall into
+131 required F83 words, only 22 remain unimplemented. These words fall into
three categories: those I intend to implement in the near future, those I may
possibly implement at some point, and those that I do not intend to ever implement
for reasons of obsolescence or incompatibility with the design of the VM.
### F83 Words to be implemented soon
- PAD ABORT" CMOVE> VOCABULARY DEFINITIONS FORTH
+ PAD ABORT"
-User-defined vocabularies aren't in there yet but this should be easy to solve.
-`PAD`, `ABORT` and `CMOVE>` are simple oversights.
+The words `PAD` is a simple oversite. `ABORT"` will also be implemented soon.
### F83 Words that may be implemented someday
['] LIT , ,
;
-\ LFA of most recent definition
+\ Address containing LFA of most recent definition
: LATEST
CURRENT @ 1+ ;
F_IMMED AND ( mask the F_IMMED flag and return it (as a truth value) )
;
+: BODYLEN
+ \ **TODO**
+;
+
: SEE
BL WORD FIND ( find the dictionary entry to decompile )
EXIT
THEN
- >LINK
-
- ( Now we search again, looking for the next word in the dictionary. This gives us
- the length of the word that we will be decompiling. (Well, mostly it does). )
- HERE ( address of the end of the last compiled word )
- LATEST @ ( word last curr )
- BEGIN
- 2 PICK ( word last curr word )
- OVER ( word last curr word curr )
- <> ( word last curr word<>curr? )
- WHILE ( word last curr )
- NIP ( word curr )
- DUP @ ( word curr prev (which becomes: word last curr) )
- REPEAT
-
- DROP ( at this point, the stack is: start-of-word end-of-word )
- SWAP ( end-of-word start-of-word )
+ DUP DUP BODYLEN + SWAP >LINK
DUP LINK> @ CASE
DOCOL OF
\ Vocabulary management
+\ Forget word and everything defined after it in compilation dict
: FORGET
- BL WORD FIND >LINK ( find the word, gets the dictionary entry address )
+ BL WORD CURRENT @ FINDVOCAB ( find the word, gets the dictionary entry address )
+
+ 0= if
+ drop exit
+ then
+
+ >link
+
DUP @ LATEST ! ( set LATEST to point to the previous word )
- H ! ( and store H with the dictionary address )
;
: HIDE
DUP @ F_HIDDEN OR SWAP !
;
-: VOCAB>LATEST ( vcfa -- vlatest )
- 1+ @ @ ;
-
\ Create new vocabulary
: VOCABULARY
create 0 ,