Quote:
Do you mean having blocks in a named file or Forth source in a text file?
Both. But blocks are not padded with spaces like in screens. The idea is to load a text file which requites 2 buffers. One for the OPEN command and one for the READ command. Prodos requires the OPEN file buffer for information about the file. The READ buffer is for the actual data. A block (1024 bytes) of text gets read in at a time. Each line delimited by a CR is moved to PAD and the CR converted to a zero. That line gets compiled, then the next line gets read in. If the end of the buffer is reached and a line is cut off when being moved to PAD, then the next block gets read in. This continues until the end of the file is reached. The RUN word launches the last word that gets loaded and launches the application. This makes it easy to have all the applications, games, and utilities stored in text files and can be swapped easily between them with LOAD TEXTFILE and FORGET TASK.
Quote:
Fleet Forth maintains one or more buffers for blocks. I usually use four, but I sometimes use more when manipulating blocks. The buffers are right up against the memory limit specified by the system value LIMIT .
I need a minimum 2 buffers for Prodos. The first one is reserved for information about the file and used by the Machine Interface and the second one is used to load the actual data.
Quote:
LIMIT can be lowered if the need arises.
In ProForth,
LIMIT is pointing at the USER area with the buffers just underneath.
FIRST is used to designate the start of the buffers. But I would prefer to have
LIMIT designated to be the upper limit of free memory.
Quote:
Fleet Forth's errors are part of the system.
ProForth errors are actually part of a screen file. The screen file is a file on disk that houses 16 screens of 1024 bytes and takes up 1 constant buffer. But there is a lot of waste with the screens as every line is padded with spaces. Thus I want to make the errors part of the system and convert everything else to text file delimited by a CR to eliminate all the wasted space.
Quote:
I've tried streamlining Fleet Forth since releasing my initial prototype.
The Fleet Forth kernel is under ten k (about nine and three quarter). It is a complete Forth-83 system without an assembler or editor so I suppose the name 'kernel' is a bit of a misnomer. Part of the cold start routine switches out BASIC ROM because it is not needed.
I am trying to weed the kernel down to being just the primitives required to compile a colon definition and code words. Everything else can be added through text file loading as required.
Quote:
The kernel plus system loader is just under 15.5 k.
If all goes well, I believe I can get the bare kernel down to under 5 K. The system loader will move all the actual names and their CFA's of the words to Auxiliary memory along with a sorting algorithm. This sorter will cut compiling time down into a fraction of the time and also eliminates a lot of words when they are with their description. LFA, NFA, PFA, TRAVERSE, COUNT are no longer needed. And the dictionary of words can be listed in alphabetical order or just the words that are part of a VOCABULARY, which makes words easier to find in the list. I can also just list words that start with the first letter. Really nice not to have the entire word library listed every time.
Quote:
The system loader includes the assembler, the Starting Forth editor, the screen editor
I already have very nice system applications of these three, even though I have to leave FORTH. But I am not ready to re-invent the wheel right now.
Quote:
I have successfully ported Blazin' Forth's graphics words to Fleet Forth.
Graphics is on my to-do list
Quote:
Blazin' Forth's graphics utilities add turtle graphics to Forth.
I also have turtle graphics in an ML program. It wouldn't take much to separate the code and make word definitions for each turtle command.
Quote:
Quote:
or write large applications with Fleet Forth?
The last 'application' I wrote in Forth on the C64 was "A Virtual Nondeterministic Machine in Forth". If memory is tight, the extras can be left out.
This is where my theory of loading text files for an application can benefit. It can load larger programs in memory than can fit when creating them, as the editor and assembler are also in memory when creating applications. I will have the ability to clear the first words create and then append extra words to a text file.
Quote:
That is why SEE is so big. It also decompiles CODE words and handles the transition from high level to CODE and back.
I call my word decompiler
DECODE and it does a pretty good job at decoding everything. The one problem I have to rectify yet is that
-FIND returns the PFA of a word. The problem with that is that some words do not have a PFA. The CFA points somewhere else in memory. Then comes the big crash to the monitor.
Can your
SEE decode
BRANCH and
0BRANCH back into
IF-ELSE-THEN or
BEGIN-UNTIL (REPEAT or AGAIN) statements? I think I have it figured, but just when I think I have it figured out, I question my logic.