nFORTH

Documentation
Login

Wiki Home / AN INTRODUCTION TO NFORTH

Prev: 3 Model Organization

4 Installation

We see the following methods of getting a functioning fig-FORTH system:

       1. 
          Buy loadable object code from a vendor who has customized. 
       2. 
          Obtain an assembly listing with the installation dependent
          code supplied by the vendor. Assemble and execute. 
       3. 
          Edit the FIG assembly listing on your system, re-write the I-O
          routines, and assemble. 
       4. 
          Load someone else's object code up to the installation
          dependent code. Hand assemble equivalents for your system and
          poke in with your monitor. Begin execution and type in
          (self-compile) the rest of the system. This takes about two
          hours once you under stand the structure of Forth (but that
          will take much more time!). 

Let us examine Step 3, above, in fuller detail. If you wish to bring up Forth only from this model, here are the sequential steps:

4.1 Familiarize yourself with the model written in Forth, the glossary, and specific assembly listings.

4.2 Edit the assembly listings into your system. Set the boot-up parameters at origin offset 0A, 0B (bytes) to 0000 (warning=00).

4.3 Alter the terminal support code (KEY, EMIT, etc,) to match your system. Observe register protocol specific to your implementation!

4.4 Place a break to your monitor at the end of NEXT, just before indirectly jumping via register W to execution. W is the Forth name for the register holding a code field address, and may be differently referenced in your listings.

4.5 Enter the cold start at the origin. Upon the break, check that the interpretive pointer IP points within ABORT and W points to SP!. If COLD is a colon-definition, then the IP has been initialized on the way to NEXT and your testing will begin in COLD. The purpose of COLD is to initialize IP, SP, RP, VP, and some user variables from the start-up parameters at the origin.

4.6 Continue execution one word at a time. Clever individuals could write a simple trace routine to print IP, W, SP, RP and the top of the stacks. Run in this single step mode until the greeting message is printed. Note that the interpretation is several hundred cycles to this stage!

4.7 Execution errors may be localized by observing the above pointers when a crash occurs.

4.8 After the word QUIT is executed (incrementally), and you can input a "return" key and get OK printed, remove the break. You may have some remaining errors, but a reset and examination of the above registers will again localize problems.

4.9 When the system is interpreting from the keyboard, execute EMPTY-BUFFERS to clear the disc buffer area. You may test the disc access by typing: 0 BLOCK 64 TYPE This should bring sector zero from the disc to a buffer and type the first 64 characters. This sector usually contains ascii text of the disc directory. If BLOCK (and R/W) doesn't function--happy hunting!

5.0 If your disc driver differs from the assembly version, you must create your own R/W. This word does a range check (with error message), modulo math to derive sector, track, and drive and passes values to a sector-read and sector-write routine.

         RAM DISC SIMULATION

If disc is not available, a simulation of BLOCK and BUFFER may be made in RAM. The following definitions setup high memory as mass storage. Referenced 'screens' are then brought to the 'disc buffer' area. This is a good method to test the start-up program even if disc may be available.

HEX
4000 CONSTANT LO ( START OF BUFFER AREA ) 6800 CONSTANT HI ( 10 SCREEN EQUIVALENT ) : R/W >R ( save boolean ) B/BUF * LO + DUP HI > 6 ?ERROR ( range check ) R> IF ( read ) SWAP ENDIF B/BUF CMOVE ;

Insert the code field address of R/W into BLOCK and BUFFER and proceed as if testing disc. R/W simulates screens 0 thru 9 when B/BUF is 128, in the memory area $4000 thru $6BFF.

     fig-FORTH VARIABLE NAME FIELD

A major FIG innovation in this model, is the introduction of variable length definition names in compiled dictionary entries. Previous methods only saved three letters and the character count.

The user may select the letter count saved, up to the full natural length. See the glossary definition for WIDTH.

In this model, the following conventions have been established.

  1. The first byte of the name field has the natural character count in the low 5 bits.
  2. The sixth bit = 1 when smudged, and will prevent a match by (FIND).
  3. The seventh bit = 1 for IMMEDIATE definitions; it is called the precedence bit.
  4. The eighth or sign bit is always = 1.
  5. The following bytes contain the names' letters, up to the value in WIDTH.
  6. In the byte containing the last letter saved, the sign bit = 1.
  7. In word addressing computer, a name may be padded with a blank to a word boundary.

The above methods are implemented in CREATE. Remember that -FIND uses BL WORD to bring the next text to HERE with the count preceeding. All that is necessary, is to limit by WIDTH and toggle the proper delimiting bits.

Next: 5 Memory Map

Page navigation by slowLinks, (C) SlowCorners, 2020