home *** CD-ROM | disk | FTP | other *** search
- I. INTRODUCTION TO F-PC
-
-
-
- 1. F-PC, WHAT IS IT ALL ABOUT?
-
-
-
- This Forth was implemented by Tom Zimmer, with substantial help
- from Robert L. Smith. All of the direct threaded low level code
- modifications came from Bob's LaForth implementation. This is yet
- another step in the Forth evolution being undertaken to obtain the
- ideal Forth system. This Forth maintains very high compatibility
- with F83 which was it's predecessor.
-
- This Beta release of F-PC is a Forth that uses three main segments
- for Forth itself, and additional segments for other purposes, like
- the editor, screen saving, etc.
-
- The three main segments in F-PC are: First, a 64K segment for
- Code, variables, and any user arrays that are not specifically
- placed in an external segment. This segment also places the code
- field of all colon definitions in the Code Segment. Code fields
- in F-PC are three (3) bytes in length. The second segment contains
- the bodys of colon definitions and strings. Its size is not
- limited to 64K bytes, and can use as much memory as allowed by the
- operating system. The third segment of 64k contains the heads, or
- symbols in F-PC. The head space required is typically less than
- that for code or data, so this segment has been kept smaller.
-
- Since a typical program is about half program and half data, the
- separation of code and colon space results in an easy doubling or
- more of effective program space. About 300K of total data/program
- space is available, with most useful utilities already loaded.
- This can be increased to over 400k by deleting things you don't
- need.
-
- A small loss in performance resulted from this separation, but the
- benefits of expanded program space greatly exceeds the
- disadvantages.
-
- The primary problem that you are likely to encounter, is that code
- fields are three (3) bytes rather than 2, and the code field of a
- CODE word does not point to code, but contains code.
-
- F-PC has moved ":" LISTs to a separate segment, so there are two
- bytes in the BODY of each ":" definition that points into LIST
- space of the ":" definitions list of CFAs. LIST space is accessed
- with Long words, like L@ and L!. The LIST space can expand to
- fill all available RAM memory, not limited to a single 64K byte
- segment.
-
- VARIABLEs, CONSTANTs, and strings are handles in the same way as
- F83, that is they are in CODE space. This segmentation seems to
- provide a reasonable balance. As the dictionary expands, more user
- data space is needed, which works well with F-PC, as most of the
- free space is in CODE/DATA space.
-
- This system will full circle meta compile and extend, with the
- provided batch files for simplicity.
-
- As F-PC currently exists, there is about 30k of LIST dictionary
- space, and 40k of CODE space. which can be expanded by removing
- some of the optional files from the list of load files in F-PC.SEQ.
- The removable files are marked. Some of these files are listed as
- follows:
-
- PATHSET.SEQ WORDS.SEQ COLOR.SEQ DUMP.SEQ
- DECOM.SEQ DEBUG.SEQ STATUS.SEQ MACROS.SEQ
- PATCHER.SEQ FILSTAT.SEQ FWORDS.SEQ
-
- If some of these files are removed, a significant savings in
- dictionary space will result.
-
- Fairly large programs can now be coded in F-PC, although there are
- still some obvious limits. It is doubtful that ZoomRacks the
- database Tom coded while at QuickView systems could be compiled in
- F-PC without overlays. ZoomRacks consisted of more than 2M bytes
- of source screens, and used all ram outside the program as
- contiguous data space for the user.
-
- 2. NEW FEATURES IN F-PC
-
-
-
- The first thing you should know is that F-PC is trying to achieve a
- number of conflicting goals. It is intended to be a Forth system
- that provides all of the following:
-
- . A system that is familiar to the large installed base of F83
- users.
-
- . A system that brings Forth fully into the realm of files.
-
- . A Forth system that is not as strange as possible to C and
- Pascal programmers.
-
- . A system which maintains Forth's interactive nature.
-
- . A system which is FAST to compile and run.
-
- . A FAT system with many tools, which still has room for large
- application program.
-
- Impossible, you say. Perhaps, but if you give F-PC a chance you may
- find some things you like. In line with the above goals, here is a
- list of some of F-PC's major features:
-
- . Direct threaded dictionary for speed.
-
- . Separated lists & heads to increase space.
-
- . Prefix assembler to enhance readability.
-
- . Assembler supports both prefix as well as postfix assembly
- syntax for familiarity.
-
- . Full DOS access from system and COMMAND level control.
-
- . Full Handle/Path based file system.
-
- . View works across directory boundaries.
-
- . Full user configurable sequential text editor provided in
- source.
-
- . Full DOS memory management interface.
-
- Much more of course is provided, but enough of this
- editorialization. Let's get started.
-
-
-
- 3. EXPAND THE ARC FILES
-
-
-
- The first thing to remember is DON'T PANIC !!
-
- Once you have expanded the files on this disk, you will likely be
- a bit overloaded. Don't Panic, you don't have to consume all of
- this at once, examine it a little at a time.
-
- REMEMBER!
-
- Exploration is the Method.
- HELP, VIEW and SEE are the Keys!
-
- Start here, and follow the bouncing ball:
-
- F-PC is distributed on two 5.25" MSDOS DSDD diskettes. The first
- diskette contains;
-
- READ.ME Installation instructions
- PKXARC.COM A de-archive utility
- PKARC.COM The archive utility
- F-PC.ARC The F-PC Forth system
-
- Additional archive files are located on the second disk:
-
- ZIMMER.ARC Some tools from Tom Zimmer and others
- SMITH.ARC Some tools from Bob Smith
- CURLEY.ARC Some tools from Charles Curley
- TING.ARC Some tools from C. H. Ting
- F-PCHELP.ARC The F-PC help files
- F-PCDOC.ARC The F-PC documentation files
-
- The first thing we need to do is try and fill up your hard disk.
- F-PC will need about a megabyte of hard disk space. If you don't
- have that much available, you might think of doing some house
- cleaning first.
-
- Create a directory on your hard disk, called \F-PC, and copy all of
- the files from this disk into that directory. This sequence will
- do that:
- C: <enter> or D: if your hard disk is D:
- CD \ <enter>
- MD \F-PC <enter>
- CD \F-PC <enter>
-
- Place the first disk in Drive A:.
-
- COPY A:*.* \F-PC <enter>
-
- When the copy is finished, put the second disk in Drive A:.
-
- COPY A:*.* \F-PC <enter>
-
- Now expand the archive files:
-
- PKXARC * <enter>
-
- This will result in a large number of files being added to your
- hard disk, consuming about 1 and 1/4 megabyte including the
- archive files.
-
-
-
- 4. INSTALL F-PC
-
-
-
- Now that you have expanded F-PC onto your hard disk, you need to
- install F-PC for your computer. This is done easily as follows:
-
- INSTALL <enter>
-
- A new F-PC.EXE will be created.
-
- This is the primary file of interest F-PC.EXE. F-PC is Full segment
- direct threaded Forth. You can start up that this F-PC by typing
- its name:
-
- F-PC <enter>
-
- You should now be running the F-PC Forth system. If that makes you
- uncomfortable, you can type BYE to leave.
-
- Lets start off by printing some documentation. There are several
- .TXT documentation files on the disk, so lets print them. Set up
- your printer with at least 75 sheets of paper, and type the
- following:
-
- FPRINT *.TXT *.HLP <enter>
-
- F-PC will print all of the text and help files in the current
- directory. Among these is a file called F-PC.TXT, it will give you
- an overview, and some examples of the special words in F-PC, and
- how they are used. The first chapter of F-PC includes a small
- tutorial which is included as the next section here. You might
- want to walk through it to get familiar with it. Other text files
- provide additional information on specific topics.
-
- If you don't have a batch file called INSTALL.BAT, then you can
- type the command manually as follows:
-
- KERNEL - SEQINIT FLOAD F-PC.SEQ <enter>
-
- Either of the above will re-compile F-PC from the KERNEL file,
- configuring F-PC for your directory structure in the process.
-
- You will probably want to read the screen while the install is
- taking place, as several interesting messages are displayed while
- the installation occurs.
-
-
- 5. MEMORY REQUIREMENTS
-
-
-
- F-PC is a memory HOG. The three segments used for Forth itself is
- ONLY the BEGINNING. F-PC also uses extra segment space for other
- things, here is a fairly complete list:
-
- Forth Code Segment 64k
- Forth List Segment 128k
- Forth Head Segment 64k
- Screen save and restore buffers 16k
- Compiler mass storage buffering 1k
- Macros save buffer 2k
- Editor edit buffer 64k editor
- Editor line pointer buffer 8k editor
- Line delete/restore buffer in editor 12k editor
-
- As you can see much of the above memory is needed by the editor.
- This space is not allocated until the editor is envoked.
-
- F-PC is even more hungry for mass storage than it is for memory. I
- have been able to use F-PC on a DUAL floppy based system, but there
- are problems. Try unarchiving the .EXE file to one disk, and the
- .SEQ files to another disk. Not all the .SEQ files will fit on a
- disk, but most will.
-
- A typical system in which F-PC can run comfortably thus requires
- 640K bytes of memory, 1.5M to 2M bytes of hard disk, and one or
- two floppy disk drives. Less than these, you will run into minor
- annoyments using F-PC.
-
-
-
- 6. A SHORT TUTORIAL
-
-
-
- Once F-PC has been installed on your computer, you can start it up
- by typing "F-PC <enter>" from the keyboard. This will display a
- sign-on message about the version number, available memory,
- authors, etc.
-
- To opening a file, type the following:
-
- OPEN BANNER <enter>
-
- The file BANNER.SEQ will be opened. We can load it with:
-
- 1 LOAD <enter>
-
- This prints a nice demo message. This demo came from the F83X
- system written by Wil Baden.
-
- We can edit the source for BANNER by typing:
-
- ED <enter>
-
- You will now be in the editor, viewing the first 20 lines or so of
- BANNER.SEQ. You can page down through the file with the PgDn key
- on the keypad, and back up with the PgUp key. For now, page down
- to the bottom of the file with PgDn, and there you see the
- definition of the word DEMO, which prints out our demonstration
- banner.
-
- Now let's create a new file and put a new DEMO definition with our
- own banner message in it. Leave the editor by typing Shift-ESC
- twice, that is, hold down the Shift key and press the ESC key two
- times. You will now be back in Forth without saving any changes
- you may have accidentally made to BANNER.SEQ.
-
- To create the new file, type the following:
-
- SED MYBANNER <enter>
-
- F-PC will start the editor, and try to open the file MYBANNER. If
- it is present, F-PC will open it. If it is not, then F-PC will
- automatically create a new file called MYBANNER.SEQ and place you
- in the editor in that file, prepared to enter text.
-
- Type in the following definition, using the <enter> key to add new
- lines to the file as needed. The arrow keys can be used to move
- around, but you will not be allowed to move below the line
- containing the little up pointing triangle at the left edge of the
- screen, as this represents the end of the current file.
-
- : MYBANNER ( --- )
- " HELLO" BANNER
- " FROM" BANNER
- " YOURNAME" BANNER ;
-
- Note that YOURNAME must be no longer than 11 characters.
-
- Now that you have typed in or edited the above definition into the
- file BANNER.SEQ, leave the editor saving the text you have
- entered, by pressing ESC twice. DON'T use Shift this time, as we
- REALLY want to save the program.
-
- Let's compile the program. Type:
-
- FLOAD MYBANNER <enter>
-
- The file MYBANNER.SEQ is opened, and loaded. If you entered the
- program as shown, then all should be well, and Forth should come
- back with the "ok" message. You could have compiled the program
- by typing 1 LOAD <enter>, since the file was already open.
-
- Now that MYBANNER is compiled, type its name to make it do it's
- stuff:
-
- MYBANNER <enter>
-
- You should have seen your name scroll up on the screen, if you
- didn't, try editing the source file and correcting your typing
- error.
-
- At this point, you can VIEW the source for MYBANNER by typing:
-
- VIEW MYBANNER <enter>
-
- F-PC will locate the source for your MYBANNER word, and display the
- source file starting at the line where MYBANNER was started. A
- shorter word for VIEW called LL (Locate & List) is provided to
- save typing.
-
- Now let's look at some Forth words with LL, and some of the other
- file traversal words. Type:
-
- LL DUP <enter>
-
- The source for DUP will be displayed, with the line where the
- definition of DUP starts underlined. Above the line where DUP
- starts is the reverse video message showing the filename of the
- source for DUP. Now type:
-
- N <enter>
-
- The screen will blink and display group of lines starting 16 lines
- farther into the KERNEL1.SEQ source file. With the "N" word, you
- can scan quickly through a sequential file. The inverse of "N" is
- "B". If you type it followed by <enter>, the previous 16 lines
- will be displayed. Another display word "L" is provided to
- redisplay the current location in the file again.
-
- One last word you will find VERY useful is WORDS. It is used as
- follows:
-
- WORDS HE <enter>
-
- The above command sequence will display all words in all
- vocabularies of Forth that contain the letter sequence "HE". This
- is very useful when you don't know how to spell the word you are
- looking for, but you know it contains a particular character
- sequence. WORDS by it self will show all words in the current
- vocabulary only, and the special sequence "*.*" following WORDS is
- recognized as a command to display all words of all vocabularies.
-
- Here is a list of the words we have covered.
-
- OPEN <filename> <enter> Opens filename.
-
- 1 LOAD <enter> Compiles the open file.
-
- ED <enter> Starts editing the current
- file.
-
- SED <filename> <enter> Specifies a file to edit.
-
- FLOAD <filename> <enter> Loads filename.
-
- HELP <enter> Displays a help screen.
- HELP <forth_word> <enter> Shows the source for a
- VIEW <forth_word> <enter> Forth word.
- LL <forth_word> <enter>
-
- N <enter> Shows next 16 lines.
-
- B <enter> Shows previous 16 lines.
-
- L <enter> Re-display current 16
- lines.
-
- WORDS <sub_string> <enter> Display all words
- containing
- <sub_string> in all
- vocabularies.
-
- SEE <word> Decompile the memory copy
- of the word, and show the
- source.
-
-
-
- 7. THE ON-LINE TUTORIAL
-
-
-
- There is also an on-line tutorial coming with F-PC. If contains
- much of the same information in the above tutorial but with
- different arrangement of topics. To use this on-line tutorial,
- type the following commands in F-PC and then follow the
- instructions:
-
- OPEN INTRO <enter>
- L <enter>
-
-