papierkorb:fig-forth_installation_manual
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| papierkorb:fig-forth_installation_manual [2025-08-10 22:50] – ↷ Seite von projects:fig-forth_installation_manual nach papierkorb:fig-forth_installation_manual verschoben mka | papierkorb:fig-forth_installation_manual [Unbekanntes Datum] (aktuell) – gelöscht - Externe Bearbeitung (Unbekanntes Datum) 127.0.0.1 | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| - | < | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | fig-FORTH | ||
| - | | ||
| - | | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | | ||
| - | |||
| - | MODEL | ||
| - | |||
| - | EDITOR | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | RELEASE 1 | ||
| - | |||
| - | WITH COMPILER SECURITY | ||
| - | |||
| - | AND | ||
| - | |||
| - | VARIABLE LENGTH NAMES | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | BY | ||
| - | |||
| - | | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | | ||
| - | |||
| - | |||
| - | |||
| - | | ||
| - | 1105, San Carlos, CA 94070 | ||
| - | |||
| - | | ||
| - | this notice. | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | fig-FORTH INSTALLATION MANUAL | ||
| - | |||
| - | |||
| - | 1.0 INTRODUCTION | ||
| - | |||
| - | 2.0 DISTRIBUTION | ||
| - | |||
| - | 3.0 MODEL ORGANIZATION | ||
| - | |||
| - | 4.0 INSTALLATION | ||
| - | |||
| - | 5.0 MEMORY MAP | ||
| - | |||
| - | 6.0 DOCUMENTATION SUMMARY | ||
| - | |||
| - | |||
| - | |||
| - | 1.0 INTRODUCTION | ||
| - | |||
| - | The fig-FORTH implementation project occurred because a key group of | ||
| - | Forth fanciers wished to make this valuable tool available on a | ||
| - | | ||
| - | nine systems level programmers, | ||
| - | | ||
| - | of Forth into assembly language listings for each computer. | ||
| - | | ||
| - | | ||
| - | work. | ||
| - | |||
| - | | ||
| - | 2.0 DISTRIBUTION | ||
| - | |||
| - | All publications of the Forth Interest Group are public domain. | ||
| - | They may be further reproduced and distributed by inclusion of this | ||
| - | | ||
| - | |||
| - | This publication has been made available | ||
| - | by the Forth Interest Group, | ||
| - | P. O. box 1105, San Carlos, CA 94070 | ||
| - | |||
| - | We intend that our primary recipients of the Implementation Project | ||
| - | be computer users groups, libraries, and commercial vendors. | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | and customer support better reserved for commercial vendors. | ||
| - | | ||
| - | | ||
| - | will aid in the use of Forth and increase the user expectation of | ||
| - | the performance of high level computer languages. | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | 1 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | | ||
| - | |||
| - | The fig-FORTH model deviates a bit from the usual loading method of | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | |||
| - | Our model has 4 to 5 k bytes written as assembler listings. | ||
| - | | ||
| - | more assembly source, or by disc compilation. | ||
| - | | ||
| - | | ||
| - | for workspace. | ||
| - | |||
| - | | ||
| - | | ||
| - | |||
| - | The model consists of 7 distinct areas. | ||
| - | from low memory to high. | ||
| - | |||
| - | | ||
| - | | ||
| - | High level utility definitions | ||
| - | | ||
| - | High level definitions | ||
| - | | ||
| - | RAM memory workspace | ||
| - | |||
| - | | ||
| - | 3.2 MODEL DETAILS | ||
| - | |||
| - | | ||
| - | |||
| - | This area consists of 34 bytes containing a jump to the cold start, | ||
| - | jump to the warm re-start and initial values for user variables and | ||
| - | | ||
| - | | ||
| - | | ||
| - | |||
| - | | ||
| - | |||
| - | This area consists of about 600 to 800 bytes of machine executable | ||
| - | code in the form of Forth word definitions. | ||
| - | | ||
| - | this code, the balance of Forth contains a pseudo-code compiled of | ||
| - | " | ||
| - | the " | ||
| - | | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | 2 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | | ||
| - | |||
| - | These are colon-definitions, | ||
| - | | ||
| - | They comprise the bulk of the system, enabling you to execute and | ||
| - | | ||
| - | disc) is available, you may also execute and compile from this | ||
| - | | ||
| - | be made thru the assembler source listings. | ||
| - | |||
| - | |||
| - | | ||
| - | |||
| - | This area is the only portion that need change between different | ||
| - | | ||
| - | | ||
| - | |||
| - | (KEY) Push the next ascii value (7 bits) from the terminal | ||
| - | keystroke to the computation stack and execute NEXT. High 9 | ||
| - | bits are zero. Do not echo this character, especially a | ||
| - | control character. | ||
| - | |||
| - | (EMIT) | ||
| - | low 7 bits on the terminal device, then execute NEXT. Control | ||
| - | characters have their natural functions. | ||
| - | |||
| - | (? | ||
| - | and push to the computation stack 0001 if it was found | ||
| - | depressed; otherwise 0000. Execute NEXT. If no break key is | ||
| - | available, sense any key depression as a break (sense but don' | ||
| - | wait for a key). If both the above are unavailable, | ||
| - | push 0000 and execute NEXT. | ||
| - | |||
| - | (CR) Execute a terminal carriage return and line feed. Execute | ||
| - | NEXT. | ||
| - | | ||
| - | When each of these words is executed, the interpreter vectors from | ||
| - | the definition header to these code sequences. | ||
| - | | ||
| - | and observe operating system protocols. | ||
| - | | ||
| - | |||
| - | R/W This colon-definition is the standard linkage to your | ||
| - | disc. It requests the read or write of a disc sector. | ||
| - | usually requires supporting code definitions. | ||
| - | of self-contained code or call ROM monitor code. When R/W is | ||
| - | assembled, its code field address is inserted once in BLOCK and | ||
| - | once in BUFFER. | ||
| - | |||
| - | An alternate version of R/W is included that simulates disc | ||
| - | storage in RAM. If you have over 16 k bytes this is practical | ||
| - | for startup and limited operation with cassette. | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | 3 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | | ||
| - | |||
| - | The next section contains about 30 definitions involving user | ||
| - | | ||
| - | | ||
| - | | ||
| - | once your full system is up, you may FORGET part of the high-level | ||
| - | and re-compile altered definitions from disc. | ||
| - | |||
| - | |||
| - | | ||
| - | |||
| - | A text editor and machine code assembler are normally resident. | ||
| - | are including a sample editor, and hope to provide Forth assemblers. | ||
| - | The editor is compiled from the terminal the first time, and then | ||
| - | used to place the editor and assembler source code on disc. | ||
| - | |||
| - | It is essential that you regard the assembly listing as just a way | ||
| - | to get Forth installed on your system. | ||
| - | be planned and tested at the usual Forth high level and then the | ||
| - | | ||
| - | an assembly level tends to be non-portable, | ||
| - | |||
| - | | ||
| - | RAM Workspace | ||
| - | |||
| - | For a single user system, at least 2k bytes must be available above | ||
| - | the compiled system (the dictionary). | ||
| - | most typical. | ||
| - | |||
| - | The RAM workspace contains the computation and return stacks, user | ||
| - | area, terminal input buffer, disc buffer and compilation space for | ||
| - | the dictionary. | ||
| - | |||
| - | |||
| - | 4.0 INSTALLATION | ||
| - | |||
| - | We see the following methods of getting a functioning fig-FORTH | ||
| - | | ||
| - | |||
| - | | ||
| - | |||
| - | | ||
| - | | ||
| - | |||
| - | | ||
| - | | ||
| - | |||
| - | | ||
| - | | ||
| - | with your monitor. | ||
| - | the rest of the system. | ||
| - | | ||
| - | | ||
| - | |||
| - | |||
| - | |||
| - | 4 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | Let us examine Step 3, above, in fuller detail. | ||
| - | bring up Forth only from this model, here are the sequential steps: | ||
| - | |||
| - | | ||
| - | glossary, and specific assembly listings. | ||
| - | |||
| - | | ||
| - | parameters at origin offset 0A, 0B (bytes) to 0000 | ||
| - | (warning=00). | ||
| - | |||
| - | | ||
| - | system. Observe register protocol specific to your | ||
| - | implementation! | ||
| - | |||
| - | | ||
| - | indirectly jumping via register W to execution. | ||
| - | name for the register holding a code field address, and may be | ||
| - | differently referenced in your listings. | ||
| - | |||
| - | | ||
| - | the interpretive pointer IP points within ABORT and W points to | ||
| - | SP!. If COLD is a colon-definition, | ||
| - | initialized on the way to NEXT and your testing will begin in | ||
| - | COLD. The purpose of COLD is to initialize IP, SP, RP, UP, and | ||
| - | some user variables from the start-up parameters at the origin. | ||
| - | |||
| - | | ||
| - | could write a simple trace routine to print IP, W, SP, RP and | ||
| - | the top of the stacks. | ||
| - | greeting message is printed. | ||
| - | several hundred cycles to this stage! | ||
| - | |||
| - | | ||
| - | pointers when a crash occurs. | ||
| - | |||
| - | | ||
| - | input a " | ||
| - | may have some remaining errors, but a reset and examination of | ||
| - | the above registers will again localize problems. | ||
| - | |||
| - | | ||
| - | EMPTY-BUFFERS to clear the disc buffer area. You may test the | ||
| - | disc access by typing: | ||
| - | 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. | ||
| - | function--happy hunting! | ||
| - | |||
| - | | ||
| - | 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. | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | 5 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | 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 | ||
| - | | ||
| - | | ||
| - | disc may be available. | ||
| - | |||
| - | | ||
| - | | ||
| - | | ||
| - | : R/W >R ( save boolean ) | ||
| - | B/BUF * LO + DUP | ||
| - | HI > 6 ?ERROR ( range check ) | ||
| - | R> IF ( read ) SWAP ENDIF | ||
| - | B/BUF CMOVE ; | ||
| - | |||
| - | | ||
| - | | ||
| - | 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 | ||
| - | | ||
| - | | ||
| - | |||
| - | The user may select the letter count saved, up to the full natural | ||
| - | | ||
| - | |||
| - | 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; | ||
| - | 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. | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | 6 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | The above methods are implemented in CREATE. Remember that -FIND | ||
| - | | ||
| - | | ||
| - | the proper delimiting bits. | ||
| - | |||
| - | |||
| - | | ||
| - | |||
| - | The following memory map is broadly used. Specific installations may | ||
| - | | ||
| - | | ||
| - | |||
| - | The disc buffer area is at the upper bound of RAM memory. | ||
| - | | ||
| - | B/BUF is the number of bytes read from the disc, usually one sector. | ||
| - | B/BUF must be a power of two (64, 128, 256, 512 or 1024). | ||
| - | | ||
| - | first buffer. | ||
| - | top buffer. | ||
| - | | ||
| - | |||
| - | | ||
| - | | ||
| - | |||
| - | The user area must be at least 34 bytes; 48 is more appropriate. | ||
| - | a multi-user system, each user has his own user area, for his copy | ||
| - | of system variables. | ||
| - | | ||
| - | |||
| - | The terminal input buffer is decimal 80 bytes (the hex 50 in QUERY) | ||
| - | plus 2 at the end. If a different value is desired, change the | ||
| - | limit in QUERY. | ||
| - | | ||
| - | the boot-up origin parameters. | ||
| - | " | ||
| - | |||
| - | The return stack grows downward from the user area toward the | ||
| - | | ||
| - | in R0 (R-zero) and is loaded from a boot-up literal. | ||
| - | |||
| - | The computation stack grows downward from the terminal buffer toward | ||
| - | the dictionary, which grows upward. | ||
| - | | ||
| - | |||
| - | After a cold start, the user variables contain the addresses of the | ||
| - | above memory assignments. | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | |||
| - | HEX 08 0E +ORIGIN | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | 7 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | 6.0 DOCUMENTATION SUMMARY | ||
| - | |||
| - | The following manuals are in print: | ||
| - | |||
| - | | ||
| - | | ||
| - | the Caltech Book Store, Pasadena, CA. | ||
| - | |||
| - | Kitt Peak Forth Primer, $20.00 postpaid from the Forth Interest | ||
| - | | ||
| - | |||
| - | | ||
| - | | ||
| - | |||
| - | Forth Dimensions, newsletter of the Forth Interest Group, $5.00 for | ||
| - | 6 issues including membership. | ||
| - | 94070 | ||
| - | | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | 8 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | | ||
| - | | ||
| - | | ||
| - | |||
| - | LIMIT ---> | ||
| - | | ||
| - | | ||
| - | | ||
| - | FIRST ---> | ||
| - | |||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | |||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | |||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | |||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | " | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | |||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | 9 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | 6502 | ||
| - | | ||
| - | | ||
| - | |||
| - | LIMIT ---> | ||
| - | | ||
| - | | ||
| - | | ||
| - | FIRST ---> | ||
| - | |||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | |||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | " | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | -------------------------------- | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | |||
| - | $01FF ---> | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | $0100 ---> | ||
| - | |||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | |||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | |||
| - | |||
| - | |||
| - | 10 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | fig-FORTH GLOSSARY | ||
| - | |||
| - | |||
| - | | ||
| - | | ||
| - | sort. | ||
| - | |||
| - | The first line of each entry shows a symbolic description of the | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | of the stack is to the right. | ||
| - | |||
| - | The symbols include: | ||
| - | |||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | with sign on top of stack. | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | |||
| - | The capital letters on the right show definition characteristics: | ||
| - | |||
| - | | ||
| - | | ||
| - | one. | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | |||
| - | | ||
| - | | ||
| - | | ||
| - | For 32 bit signed double numbers, the most significant (with the | ||
| - | sign) is on top. | ||
| - | |||
| - | All arithmetic is implicitly 16 bit signed integer math, with error | ||
| - | and under-flow indication unspecified. | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | 11 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | ! | ||
| - | Store 16 bits of n at address. | ||
| - | |||
| - | !CSP | ||
| - | Save the stack position in CSP. Used as part of the | ||
| - | | ||
| - | |||
| - | # | ||
| - | | ||
| - | which is placed in an output string. | ||
| - | | ||
| - | | ||
| - | |||
| - | #> d --- addr count L0 | ||
| - | | ||
| - | | ||
| - | TYPE. | ||
| - | |||
| - | #S d1 --- d2 L0 | ||
| - | | ||
| - | of #, until a zero double number n2 results. | ||
| - | <# and #>. | ||
| - | |||
| - | ' | ||
| - | Used in the form: | ||
| - | ' | ||
| - | | ||
| - | | ||
| - | | ||
| - | word is not found after a search of CONTEXT and CURRENT, | ||
| - | an appropriate error message is given. | ||
| - | |||
| - | ( P,L0 | ||
| - | Used in the form: | ||
| - | ( cccc) | ||
| - | | ||
| - | | ||
| - | or in a colon-definition. | ||
| - | | ||
| - | |||
| - | (." | ||
| - | The run-time procedure, compiled by ." which transmits the | ||
| - | | ||
| - | | ||
| - | |||
| - | (; | ||
| - | The run-time procedure, compiled by ;CODE, that rewrites | ||
| - | the code field of the most recently defined word to point | ||
| - | to the following machine code sequence. | ||
| - | |||
| - | (+LOOP) | ||
| - | The run-time procedure compiled by +LOOP, which increments | ||
| - | the loop index by n and tests for loop completion. | ||
| - | | ||
| - | |||
| - | |||
| - | |||
| - | 12 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | (ABORT) | ||
| - | | ||
| - | | ||
| - | a user's alternative procedure. | ||
| - | |||
| - | (DO) C | ||
| - | The run-time procedure compiled by DO which moves the loop | ||
| - | | ||
| - | |||
| - | (FIND) | ||
| - | addr1 addr2 --- ff (bad) | ||
| - | | ||
| - | | ||
| - | field address, length byte of name field and boolean true | ||
| - | for a good match. | ||
| - | false is left. | ||
| - | |||
| - | (LINE) | ||
| - | | ||
| - | | ||
| - | | ||
| - | |||
| - | (LOOP) | ||
| - | The run-time procedure compiled by LOOP which increments | ||
| - | the loop index and tests for loop completion. | ||
| - | |||
| - | (NUMBER) | ||
| - | | ||
| - | | ||
| - | being left as d2. Addr2 is the address of the first | ||
| - | | ||
| - | |||
| - | * | ||
| - | Leave the signed product of two signed numbers. | ||
| - | |||
| - | */ n1 n2 n3 --- n4 L0 | ||
| - | Leave the ratio n4 = n1*n2/n3 where all are signed | ||
| - | | ||
| - | | ||
| - | | ||
| - | |||
| - | */MOD | ||
| - | Leave the quotient n5 and remainder n4 of the operation | ||
| - | | ||
| - | */. | ||
| - | |||
| - | + | ||
| - | Leave the sum of n1+n2. | ||
| - | |||
| - | +! n addr --- L0 | ||
| - | Add n to the value at the address. | ||
| - | | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | 13 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | +- n1 n2 --- n3 | ||
| - | Apply the sign of n2 to n1, which is left as n3. | ||
| - | |||
| - | +BUF addr1 --- addr2 f | ||
| - | | ||
| - | the next buffer addr2. | ||
| - | the buffer presently pointed to by variable PREV. | ||
| - | |||
| - | +LOOP | ||
| - | addr n2 --- | ||
| - | Used in a colon-definition in the form: | ||
| - | | ||
| - | At run-time, +LOOP selectively controls branching back to | ||
| - | the corresponding DO based on n1, the loop index and the | ||
| - | loop limit. | ||
| - | and the total compared to the limit. | ||
| - | DO occurs until the new index is equal to or greater than | ||
| - | the limit (n1>0), or until the new index is equal to or | ||
| - | less than the limit (n1< | ||
| - | | ||
| - | |||
| - | At compile time, +LOOP compiles the run-time word (+LOOP) | ||
| - | and the branch offset computed from HERE to the address | ||
| - | left on the stack by DO. n2 is used for compile-time | ||
| - | error checking. | ||
| - | |||
| - | +ORIGIN | ||
| - | Leave the memory address relative by n to the origin | ||
| - | | ||
| - | byte or word. This definition is used to access or modify | ||
| - | the boot-up parameters at the origin area. | ||
| - | |||
| - | , | ||
| - | Store n into the next available dictionary memory cell, | ||
| - | | ||
| - | |||
| - | - | ||
| - | Leave the difference of n1-n2. | ||
| - | |||
| - | --> | ||
| - | | ||
| - | | ||
| - | |||
| - | -DUP n1 --- n1 (if zero) | ||
| - | n1 --- n1 n1 | ||
| - | | ||
| - | to copy a value just before IF, to eliminate the need for | ||
| - | an ELSE part to drop it. | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | 14 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | -FIND | ||
| - | --- ff (not found) | ||
| - | | ||
| - | input stream to HERE, and searches the CONTEXT and then | ||
| - | | ||
| - | | ||
| - | byte, and a boolean true is left. Otherwise, only a | ||
| - | | ||
| - | |||
| - | -TRAILING | ||
| - | | ||
| - | | ||
| - | the characters at addr+n2 are blanks. | ||
| - | |||
| - | . | ||
| - | Print a number from a signed 16 bit two's complement | ||
| - | | ||
| - | | ||
| - | |||
| - | ." | ||
| - | Used in the form: | ||
| - | | ||
| - | | ||
| - | " | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | |||
| - | .LINE | ||
| - | Print on the terminal device, a line of text from the disc | ||
| - | by its line and screen number. | ||
| - | | ||
| - | |||
| - | .R n1 n2 --- | ||
| - | Print the number n1 right aligned in a field of whose | ||
| - | width is n2. No following blank is printed. | ||
| - | |||
| - | / | ||
| - | Leave the signed quotient of n1/n2. | ||
| - | |||
| - | /MOD n1 n2 --- rem quot L0 | ||
| - | Leave the remainder and signed quotient of n1/ | ||
| - | | ||
| - | |||
| - | 0 1 2 3 --- n | ||
| - | These small numbers are used so often that it is | ||
| - | | ||
| - | | ||
| - | |||
| - | 0< n --- f L0 | ||
| - | Leave a true flag if the number is less than zero | ||
| - | | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | 15 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | 0= n --- f L0 | ||
| - | Leave a true flag if the number is equal to zero, | ||
| - | | ||
| - | |||
| - | 0BRANCH | ||
| - | The run-time procedure to conditionally branch. | ||
| - | false (zero), the following in-line parameter is added to | ||
| - | the interpretive pointer to branch ahead or back. | ||
| - | | ||
| - | |||
| - | 1+ n1 --- n2 L1 | ||
| - | | ||
| - | |||
| - | 2+ n1 --- n2 | ||
| - | Leave n1 incremented by 2. | ||
| - | |||
| - | : | ||
| - | Used in the form called a colon-definition: | ||
| - | : cccc | ||
| - | | ||
| - | the following sequence of Forth word definitions ' | ||
| - | until the next ';' | ||
| - | done by the text interpreter as long as STATE is non-zero. | ||
| - | Other details are that the CONTEXT vocabulary is set to | ||
| - | the CURRENT vocabulary and that words with the precedence | ||
| - | bit set (P) are executed rather than being compiled. | ||
| - | |||
| - | ; | ||
| - | | ||
| - | | ||
| - | |||
| - | ;CODE | ||
| - | Used in the form: | ||
| - | : cccc ... ;CODE | ||
| - | assembly mnemonics | ||
| - | Stop compilation and terminate a new defining word cccc by | ||
| - | | ||
| - | | ||
| - | | ||
| - | |||
| - | When cccc later executes in the form: | ||
| - | | ||
| - | the word nnnn will be created with its execution procedure | ||
| - | given by the machine code following cccc. That is, when | ||
| - | nnnn is executed, it does so by jumping to the code after | ||
| - | | ||
| - | to ;CODE. | ||
| - | |||
| - | ;S P,L0 | ||
| - | Stop interpretation of a screen. | ||
| - | word compiled at the end of a colon-definition which | ||
| - | | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | 16 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | < | ||
| - | Leave a true flag if n1 is less than n2; otherwise leave a | ||
| - | false flag. | ||
| - | |||
| - | <# L0 | ||
| - | Setup for pictured numeric output formatting using the | ||
| - | | ||
| - | <# | ||
| - | The conversion is done on a double number producing text | ||
| - | at PAD. | ||
| - | |||
| - | < | ||
| - | Used within a colon-definition: | ||
| - | : cccc < | ||
| - | Each time cccc is executed, <BUILDS defines a new word | ||
| - | with a high-level execution procedure. | ||
| - | the form: | ||
| - | | ||
| - | uses <BUILDS to create a dictionary entry for nnnn with a | ||
| - | call to the DOES> part for nnnn. When nnnn is later | ||
| - | | ||
| - | stack and executes the words after DOES> in cccc. < | ||
| - | and DOES> allow run-time procedures to be written in high- | ||
| - | level rather than in assembler code (as required by | ||
| - | ;CODE ). | ||
| - | |||
| - | = | ||
| - | Leave a true flag if n1=n2; otherwise leave a false flag. | ||
| - | |||
| - | > | ||
| - | Leave a true flag if n1 is greater than n2; otherwise a | ||
| - | false flag. | ||
| - | |||
| - | >R n --- C,L0 | ||
| - | | ||
| - | the most accessable on the return stack. | ||
| - | | ||
| - | |||
| - | ? | ||
| - | Print the value contained at the address in free format | ||
| - | | ||
| - | |||
| - | ?COMP | ||
| - | Issue error message if not compiling. | ||
| - | |||
| - | ?CSP | ||
| - | Issue error message if stack position differs from value | ||
| - | saved in CSP. | ||
| - | |||
| - | ? | ||
| - | Issue an error message number n, if the boolean flag is | ||
| - | true. | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | 17 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | ?EXEC | ||
| - | Issue an error message if not executing. | ||
| - | |||
| - | ?LOADING | ||
| - | Issue an error message if not loading. | ||
| - | |||
| - | ? | ||
| - | Issue an error message if n1 does not equal n2. The | ||
| - | | ||
| - | |||
| - | ?STACK | ||
| - | Issue an error message if the stack is out of bounds. | ||
| - | This definition may be installation dependent. | ||
| - | |||
| - | ? | ||
| - | | ||
| - | the break key. A true flag indicates actuation. | ||
| - | | ||
| - | |||
| - | @ | ||
| - | Leave the 16 bit contents of address. | ||
| - | |||
| - | ABORT L0 | ||
| - | Clear the stacks and enter the execution state. | ||
| - | | ||
| - | | ||
| - | |||
| - | ABS | ||
| - | Leave the absolute value of n as u. | ||
| - | |||
| - | AGAIN | ||
| - | Used in a colon-definition in the form: | ||
| - | | ||
| - | At run-time, AGAIN forces execution to return to | ||
| - | | ||
| - | | ||
| - | | ||
| - | |||
| - | At compile time, AGAIN compiles BRANCH with an offset from | ||
| - | HERE to addr. n is used for compile-time error checking. | ||
| - | |||
| - | ALLOT | ||
| - | Add the signed number to the dictionary pointer DP. May | ||
| - | be used to reserve dictionary space or re-origin memory. | ||
| - | n is with regard to computer address type (byte or word). | ||
| - | |||
| - | AND | ||
| - | Leave the bitwise logical and of n1 and n2 as n3. | ||
| - | |||
| - | B/BUF | ||
| - | This constant leaves the number of bytes per disc buffer, | ||
| - | the byte count read from disc by BLOCK. | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | 18 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | B/SCR | ||
| - | This constant leaves the number of blocks per editing | ||
| - | | ||
| - | | ||
| - | |||
| - | BACK addr --- | ||
| - | | ||
| - | | ||
| - | |||
| - | BASE --- addr U,L0 | ||
| - | A user variable containing the current number base used | ||
| - | for input and output conversion. | ||
| - | |||
| - | BEGIN | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | At run-time, BEGIN marks the start of a sequence that may | ||
| - | be repetitively executed. | ||
| - | from the corresponding UNTIL, AGAIN or REPEAT. | ||
| - | | ||
| - | of the stack is false; for AGAIN and REPEAT a return to | ||
| - | BEGIN always occurs. | ||
| - | |||
| - | At compile time BEGIN leaves its return address and n for | ||
| - | | ||
| - | |||
| - | BL --- c | ||
| - | A constant that leaves the ascii value for " | ||
| - | |||
| - | BLANKS | ||
| - | Fill an area of memory begining at addr with blanks. | ||
| - | |||
| - | BLK | ||
| - | A user variable containing the block number being | ||
| - | | ||
| - | | ||
| - | |||
| - | BLOCK | ||
| - | Leave the memory address of the block buffer containing | ||
| - | block n. If the block is not already in memory, it is | ||
| - | | ||
| - | | ||
| - | been marked as being updated, it is re-written to disc | ||
| - | | ||
| - | | ||
| - | |||
| - | BLOCK-READ | ||
| - | BLOCK-WRITE | ||
| - | These are preferred names for the installation dependent | ||
| - | code to read and write one block to the disc. | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | 19 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | BRANCH | ||
| - | The run-time procedure to unconditionally branch. | ||
| - | line offset is added to the interpretive pointer IP to | ||
| - | | ||
| - | | ||
| - | |||
| - | BUFFER | ||
| - | | ||
| - | If the contents of the buffer is marked as updated, it is | ||
| - | | ||
| - | The address left is the first cell within the buffer for | ||
| - | data storage. | ||
| - | |||
| - | C! b addr --- | ||
| - | Store 8 bits at address. | ||
| - | | ||
| - | | ||
| - | |||
| - | C, b --- | ||
| - | Store 8 bits of b into the next available dictionary byte, | ||
| - | | ||
| - | on byte addressing computers, and should be used with | ||
| - | | ||
| - | |||
| - | C@ addr --- b | ||
| - | Leave the 8 bit contents of memory address. | ||
| - | | ||
| - | | ||
| - | |||
| - | CFA | ||
| - | | ||
| - | code field address. | ||
| - | |||
| - | CMOVE | ||
| - | Move the specified quantity of bytes beginning at address | ||
| - | from to address to. The contents of address from is moved | ||
| - | first proceeding toward high memory. | ||
| - | | ||
| - | |||
| - | COLD | ||
| - | The cold start procedure to adjust the dictionary pointer | ||
| - | to the minimum standard and restart via ABORT. | ||
| - | | ||
| - | and restart. | ||
| - | |||
| - | COMPILE | ||
| - | When the word containing COMPILE executes, the execution | ||
| - | | ||
| - | into the dictionary. | ||
| - | | ||
| - | an execution address (which the interpreter already does). | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | 20 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | CONSTANT | ||
| - | A defining word used in the form: | ||
| - | | ||
| - | to create word cccc, with its parameter field containing | ||
| - | | ||
| - | n to the stack. | ||
| - | |||
| - | CONTEXT | ||
| - | A user variable containing a pointer to the vocabulary | ||
| - | | ||
| - | |||
| - | COUNT | ||
| - | Leave the byte address addr2 and byte count n of a message | ||
| - | text beginning at addr1. | ||
| - | byte at addr1 contains the text byte count and the actual | ||
| - | text starts with the second byte. Typically COUNT is | ||
| - | | ||
| - | |||
| - | CR L0 | ||
| - | | ||
| - | | ||
| - | |||
| - | CREATE | ||
| - | A defining word used in the form: | ||
| - | | ||
| - | by such words as CODE and CONSTANT to create a dictionary | ||
| - | | ||
| - | the address of the word's parameter field. | ||
| - | is created in the CURRENT vocabulary. | ||
| - | |||
| - | CSP | ||
| - | A user variable temporarily storing the stack pointer | ||
| - | | ||
| - | |||
| - | D+ d1 d2 --- dsum | ||
| - | Leave the double number sum of two double numbers. | ||
| - | |||
| - | D+- | ||
| - | Apply the sign of n to the double number d1, leaving it as | ||
| - | d2. | ||
| - | |||
| - | D. d --- L1 | ||
| - | Print a signed double number from a 32 bit two' | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | |||
| - | D.R | ||
| - | Print a signed double number d right aligned in a field n | ||
| - | | ||
| - | |||
| - | DABS d --- ud | ||
| - | Leave the absolute value ud of a double number. | ||
| - | |||
| - | |||
| - | |||
| - | 21 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | DECIMAL | ||
| - | Set the numeric conversion BASE for decimal input-output. | ||
| - | |||
| - | DEFINITIONS | ||
| - | Used in the form: | ||
| - | | ||
| - | Set the CURRENT vocabulary to the CONTEXT vocabulary. | ||
| - | the example, executing vocabulary name cccc made it the | ||
| - | | ||
| - | | ||
| - | |||
| - | DIGIT | ||
| - | c n1 --- ff (bad) | ||
| - | | ||
| - | | ||
| - | | ||
| - | |||
| - | DLIST | ||
| - | List the names of the dictionary entries in the CONTEXT | ||
| - | | ||
| - | |||
| - | DLITERAL | ||
| - | d --- (compiling) | ||
| - | If compiling, compile a stack double number into a | ||
| - | | ||
| - | the literal will push it to the stack. | ||
| - | | ||
| - | |||
| - | DMINUS | ||
| - | | ||
| - | |||
| - | DO | ||
| - | addr n --- (compile) | ||
| - | | ||
| - | | ||
| - | | ||
| - | At run-time, DO begins a sequence with repetitive | ||
| - | | ||
| - | | ||
| - | | ||
| - | new index equals or exceeds the limit, execution loops | ||
| - | back to just after DO; otherwise the loop parameters are | ||
| - | | ||
| - | are determined at run-time and may be the result of other | ||
| - | | ||
| - | of the index to the stack. | ||
| - | |||
| - | When compiling within the colon-definition, | ||
| - | (DO), leaves the following address addr and n for later | ||
| - | error checking. | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | 22 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | DOES> | ||
| - | A word which defines the run-time action within a high- | ||
| - | level defining word. DOES> alters the code field and | ||
| - | first parameter of the new word to execute the sequence of | ||
| - | | ||
| - | | ||
| - | | ||
| - | word on the stack. | ||
| - | area or its contents. | ||
| - | | ||
| - | | ||
| - | |||
| - | DP --- addr U,L | ||
| - | A user variable, the dictionary pointer, which contains | ||
| - | the address of the next free memory above the dictionary. | ||
| - | The value may be read by HERE and altered by ALLOT. | ||
| - | |||
| - | DPL | ||
| - | A user variable containing the number of digits to the | ||
| - | right of the decimal on double integer input. | ||
| - | be used to hold output column location of a decimal point, | ||
| - | in user generated formatting. | ||
| - | | ||
| - | |||
| - | DR0 Installation dependent commands to select disc drives, by | ||
| - | DR1 presetting OFFSET. | ||
| - | block number in BLOCK to allow for this selection. | ||
| - | is suppressed for error text so that it may always | ||
| - | | ||
| - | |||
| - | DROP n --- L0 | ||
| - | Drop the number from the stack. | ||
| - | |||
| - | DUMP addr n --- L0 | ||
| - | Print the contents of n memory locations beginning at | ||
| - | | ||
| - | | ||
| - | |||
| - | DUP | ||
| - | | ||
| - | |||
| - | ELSE addr1 n1 --- addr2 n2 (compiling) | ||
| - | | ||
| - | | ||
| - | At run-time, ELSE executes after the true part following | ||
| - | | ||
| - | false part and resumes execution after the ENDIF. | ||
| - | no stack effect. | ||
| - | |||
| - | At compile-time ELSE emplaces BRANCH reserving a branch | ||
| - | | ||
| - | ELSE also resolves the pending forward branch from IF by | ||
| - | | ||
| - | | ||
| - | |||
| - | |||
| - | |||
| - | 23 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | EMIT c --- L0 | ||
| - | | ||
| - | OUT is incremented for each character output. | ||
| - | |||
| - | EMPTY-BUFFERS | ||
| - | Mark all block-buffers as empty, not necessarily affecting | ||
| - | the contents. | ||
| - | This is also an initialisation procedure before first use | ||
| - | of the disc. | ||
| - | |||
| - | ENCLOSE | ||
| - | The text scanning primitive used by WORD. From the text | ||
| - | | ||
| - | | ||
| - | | ||
| - | text n2, and the offset to the first character not | ||
| - | | ||
| - | ' | ||
| - | |||
| - | END | ||
| - | This is an ' | ||
| - | |||
| - | ENDIF | ||
| - | | ||
| - | | ||
| - | | ||
| - | At run-time, ENDIF serves only as the destination of a | ||
| - | | ||
| - | of the conditional structure. | ||
| - | | ||
| - | IF and ELSE. | ||
| - | |||
| - | At compile-time, | ||
| - | from addr to HERE and stores it at addr. n is used for | ||
| - | error tests. | ||
| - | |||
| - | ERASE | ||
| - | Clear a region of memory to zero from addr over n | ||
| - | | ||
| - | |||
| - | ERROR | ||
| - | | ||
| - | is first examined. | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | is executed, which executes the system ABORT. | ||
| - | may cautiously modify this execution by altering (ABORT). | ||
| - | | ||
| - | | ||
| - | | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | 24 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | EXECUTE | ||
| - | | ||
| - | | ||
| - | | ||
| - | |||
| - | EXPECT | ||
| - | | ||
| - | " | ||
| - | One or more nulls are added at the end of the text. | ||
| - | |||
| - | FENCE | ||
| - | A user variable containing an address below which | ||
| - | | ||
| - | user must alter the contents of FENCE. | ||
| - | |||
| - | FILL addr quan b --- | ||
| - | Fill memory at the address with the specified quantity of | ||
| - | bytes b. | ||
| - | |||
| - | FIRST | ||
| - | A constant that leaves the address of the first (lowest) | ||
| - | block buffer. | ||
| - | |||
| - | FLD | ||
| - | A user variable for control of number output field width. | ||
| - | | ||
| - | |||
| - | FORGET | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | are not currently the same. | ||
| - | |||
| - | FORTH P,L1 | ||
| - | The name of the primary vocabulary. | ||
| - | the CONTEXT vocabulary. | ||
| - | | ||
| - | part of FORTH. | ||
| - | | ||
| - | | ||
| - | |||
| - | HERE --- addr L0 | ||
| - | Leave the address of the next available dictionary | ||
| - | | ||
| - | |||
| - | HEX L0 | ||
| - | Set the numeric conversion base to sixteen (hexadecimal). | ||
| - | |||
| - | HLD | ||
| - | A user variable that holds the address of the latest | ||
| - | | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | 25 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | HOLD c --- L0 | ||
| - | Used between <# and #> to insert an ascii character into a | ||
| - | | ||
| - | | ||
| - | |||
| - | I | ||
| - | Used within a DO-LOOP to copy the loop index to the stack. | ||
| - | Other use is implementation dependent. | ||
| - | |||
| - | ID. addr --- | ||
| - | Print a definition' | ||
| - | |||
| - | IF f --- (run-time) | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | At run-time, IF selects execution based on a boolean flag. | ||
| - | If f is true (non-zero), execution continues ahead thru | ||
| - | the true part. If f is false (zero), execution skips till | ||
| - | just after ELSE to execute the false part. After either | ||
| - | part, execution resumes after ENDIF. | ||
| - | part are optional; if missing, false execution skips to | ||
| - | just after ENDIF. | ||
| - | |||
| - | At compile-time IF compiles 0BRANCH and reserves space for | ||
| - | an offset at addr. addr and n are used later for | ||
| - | | ||
| - | |||
| - | IMMEDIATE | ||
| - | Mark the most recently made definition so that when | ||
| - | | ||
| - | than being compiled. i.e. the precedence bit in its header | ||
| - | is set. This method allows definitions to handle unusual | ||
| - | | ||
| - | | ||
| - | an immediate definition by preceding it with [COMPILE]. | ||
| - | |||
| - | IN --- addr L0 | ||
| - | A user variable containing the byte offset within the | ||
| - | | ||
| - | the next text will be accepted. | ||
| - | value of IN. | ||
| - | |||
| - | INDEX | ||
| - | Print the first line of each screen over the range from, | ||
| - | | ||
| - | text on disc screens. | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | 26 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | INTERPRET | ||
| - | The outer text interpreter which sequentially executes or | ||
| - | | ||
| - | | ||
| - | after a search of CONTEXT and then CURRENT it is converted | ||
| - | to a number according to the current base. That also | ||
| - | | ||
| - | will be given. | ||
| - | |||
| - | Text input will be taken according to the convention for | ||
| - | | ||
| - | | ||
| - | no other purpose than to force this action. | ||
| - | |||
| - | KEY | ||
| - | Leave the ascii value of the next terminal key struck. | ||
| - | |||
| - | LATEST | ||
| - | Leave the name field address of the topmost word in the | ||
| - | | ||
| - | |||
| - | LEAVE C,L0 | ||
| - | Force termination of a DO-LOOP at the next opportunity by | ||
| - | | ||
| - | The index itself remains unchanged, and execution proceeds | ||
| - | | ||
| - | |||
| - | LFA | ||
| - | | ||
| - | | ||
| - | |||
| - | LIMIT | ||
| - | A constant leaving the address just above the highest | ||
| - | | ||
| - | | ||
| - | |||
| - | LIST n --- L0 | ||
| - | | ||
| - | | ||
| - | this process. | ||
| - | |||
| - | LIT | ||
| - | | ||
| - | | ||
| - | | ||
| - | next dictionary address to be pushed to the stack. | ||
| - | |||
| - | LITERAL | ||
| - | If compiling, then compile the stack value n as a 16 bit | ||
| - | | ||
| - | | ||
| - | : xxx [ calculate ] LITERAL | ||
| - | | ||
| - | of a value. | ||
| - | this value. | ||
| - | |||
| - | |||
| - | 27 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | LOAD n --- L0 | ||
| - | Begin interpretation of screen n. Loading will terminate | ||
| - | at the end of the screen or at ;S. See ;S and -->. | ||
| - | |||
| - | LOOP addr n --- (compiling) | ||
| - | | ||
| - | | ||
| - | At run-time, LOOP selectively controls branching back to | ||
| - | the corresponding DO based on the loop index and limit. | ||
| - | | ||
| - | | ||
| - | | ||
| - | are discarded and execution continues ahead. | ||
| - | |||
| - | At compile-time, | ||
| - | | ||
| - | |||
| - | M* n1 n2 --- d | ||
| - | A mixed magnitude math operation which leaves the double | ||
| - | | ||
| - | |||
| - | M/ d n1 --- n2 n3 | ||
| - | A mixed magnitude math operator which leaves the signed | ||
| - | | ||
| - | | ||
| - | from the dividend. | ||
| - | |||
| - | M/MOD | ||
| - | An unsigned mixed magnitude math operation which leaves a | ||
| - | | ||
| - | | ||
| - | |||
| - | MAX | ||
| - | Leave the greater of two numbers. | ||
| - | |||
| - | MESSAGE | ||
| - | Print on the selected output device the text of line n | ||
| - | | ||
| - | | ||
| - | such as report headers. | ||
| - | will simply be printed as a number (disc-unavailable). | ||
| - | |||
| - | MIN | ||
| - | Leave the smaller of two numbers. | ||
| - | |||
| - | MINUS | ||
| - | Leave the two's complement of a number. | ||
| - | |||
| - | MOD | ||
| - | Leave the remainder of n1/n2, with the same sign as n1. | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | 28 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | MON | ||
| - | Exit to the system monitor, leaving a re-entry to Forth, | ||
| - | if possible. | ||
| - | |||
| - | MOVE addr1 addr2 n --- | ||
| - | Move the contents of n memory cells (16 bit contents) | ||
| - | | ||
| - | | ||
| - | | ||
| - | |||
| - | NEXT | ||
| - | This is the inner interpreter that uses the interpretive | ||
| - | | ||
| - | not directly executed but is the return point for all code | ||
| - | | ||
| - | IP, storing this value in register W. It then jumps to | ||
| - | the address pointed to by W. W points to the code field | ||
| - | of a definition which contains the address of the code | ||
| - | which executes for that definition. | ||
| - | | ||
| - | | ||
| - | of IP and W are computer specific. | ||
| - | |||
| - | NFA | ||
| - | | ||
| - | name field. | ||
| - | |||
| - | NUMBER | ||
| - | | ||
| - | | ||
| - | If a decimal point is encountered in the text, its | ||
| - | | ||
| - | If numeric conversion is not possible, an error message | ||
| - | will be given. | ||
| - | |||
| - | OFFSET | ||
| - | A user variable which may contain a block offset to disc | ||
| - | | ||
| - | | ||
| - | | ||
| - | |||
| - | OR n1 n2 --- or L0 | ||
| - | Leave the bit-wise logical or of two 16 bit values. | ||
| - | |||
| - | OUT | ||
| - | A user variable that contains a value incremented by EMIT. | ||
| - | The user may alter and examine OUT to control display | ||
| - | | ||
| - | |||
| - | OVER n1 n2 --- n1 n2 n1 L0 | ||
| - | Copy the second stack value, placing it as the new top. | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | 29 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | PAD | ||
| - | Leave the address of the text output buffer, which is a | ||
| - | fixed offset above HERE. | ||
| - | |||
| - | PFA | ||
| - | | ||
| - | its parameter field address. | ||
| - | |||
| - | POP | ||
| - | The code sequence to remove a stack value and return to | ||
| - | | ||
| - | entry point after machine code. | ||
| - | |||
| - | PREV --- addr | ||
| - | A variable containing the address of the disc buffer most | ||
| - | | ||
| - | to be later written to disc. | ||
| - | |||
| - | PUSH | ||
| - | This code sequence pushes machine registers to the | ||
| - | | ||
| - | | ||
| - | code. | ||
| - | |||
| - | PUT | ||
| - | This code sequence stores machine register contents over | ||
| - | the topmost computation stack value and returns to NEXT. | ||
| - | It is not directly executable, but is a Forth re-entry | ||
| - | point after machine code. | ||
| - | |||
| - | QUERY | ||
| - | Input 80 characters of text (or until a " | ||
| - | | ||
| - | | ||
| - | |||
| - | QUIT L1 | ||
| - | Clear the return stack, stop compilation, | ||
| - | | ||
| - | |||
| - | R | ||
| - | Copy the top of the return stack to the computation stack. | ||
| - | |||
| - | R# --- addr U | ||
| - | A user variable which may contain the location of an | ||
| - | | ||
| - | |||
| - | R/W | ||
| - | The fig-FORTH standard disc read-write linkage. | ||
| - | | ||
| - | the sequential number of the referenced block; and f is a | ||
| - | flag for f=0 write and f=1 for read. R/W determines the | ||
| - | | ||
| - | | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | 30 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | R> --- n L0 | ||
| - | | ||
| - | the computation stack. | ||
| - | |||
| - | R0 --- addr U | ||
| - | A user variable containing the initial location of the | ||
| - | | ||
| - | |||
| - | REPEAT | ||
| - | Used within a colon-definition in the form: | ||
| - | | ||
| - | At run-time, REPEAT forces an unconditional branch back to | ||
| - | just after the corresponding BEGIN. | ||
| - | |||
| - | At compile-time, | ||
| - | from HERE to addr. n is used for error testing. | ||
| - | |||
| - | ROT | ||
| - | | ||
| - | third to the top. | ||
| - | |||
| - | RP! | ||
| - | A computer dependent procedure to initialise the return | ||
| - | stack pointer from user variable R0. | ||
| - | |||
| - | S-> | ||
| - | Sign extend a single number to form a double number. | ||
| - | |||
| - | S0 --- addr U | ||
| - | A user variable that contains the initial value for the | ||
| - | stack pointer. | ||
| - | |||
| - | SCR | ||
| - | A user variable containing the screen number most recently | ||
| - | | ||
| - | |||
| - | SIGN n d --- d L0 | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | |||
| - | SMUDGE | ||
| - | Used during word definition to toggle the " | ||
| - | a definition' | ||
| - | | ||
| - | until compiling is completed without error. | ||
| - | |||
| - | SP! | ||
| - | A computer dependent procedure to initialise the stack | ||
| - | | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | 31 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | SP@ | ||
| - | A computer dependent procedure to return the address of | ||
| - | the stack position to the top of the stack, as it was | ||
| - | | ||
| - | 2 2 1 ) | ||
| - | |||
| - | SPACE L0 | ||
| - | | ||
| - | |||
| - | SPACES | ||
| - | | ||
| - | |||
| - | STATE | ||
| - | A user variable containing the compilation state. | ||
| - | zero value indicates compilation. | ||
| - | | ||
| - | |||
| - | SWAP n1 n2 --- n2 n1 L0 | ||
| - | | ||
| - | |||
| - | TASK | ||
| - | A no-operation word which can mark the boundary between | ||
| - | | ||
| - | | ||
| - | |||
| - | THEN P,C0,L0 | ||
| - | An alias for ENDIF. | ||
| - | |||
| - | TIB | ||
| - | A user variable containing the address of the terminal | ||
| - | input buffer. | ||
| - | |||
| - | TOGGLE | ||
| - | | ||
| - | |||
| - | TRAVERSE | ||
| - | Move across the name field of a fig-FORTH variable length | ||
| - | name field. | ||
| - | byte or the last letter. | ||
| - | high memory; if n= -1, the motion is toward low memory. | ||
| - | The addr2 resulting is address of the other end of the | ||
| - | name. | ||
| - | |||
| - | TRIAD | ||
| - | | ||
| - | which include that numbered scr, beginning with a screen | ||
| - | | ||
| - | text records, and includes a reference line at the bottom | ||
| - | taken from line 15 of screen 4. | ||
| - | |||
| - | TYPE addr count --- L0 | ||
| - | | ||
| - | | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | 32 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | U* u1 u2 --- ud | ||
| - | Leave the unsigned double number product of two unsigned | ||
| - | | ||
| - | |||
| - | U/ ud u1 --- u2 u3 | ||
| - | Leave the unsigned remainder u2 and unsigned quotient u3 | ||
| - | from the unsigned double dividend ud and unsigned divisor | ||
| - | u1. | ||
| - | |||
| - | UNTIL | ||
| - | addr n --- (compile) | ||
| - | | ||
| - | | ||
| - | At run-time, UNTIL controls the conditional branch back to | ||
| - | the corresponding BEGIN. | ||
| - | to just after begin; if true, execution continues ahead. | ||
| - | |||
| - | At compile-time, | ||
| - | from HERE to addr. n is used for error tests. | ||
| - | |||
| - | UPDATE | ||
| - | Marks the most recently referenced block (pointed to by | ||
| - | PREV) as altered. | ||
| - | | ||
| - | | ||
| - | |||
| - | USE | ||
| - | A variable containing the address of the block buffer to | ||
| - | use next, as the least recently written. | ||
| - | |||
| - | USER n --- L0 | ||
| - | A defining word used in the form: | ||
| - | | ||
| - | which creates a user variable cccc. The parameter field | ||
| - | of cccc contains n as a fixed offset relative to the user | ||
| - | | ||
| - | later executed, it places the sum of its offset and the | ||
| - | user area base address on the stack as the storage address | ||
| - | of that particular variable. | ||
| - | |||
| - | VARIABLE | ||
| - | A defining word used in the form: | ||
| - | | ||
| - | When VARIABLE is executed, it creates the definition cccc | ||
| - | with its parameter field initialised to n. When cccc is | ||
| - | later executed, the address of its parameter field | ||
| - | | ||
| - | store may access this location. | ||
| - | |||
| - | VOC-LINK | ||
| - | A user variable containing the address of a field in the | ||
| - | | ||
| - | | ||
| - | | ||
| - | |||
| - | |||
| - | |||
| - | 33 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | VOCABULARY | ||
| - | A defining word used in the form: | ||
| - | | ||
| - | to create a vocabulary definition cccc. Subsequent use of | ||
| - | cccc will make it the CONTEXT vocabulary which is searched | ||
| - | first by INTERPRET. | ||
| - | also make cccc the CURRENT vocabulary into which new | ||
| - | | ||
| - | |||
| - | In fig-FORTH, cccc will be so chained as to include all | ||
| - | | ||
| - | | ||
| - | | ||
| - | See VOC-LINK. | ||
| - | |||
| - | VLIST | ||
| - | List the names of the definitions in the context | ||
| - | | ||
| - | |||
| - | WARNING | ||
| - | A user variable containing a value controlling messages. | ||
| - | If = 1, disc is present and screen 4 of drive 0 is the | ||
| - | base location for messages. | ||
| - | and messages will be presented by number. | ||
| - | | ||
| - | | ||
| - | |||
| - | WHILE | ||
| - | ad1 n1 --- ad1 n1 ad2 n2 P,C2 | ||
| - | | ||
| - | | ||
| - | At run-time, WHILE selects conditional execution based on | ||
| - | | ||
| - | | ||
| - | | ||
| - | skips to just after REPEAT, exiting the structure. | ||
| - | |||
| - | At compile time, WHILE emplaces (0BRANCH) and leaves ad2 | ||
| - | of the reserved offset. | ||
| - | by REPEAT. | ||
| - | |||
| - | WIDTH | ||
| - | In fig-FORTH, a user variable containing the maximum | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | The value may be changed at any time within the above | ||
| - | | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | 34 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | WORD c --- L0 | ||
| - | Read the next text characters from the input stream being | ||
| - | | ||
| - | | ||
| - | | ||
| - | the characters, and ends with two or more blanks. | ||
| - | | ||
| - | taken from the terminal input buffer, otherwise from the | ||
| - | disc block stored in BLK. See BLK, IN. | ||
| - | |||
| - | X | ||
| - | This is a psuedonym for the " | ||
| - | a name of one character of ascii null. It is the | ||
| - | | ||
| - | of text from the terminal or within a disc buffer, as both | ||
| - | | ||
| - | |||
| - | XOR | ||
| - | Leave the bitwise logical exclusive-or of two values. | ||
| - | |||
| - | [ P,L1 | ||
| - | Used in a colon-definition in the form: | ||
| - | : xxx | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | |||
| - | [COMPILE] | ||
| - | Used in a colon-definition in the form: | ||
| - | : xxx | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | |||
| - | ] L1 | ||
| - | | ||
| - | | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | 35 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | 36 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | SCR # 3 | ||
| - | 0 ********************** | ||
| - | 1 | ||
| - | | ||
| - | 3 | ||
| - | | ||
| - | | ||
| - | | ||
| - | 7 | ||
| - | 8 | ||
| - | | ||
| - | 10 WITH COMPILER SECURITY | ||
| - | 11 AND | ||
| - | 12 VARIABLE LENGTH NAMES | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 Further distribution must include the above notice. | ||
| - | |||
| - | SCR # 4 | ||
| - | 0 ( ERROR MESSAGES | ||
| - | 1 EMPTY STACK | ||
| - | 2 DICTIONARY FULL | ||
| - | 3 HAS INCORRECT ADDRESS MODE | ||
| - | 4 ISN'T UNIQUE | ||
| - | 5 | ||
| - | 6 DISC RANGE ? | ||
| - | 7 FULL STACK | ||
| - | 8 DISC ERROR ! | ||
| - | 9 | ||
| - | 10 | ||
| - | 11 | ||
| - | 12 | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 FORTH INTEREST GROUP MAY 1, 1979 | ||
| - | |||
| - | SCR # 5 | ||
| - | 0 ( ERROR MESSAGES | ||
| - | 1 COMPILATION ONLY, USE IN DEFINITION | ||
| - | 2 EXECUTION ONLY | ||
| - | 3 CONDITIONALS NOT PAIRED | ||
| - | 4 DEFINITION NOT FINISHED | ||
| - | 5 IN PROTECTED DICTIONARY | ||
| - | 6 USE ONLY WHEN LOADING | ||
| - | 7 OFF CURRENT EDITING SCREEN | ||
| - | 8 DECLARE VOCABULARY | ||
| - | 9 | ||
| - | 10 | ||
| - | 11 | ||
| - | 12 | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | FORTH INTEREST GROUP MAY 1, 1979 | ||
| - | |||
| - | |||
| - | 37 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | | ||
| - | |||
| - | CODE LIT ( PUSH FOLLOWING LITERAL TO STACK *) 1 13 | ||
| - | LABEL PUSH ( PUSH ACCUM AS HI-BYTE, ML STACK AS LO-BYTE *) 4 13 | ||
| - | LABEL PUT ( REPLACE BOTTOM WITH ACCUM. AND ML STACK *) 6 13 | ||
| - | LABEL NEXT ( EXECUTE NEXT FORTH ADDRESS, MOVING IP *) 8 13 | ||
| - | | ||
| - | LABEL SETUP ( MOVE # ITEMS FROM STACK TO ' | ||
| - | CODE EXECUTE | ||
| - | ( ADDRESS ON THE STACK *) 10 14 | ||
| - | CODE BRANCH | ||
| - | CODE 0BRANCH | ||
| - | CODE (LOOP) | ||
| - | CODE (+LOOP) | ||
| - | CODE (DO) ( MOVE TWO STACK ITEMS TO RETURN STACK *) 2 17 | ||
| - | CODE I ( COPY CURRENT LOOP INDEX TO STACK *) 9 17 | ||
| - | CODE DIGIT ( CONVERT ASCII CHAR-SECOND, | ||
| - | ( IF OK RETURN DIGIT-SECOND, | ||
| - | ( OTHERWISE FALSE-BOTTOM. *) 3 18 | ||
| - | CODE (FIND) | ||
| - | CODE ENCLOSE | ||
| - | ( ADDR-4, AND OFFSET TO FIRST CH-3, END WORD-2, NEXT CH-1 *) 2 20 | ||
| - | CODE EMIT ( PRINT ASCII VALUE ON BOTTOM OF STACK *) 5 21 | ||
| - | CODE KEY ( ACCEPT ONE TERMINAL CHARACTER TO THE STACK *) 7 21 | ||
| - | CODE ? | ||
| - | CODE CR ( EXECUTE CAR. RETURN, LINE FEED ON TERMINAL *) 11 21 | ||
| - | CODE CMOVE ( WITHIN MEMORY; ENTER W/ FROM-3, TO-2, QUAN-1 *) 1 22 | ||
| - | CODE U* ( 16 BIT MULTIPLICAND-2, | ||
| - | ( 32 BIT UNSIGNED PRODUCT: LO WORD-2, HI WORD-1 *) 2 23 | ||
| - | CODE U/ ( 31 BIT DIVIDEND-2, -3, 16 BIT DIVISOR-1 | ||
| - | ( 16 BIT REMAINDER-2, | ||
| - | CODE AND ( LOGICAL BITWISE AND OF BOTTOM TWO ITEMS *) 2 25 | ||
| - | CODE OR ( LOGICAL BITWISE ' | ||
| - | CODE XOR ( LOGICAL ' | ||
| - | CODE SP@ ( FETCH STACK POINTER TO STACK *) 1 26 | ||
| - | CODE SP! ( LOAD SP FROM ' | ||
| - | CODE RP! ( LOAD RP FROM R0 *) 8 26 | ||
| - | CODE ;S ( RESTORE IP REGISTER FROM RETURN STACK *) 12 26 | ||
| - | CODE LEAVE ( FORCE EXIT OF DO-LOOP BY SETTING LIMIT *) 1 27 | ||
| - | XSAVE STX, TSX, R LDA, R 2+ STA, ( TO INDEX *) 2 27 | ||
| - | CODE >R ( MOVE FROM COMP. STACK TO RETURN STACK *) 5 27 | ||
| - | CODE R> ( MOVE FROM RETURN STACK TO COMP. STACK *) 8 27 | ||
| - | CODE R ( COPY THE BOTTOM OF RETURN STACK TO COMP. STACK *) 11 27 | ||
| - | CODE 0= ( REVERSE LOGICAL STATE OF BOTTOM OF STACK *) 2 28 | ||
| - | CODE 0< ( LEAVE TRUE IF NEGATIVE; OTHERWISE FALSE *) 6 28 | ||
| - | CODE + ( LEAVE THE SUM OF THE BOTTOM TWO STACK ITEMS *) 1 29 | ||
| - | CODE D+ ( ADD TWO DOUBLE INTEGERS, LEAVING DOUBLE *) 4 29 | ||
| - | CODE MINUS ( TWOS COMPLEMENT OF BOTTOM SINGLE NUMBER *) 9 29 | ||
| - | CODE DMINUS | ||
| - | CODE OVER ( DUPLICATE SECOND ITEM AS NEW BOTTOM *) 1 30 | ||
| - | CODE DROP ( DROP BOTTOM STACK ITEM *) 4 30 | ||
| - | CODE SWAP ( EXCHANGE BOTTOM AND SECOND ITEMS ON STACK *) 7 30 | ||
| - | CODE DUP ( DUPLICATE BOTTOM ITEM ON STACK *) 11 30 | ||
| - | CODE +! ( ADD SECOND TO MEMORY 16 BITS ADDRESSED BY BOTTOM *) 2 31 | ||
| - | |||
| - | |||
| - | |||
| - | 38 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | CODE TOGGLE | ||
| - | CODE @ ( REPLACE STACK ADDRESS WITH 16 BIT *) 1 32 | ||
| - | BOT X) LDA, PHA, ( CONTENTS OF THAT ADDRESS *) 2 32 | ||
| - | CODE C@ ( REPLACE STACK ADDRESS WITH POINTED 8 BIT BYTE *) 5 32 | ||
| - | CODE ! ( STORE SECOND AT 16 BITS ADDRESSED BY BOTTOM *) 8 32 | ||
| - | CODE C! ( STORE SECOND AT BYTE ADDRESSED BY BOTTOM *) 12 32 | ||
| - | : : ( CREATE NEW COLON-DEFINITION UNTIL ';' | ||
| - | : ; ( TERMINATE COLON-DEFINITION *) 9 33 | ||
| - | : CONSTANT | ||
| - | : VARIABLE | ||
| - | : USER ( CREATE USER VARIABLE *) 10 34 | ||
| - | 20 CONSTANT BL | ||
| - | 40 CONSTANT C/L ( TEXT CHARACTERS PER LINE *) 5 35 | ||
| - | | ||
| - | | ||
| - | | ||
| - | 8 | ||
| - | : +ORIGIN | ||
| - | | ||
| - | ( 06 USER S0 ) ( TOP OF EMPTY COMPUTATION STACK *) 2 36 | ||
| - | ( 08 USER R0 ) ( TOP OF EMPTY RETURN STACK *) 3 36 | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | : 1+ 1 | ||
| - | : 2+ 2 | ||
| - | : HERE DP @ ; ( FETCH NEXT FREE ADDRESS IN DICT. *) 3 38 | ||
| - | : ALLOT DP +! ; ( MOVE DICT. POINTER AHEAD *) 4 38 | ||
| - | : , | ||
| - | : C, | ||
| - | : - | ||
| - | : = | ||
| - | : < | ||
| - | : > | ||
| - | : ROT > | ||
| - | : SPACE | ||
| - | : -DUP | ||
| - | |||
| - | |||
| - | |||
| - | 39 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | : TRAVERSE | ||
| - | ( ADDRESS-2, DIRECTION-1, | ||
| - | : LATEST | ||
| - | : LFA 4 - ; ( CONVERT A WORDS PFA TO LFA *) 11 39 | ||
| - | : CFA 2 - ; | ||
| - | : NFA 5 - -1 TRAVERSE | ||
| - | : PFA | ||
| - | : !CSP | ||
| - | : ? | ||
| - | : ?COMP STATE @ 0= 11 ?ERROR ; ( ERROR IF NOT COMPILING *) 6 40 | ||
| - | : ?EXEC | ||
| - | : ? | ||
| - | : ?CSP | ||
| - | : ? | ||
| - | : COMPILE | ||
| - | : [ 0 STATE ! ; IMMEDIATE | ||
| - | : ] C0 STATE ! ; ( ENTER COMPILATION STATE *) 7 41 | ||
| - | : SMUDGE | ||
| - | : HEX 10 BASE ! ; ( MAKE HEX THE IN-OUT BASE *) 11 41 | ||
| - | : DECIMAL | ||
| - | : (; | ||
| - | : ;CODE ( TERMINATE A NEW DEFINING WORD *) 6 42 | ||
| - | : < | ||
| - | : DOES> | ||
| - | ( REWRITE CFA WITH ' | ||
| - | : COUNT DUP 1+ SWAP C@ ; ( LEAVE TEXT ADDR. CHAR. COUNT *) 1 44 | ||
| - | : TYPE ( TYPE STRING FROM ADDRESS-2, CHAR.COUNT-1 *) 2 44 | ||
| - | : -TRAILING | ||
| - | : (." | ||
| - | : ." | ||
| - | : EXPECT | ||
| - | : X BLK @ ( END-OF-TEXT IS NULL *) 11 45 | ||
| - | : FILL ( FILL MEMORY BEGIN-3, QUAN-2, BYTE-1 *) 1 46 | ||
| - | : ERASE ( FILL MEMORY WITH ZEROS BEGIN-2, QUAN-1 *) 4 46 | ||
| - | : BLANKS | ||
| - | : HOLD ( HOLD CHARACTER IN PAD *) 10 46 | ||
| - | : PAD HERE 44 + ; ( PAD IS 68 BYTES ABOVE HERE *) 13 46 | ||
| - | ( DOWNWARD HAS NUMERIC OUTPUTS; UPWARD MAY HOLD TEXT *) 14 46 | ||
| - | : WORD ( ENTER WITH DELIMITER, MOVE STRING TO ' | ||
| - | : (NUMBER) | ||
| - | : NUMBER | ||
| - | : -FIND ( RETURN PFA-3, LEN BYTE-2, TRUE-1; ELSE FALSE *) 12 48 | ||
| - | : (ABORT) | ||
| - | : ERROR ( WARNING: -1=ABORT, 0=NO DISC, 1=DISC *) 4 49 | ||
| - | | ||
| - | : ID. ( PRINT NAME FIELD FROM ITS HEADER ADDRESS *) 9 49 | ||
| - | : CREATE | ||
| - | ( WARNING IF DUPLICATING A CURRENT NAME *) 3 50 | ||
| - | : [COMPILE] | ||
| - | : LITERAL | ||
| - | : DLITERAL | ||
| - | : ? | ||
| - | : INTERPRET | ||
| - | : IMMEDIATE | ||
| - | |||
| - | |||
| - | |||
| - | 40 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | : VOCABULARY | ||
| - | | ||
| - | : DEFINITIONS | ||
| - | : ( ( SKIP INPUT TEXT UNTIL RIGHT PARENTHESIS *) 14 53 | ||
| - | : QUIT ( RESTART, INTERPRET FROM TERMINAL *) 2 54 | ||
| - | : ABORT ( WARM RESTART, INCLUDING REGISTERS *) 7 54 | ||
| - | CODE COLD ( COLD START, INITIALIZING USER AREA *) 1 55 | ||
| - | CODE S-> | ||
| - | : +- 0< IF MINUS ENDIF ; ( APPLY SIGN TO NUMBER BENEATH *) 4 56 | ||
| - | : D+- ( APPLY SIGN TO DOUBLE NUMBER BENEATH *) 6 56 | ||
| - | : ABS | ||
| - | : DABS DUP D+- ; ( DOUBLE INTEGER ABSOLUTE VALUE *) 10 56 | ||
| - | : MIN ( LEAVE SMALLER OF TWO NUMBERS *) 12 56 | ||
| - | : MAX ( LEAVE LARGER OF TWO NUMBERS *) 14 56 | ||
| - | : M* ( LEAVE SIGNED DOUBLE PRODUCT OF TWO SINGLE NUMBERS *) 1 57 | ||
| - | : M/ ( FROM SIGNED DOUBLE-3-2, SIGNED DIVISOR-1 *) 3 57 | ||
| - | ( LEAVE SIGNED REMAINDER-2, | ||
| - | : * U* DROP ; ( SIGNED PRODUCT *) 7 57 | ||
| - | : /MOD > | ||
| - | : / /MOD SWAP DROP ; ( LEAVE QUOTIENT *) 9 57 | ||
| - | : MOD /MOD DROP ; | ||
| - | : */MOD ( TAKE RATION OF THREE NUMBERS, LEAVING *) 11 57 | ||
| - | >R M* R> M/ ; ( REM-2, QUOTIENT-1 *) 12 57 | ||
| - | : */ | ||
| - | : M/MOD ( DOUBLE, SINGLE DIVISOR ... REMAINDER, DOUBLE *) 14 57 | ||
| - | | ||
| - | | ||
| - | : +BUF ( ADVANCE ADDRESS-1 TO NEXT BUFFER. RETURNS FALSE *) 4 58 | ||
| - | 84 ( I.E. B/BUF+4 ) + DUP LIMIT = ( IF AT PREV *) 5 58 | ||
| - | : UPDATE | ||
| - | : EMPTY-BUFFERS | ||
| - | : DR0 0 OFFSET | ||
| - | : DR1 | ||
| - | : BUFFER | ||
| - | : BLOCK ( CONVERT BLOCK NUMBER TO ITS BUFFER ADDRESS *) 1 60 | ||
| - | : (LINE) | ||
| - | : .LINE ( LINE#, | ||
| - | : MESSAGE | ||
| - | : LOAD ( INTERPRET SCREENS FROM DISC *) 2 62 | ||
| - | : --> | ||
| - | | ||
| - | | ||
| - | : #HL ( CONVERT DECIMAL DIGIT FOR DISC CONTROLLER *) 5 65 | ||
| - | CODE D/ | ||
| - | : ?DISC ( UPON NAK SHOW ERR MSG, QUIT. ABSORBS TILL *) 7 66 | ||
| - | | ||
| - | CODE BLOCK-WRITE | ||
| - | 2 # LDA, SETUP JSR, ( WITH EOT AT END *) 2 67 | ||
| - | CODE BLOCK-READ | ||
| - | ( C = 1 TO READ, 0 TO WRITE *) 3 69 | ||
| - | : R/W ( READ/WRITE DISC BLOCK *) 4 69 | ||
| - | ( BUFFER ADDRESS-3, BLOCK #-2, 1-READ 0-WRITE *) 5 69 | ||
| - | : ' | ||
| - | : FORGET | ||
| - | |||
| - | |||
| - | |||
| - | 41 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | : \ ( SKIP INTERPRETATION OF THE REMAINDER OF LINE *) 11 72 | ||
| - | : BACK | ||
| - | : D.R ( DOUBLE INTEGER OUTPUT, RIGHT ALIGNED IN FIELD *) 1 76 | ||
| - | : D. | ||
| - | : .R > | ||
| - | : . S-> | ||
| - | : ? @ . ; ( PRINT CONTENTS OF MEMORY *) 11 76 | ||
| - | : LIST ( LIST SCREEN BY NUMBER ON STACK *) 2 77 | ||
| - | : INDEX ( PRINT FIRST LINE OF EACH SCREEN FROM-2, TO-1 *) 7 77 | ||
| - | : TRIAD ( PRINT 3 SCREENS ON PAGE, CONTAINING # ON STACK *) 12 77 | ||
| - | : VLIST ( LIST CONTEXT VOCABULARY *) 2 78 | ||
| - | | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | 42 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | FORTH MODEL IMPLEMENTATION | ||
| - | |||
| - | |||
| - | This model is presented for the serious student as both an example | ||
| - | of a large FORTH program and as a complete nucleus of FORTH. | ||
| - | is, it is sufficient to run and to continue to compile itself. | ||
| - | |||
| - | When compiled, the model requires about 2800 bytes of memory. | ||
| - | | ||
| - | | ||
| - | 6000 to 7000 bytes (including editor, assembler, and disk | ||
| - | | ||
| - | |||
| - | The following information consists of word definitions you will find | ||
| - | in the CODE definitions. | ||
| - | used, these being for the MOS Technology 6502. | ||
| - | |||
| - | Note that the notation in the CODE definitions is ' | ||
| - | as is all of FORTH. | ||
| - | | ||
| - | | ||
| - | | ||
| - | code end in a ',' | ||
| - | |||
| - | BOT 1+ LDA, in FORTH would be: | ||
| - | |||
| - | LDA 1,X in usual assembler. | ||
| - | |||
| - | And also: | ||
| - | |||
| - | | ||
| - | |||
| - | | ||
| - | |||
| - | It takes a bit of getting used to, but reverse Polish assembler | ||
| - | | ||
| - | | ||
| - | |||
| - | |||
| - | | ||
| - | |||
| - | |||
| - | IP | ||
| - | |||
| - | W address of the code field pointer in zero-page. | ||
| - | |||
| - | N address of an 8 byte scratch area in zero-page. | ||
| - | |||
| - | XSAVE address of a temporary register for X in zero-page. | ||
| - | |||
| - | UP | ||
| - | |||
| - | .A | ||
| - | |||
| - | |||
| - | |||
| - | 43 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | # specify immediate mode for machine byte literals. | ||
| - | |||
| - | ,X ,Y | ||
| - | |||
| - | X) )Y | ||
| - | |||
| - | BOT address of low byte of a 16-bit stack item with | ||
| - | ,X address mode. X register locates computation | ||
| - | stack in zero-page, relative to address $0000. | ||
| - | |||
| - | BOT 1+ | ||
| - | with ,X mode preset. | ||
| - | |||
| - | SEC and SEC 1+ | ||
| - | |||
| - | TSX, move the return stack pointer (which is located in | ||
| - | the CPU machine stack in page-one) to X register. | ||
| - | |||
| - | R address of low byte of return stack with ,X mode preset. | ||
| - | |||
| - | R n + address of the n-th byte of the return stack with ,X | ||
| - | mode preset. | ||
| - | | ||
| - | the high byte of the second item of return stack. | ||
| - | |||
| - | PUT address of routine to replace the present computation | ||
| - | stack high byte from accumulator, | ||
| - | the machine stack one byte which replaces the | ||
| - | | ||
| - | |||
| - | PUSH | ||
| - | | ||
| - | |||
| - | PUSH0A | ||
| - | at the low stack byte, with the high byte zero. | ||
| - | PUT0A over-writes, | ||
| - | |||
| - | POP POPTWO | ||
| - | items from computation stack. | ||
| - | |||
| - | BINARY | ||
| - | | ||
| - | |||
| - | SETUP address of a routine to move 16-bit items to zero-page. | ||
| - | Item quantity is in accumulator. | ||
| - | |||
| - | NEXT | ||
| - | code routines must return. | ||
| - | | ||
| - | FORTH word address. | ||
| - | to pointed machine code. | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | 44 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | SCR # 6 | ||
| - | 0 ( INPUT-OUTPUT, | ||
| - | 1 CODE EMIT XSAVE STX, BOT 1+ LDA, 7F # AND, | ||
| - | | ||
| - | 3 CODE KEY XSAVE STX, BEGIN, | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 CODE CR XSAVE STX, 728A JSR, XSAVE LDX, NEXT JMP, | ||
| - | 11 | ||
| - | 12 CODE ? | ||
| - | 13 BEGIN, | ||
| - | 14 TYA, PUSH0A | ||
| - | 15 DECIMAL | ||
| - | |||
| - | SCR # 7 | ||
| - | 0 ( INPUT-OUTPUT, | ||
| - | 1 CODE HOME FC58 JSR, NEXT JMP, | ||
| - | 2 CODE SCROLL | ||
| - | 3 | ||
| - | 4 HERE ' | ||
| - | | ||
| - | 6 HERE ' EMIT 2 - ! | ||
| - | | ||
| - | 8 HERE ' | ||
| - | | ||
| - | 10 HERE ' | ||
| - | 11 C000 BIT, 0< | ||
| - | 12 | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 DECIMAL | ||
| - | |||
| - | SCR # 8 | ||
| - | 0 ( INPUT-OUTPUT, | ||
| - | 1 HEX | ||
| - | 2 CODE KEY 8A58 JSR, 7F # AND, PUSH0A JMP, | ||
| - | 3 | ||
| - | 4 CODE EMIT BOT 1+ LDA, 8A47 JSR, POP JMP, | ||
| - | 5 | ||
| - | 6 CODE CR 834D JSR, NEXT JMP, | ||
| - | 7 | ||
| - | 8 CODE ? | ||
| - | | ||
| - | 10 | ||
| - | 11 TYA, PUSH0A | ||
| - | 12 | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 DECIMAL | ||
| - | |||
| - | FORTH INTEREST GROUP MAY 1, 1979 | ||
| - | |||
| - | |||
| - | 45 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | SCR # 12 | ||
| - | 0 ( COLD AND WARM ENTRY, | ||
| - | 1 ASSEMBLER | ||
| - | 2 NOP, HERE JMP, ( WORD ALIGNED VECTOR TO COLD ) | ||
| - | 3 NOP, HERE JMP, ( WORD ALIGNED VECTOR TO WARM ) | ||
| - | 4 0000 , 0001 , ( CPU, AND REVISION PARAMETERS ) | ||
| - | 5 0000 , ( TOPMOST WORD IN FORTH VOCABULARY ) | ||
| - | | ||
| - | 7 3BA0 , ( INITIAL USER AREA ) | ||
| - | 8 009E , ( INITIAL TOP OF STACK ) | ||
| - | 9 01FF , ( INITIAL TOP OF RETURN STACK ) | ||
| - | 10 0100 , ( TERMINAL INPUT BUFFER ) | ||
| - | 11 001F , ( INITIAL NAME FIELD WIDTH ) | ||
| - | 12 0001 , ( INITIAL WARNING = 1 ) | ||
| - | 13 0200 , ( INITIAL FENCE ) | ||
| - | 14 0000 , ( COLD START VALUE FOR DP ) | ||
| - | 15 0000 , ( COLD START VALUE FOR VOC-LINK ) --> | ||
| - | |||
| - | SCR # 13 | ||
| - | 0 ( START OF NUCLEUS, | ||
| - | 1 CODE LIT ( PUSH FOLLOWING LITERAL TO STACK *) | ||
| - | | ||
| - | | ||
| - | 4 LABEL PUSH ( PUSH ACCUM AS HI-BYTE, ML STACK AS LO-BYTE *) | ||
| - | | ||
| - | 6 LABEL PUT ( REPLACE BOTTOM WITH ACCUM. AND ML STACK *) | ||
| - | | ||
| - | 8 LABEL NEXT ( EXECUTE NEXT FORTH ADDRESS, MOVING IP *) | ||
| - | | ||
| - | 10 DEY, IP )Y LDA, W STA, | ||
| - | 11 CLC, IP LDA, 2 # ADC, IP STA, ( MOVE IP AHEAD ) | ||
| - | 12 CS IF, IP 1+ INC, THEN, | ||
| - | 13 W 1 - JMP, ( JUMP INDIR. VIA W THRU CODE FIELD TO CODE ) | ||
| - | 14 | ||
| - | 15 --> | ||
| - | |||
| - | SCR # 14 | ||
| - | 0 ( SETUP | ||
| - | | ||
| - | | ||
| - | 3 | ||
| - | 4 LABEL SETUP ( MOVE # ITEMS FROM STACK TO ' | ||
| - | | ||
| - | | ||
| - | | ||
| - | 8 | ||
| - | 9 CODE EXECUTE | ||
| - | 10 ( ADDRESS ON THE STACK *) | ||
| - | 11 BOT LDA, W STA, BOT 1+ LDA, W 1+ STA, | ||
| - | 12 INX, INX, W 1 - JMP, | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 --> | ||
| - | |||
| - | FORTH INTEREST GROUP MAY 1, 1979 | ||
| - | |||
| - | |||
| - | 46 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | SCR # 15 | ||
| - | 0 ( BRANCH, 0BRANCH | ||
| - | 1 CODE BRANCH | ||
| - | | ||
| - | | ||
| - | | ||
| - | 5 | ||
| - | 6 CODE 0BRANCH | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 CLC, IP LDA, 2 # ADC, IP STA, | ||
| - | 11 CS IF, IP 1+ INC, THEN, NEXT JMP, | ||
| - | 12 | ||
| - | 13 --> | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | SCR # 16 | ||
| - | 0 ( LOOP CONTROL | ||
| - | 1 CODE (LOOP) | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 7 | ||
| - | 8 CODE (+LOOP) | ||
| - | | ||
| - | 10 FF ,X LDA, PHA, PHA, FE ,X LDA, TSX, INX, INX, | ||
| - | 11 | ||
| - | 12 | ||
| - | 13 | ||
| - | 14 R 1+ LDA, R 3 + SBC, L2: JMP, | ||
| - | 15 --> | ||
| - | |||
| - | SCR # 17 | ||
| - | 0 ( (DO- | ||
| - | 1 | ||
| - | 2 CODE (DO) ( MOVE TWO STACK ITEMS TO RETURN STACK *) | ||
| - | | ||
| - | | ||
| - | 5 | ||
| - | 6 LABEL POPTWO | ||
| - | 7 LABEL POP | ||
| - | 8 | ||
| - | 9 CODE I ( COPY CURRENT LOOP INDEX TO STACK *) | ||
| - | 10 ( THIS WILL LATER BE POINTED TO ' | ||
| - | 11 | ||
| - | 12 --> | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | FORTH INTEREST GROUP MAY 1, 1979 | ||
| - | |||
| - | |||
| - | 47 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | SCR # 18 | ||
| - | 0 ( DIGIT | ||
| - | 1 CODE DIGIT ( CONVERT ASCII CHAR-SECOND, | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 | ||
| - | 11 ( STORE RESULT SECOND AND RETURN TRUE ) | ||
| - | 12 THEN, THEN, THEN, ( CONVERSION FAILED ) | ||
| - | 13 TYA, PHA, INX, INX, PUT JMP, ( LEAVE BOOLEAN FALSE ) | ||
| - | 14 | ||
| - | 15 --> | ||
| - | |||
| - | SCR # 19 | ||
| - | 0 ( FIND FOR VARIABLE LENGTH NAMES WFR-790225 ) | ||
| - | 1 CODE (FIND) | ||
| - | | ||
| - | 3 BEGIN, | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 THEN, CS NOT ( AT LAST CHAR? ) IF, SWAP THEN, | ||
| - | 11 | ||
| - | 12 | ||
| - | 13 N )Y LDA, N 1+ STA, N STX, N ORA, ( 0 LINK ? ) | ||
| - | 14 0= END, ( LOOP FOR ANOTHER NAME ) | ||
| - | 15 XSAVE LDX, 0 # LDA, PHA, PUSH JMP, ( FALSE ) | ||
| - | |||
| - | SCR # 20 | ||
| - | 0 ( ENCLOSE | ||
| - | 1 CODE ENCLOSE | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 | ||
| - | 11 IF, ( Y=FC ) SEC INC, ( BUMP EW ) THEN, NEXT JMP, | ||
| - | 12 THEN, SEC STY, ( IN EW ) INY, N CMP, ( DELIM ? ) | ||
| - | 13 0= END, ( IS DELIM ) BOT STY, ( IN NC ) NEXT JMP, | ||
| - | 14 | ||
| - | 15 --> | ||
| - | |||
| - | FORTH INTEREST GROUP MAY 1, 1979 | ||
| - | |||
| - | |||
| - | 48 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | SCR # 21 | ||
| - | 0 ( TERMINAL VECTORS | ||
| - | 1 ( THESE WORDS ARE CREATED WITH NO EXECUTION CODE, YET. | ||
| - | 2 ( THEIR CODE FIELDS WILL BE FILLED WITH THE ADDRESS OF THEIR ) | ||
| - | 3 ( INSTALLATION SPECIFIC CODE. | ||
| - | 4 | ||
| - | 5 CODE EMIT ( PRINT ASCII VALUE ON BOTTOM OF STACK *) | ||
| - | 6 | ||
| - | 7 CODE KEY ( ACCEPT ONE TERMINAL CHARACTER TO THE STACK *) | ||
| - | 8 | ||
| - | 9 CODE ? | ||
| - | 10 | ||
| - | 11 CODE CR ( EXECUTE CAR. RETURN, LINE FEED ON TERMINAL *) | ||
| - | 12 | ||
| - | 13 --> | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | SCR # 22 | ||
| - | 0 ( CMOVE, | ||
| - | 1 CODE CMOVE ( WITHIN MEMORY; ENTER W/ FROM-3, TO-2, QUAN-1 *) | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 | ||
| - | 11 --> | ||
| - | 12 | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | SCR # 23 | ||
| - | 0 ( U*, UNSIGNED MULTIPLY FOR 16 BITS RS-WFR-80AUG16 ) | ||
| - | 1 CODE U* ( 16 BIT MULTIPLICAND-2, | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 N LDA, BOT 2 + ADC, BOT 2 + STA, | ||
| - | 11 N 1+ LDA, BOT 3 + ADC, BOT 3 + STA, | ||
| - | 12 CS IF, BOT INC, 0= IF, BOT 1+ INC, ENDIF, ENDIF, | ||
| - | 13 ENDIF, | ||
| - | 14 | ||
| - | 15 --> | ||
| - | |||
| - | FORTH INTEREST GROUP Aug 23, 1980 | ||
| - | |||
| - | |||
| - | 49 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | SCR # 24 | ||
| - | 0 ( U/, UNSIGNED DIVIDE FOR 31 BITS | ||
| - | 1 CODE U/ ( 31 BIT DIVIDEND-2, -3, 16 BIT DIVISOR-1 | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 SEC ROL, SEC 1+ ROL, | ||
| - | 11 N DEC, 0= | ||
| - | 12 | ||
| - | 13 --> | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | SCR # 25 | ||
| - | 0 ( LOGICALS | ||
| - | 1 | ||
| - | 2 CODE AND ( LOGICAL BITWISE AND OF BOTTOM TWO ITEMS *) | ||
| - | | ||
| - | | ||
| - | 5 | ||
| - | 6 CODE OR ( LOGICAL BITWISE ' | ||
| - | | ||
| - | | ||
| - | 9 | ||
| - | 10 CODE XOR ( LOGICAL ' | ||
| - | | ||
| - | | ||
| - | 13 | ||
| - | 14 --> | ||
| - | 15 | ||
| - | |||
| - | SCR # 26 | ||
| - | 0 ( STACK INITIALIZATION | ||
| - | 1 CODE SP@ ( FETCH STACK POINTER TO STACK *) | ||
| - | | ||
| - | 3 LABEL PUSH0A | ||
| - | 4 | ||
| - | 5 CODE SP! ( LOAD SP FROM ' | ||
| - | | ||
| - | 7 | ||
| - | 8 CODE RP! ( LOAD RP FROM R0 *) | ||
| - | | ||
| - | 10 XSAVE LDX, NEXT JMP, | ||
| - | 11 | ||
| - | 12 CODE ;S ( RESTORE IP REGISTER FROM RETURN STACK *) | ||
| - | 13 PLA, IP STA, PLA, IP 1+ STA, NEXT JMP, | ||
| - | 14 | ||
| - | 15 --> | ||
| - | |||
| - | FORTH INTEREST GROUP MAY 1, 1979 | ||
| - | |||
| - | |||
| - | 50 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | SCR # 27 | ||
| - | 0 ( RETURN STACK WORDS | ||
| - | 1 CODE LEAVE ( FORCE EXIT OF DO-LOOP BY SETTING LIMIT *) | ||
| - | | ||
| - | | ||
| - | 4 | ||
| - | 5 CODE >R ( MOVE FROM COMP. STACK TO RETURN STACK *) | ||
| - | | ||
| - | 7 | ||
| - | 8 CODE R> ( MOVE FROM RETURN STACK TO COMP. STACK *) | ||
| - | | ||
| - | 10 | ||
| - | 11 CODE R ( COPY THE BOTTOM OF RETURN STACK TO COMP. STACK *) | ||
| - | 12 XSAVE STX, TSX, R LDA, PHA, R 1+ LDA, | ||
| - | 13 XSAVE LDX, PUSH JMP, | ||
| - | 14 ' | ||
| - | 15 --> | ||
| - | |||
| - | SCR # 28 | ||
| - | 0 ( TESTS AND LOGICALS | ||
| - | 1 | ||
| - | 2 CODE 0= ( REVERSE LOGICAL STATE OF BOTTOM OF STACK *) | ||
| - | | ||
| - | | ||
| - | 5 | ||
| - | 6 CODE 0< ( LEAVE TRUE IF NEGATIVE; OTHERWISE FALSE *) | ||
| - | | ||
| - | 8 | ||
| - | 9 | ||
| - | 10 --> | ||
| - | 11 | ||
| - | 12 | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | SCR # 29 | ||
| - | 0 ( MATH | ||
| - | 1 CODE + ( LEAVE THE SUM OF THE BOTTOM TWO STACK ITEMS *) | ||
| - | | ||
| - | | ||
| - | 4 CODE D+ ( ADD TWO DOUBLE INTEGERS, LEAVING DOUBLE *) | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 9 CODE MINUS ( TWOS COMPLEMENT OF BOTTOM SINGLE NUMBER *) | ||
| - | 10 SEC, TYA, BOT SBC, BOT STA, | ||
| - | 11 TYA, BOT 1+ SBC, BOT 1+ STA, NEXT JMP, | ||
| - | 12 CODE DMINUS | ||
| - | 13 SEC, TYA, BOT 2 + SBC, BOT 2 + STA, | ||
| - | 14 TYA, BOT 3 + SBC, BOT 3 + STA, | ||
| - | 15 1 BYTE.IN | ||
| - | |||
| - | FORTH INTEREST GROUP MAY 1, 1979 | ||
| - | |||
| - | |||
| - | 51 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | SCR # 30 | ||
| - | 0 ( STACK MANIPULATION | ||
| - | 1 CODE OVER ( DUPLICATE SECOND ITEM AS NEW BOTTOM *) | ||
| - | | ||
| - | 3 | ||
| - | 4 CODE DROP ( DROP BOTTOM STACK ITEM *) | ||
| - | | ||
| - | 6 | ||
| - | 7 CODE SWAP ( EXCHANGE BOTTOM AND SECOND ITEMS ON STACK *) | ||
| - | | ||
| - | | ||
| - | 10 | ||
| - | 11 CODE DUP ( DUPLICATE BOTTOM ITEM ON STACK *) | ||
| - | 12 BOT LDA, PHA, BOT 1+ LDA, PUSH JMP, | ||
| - | 13 | ||
| - | 14 --> | ||
| - | 15 | ||
| - | |||
| - | SCR # 31 | ||
| - | 0 ( MEMORY INCREMENT, | ||
| - | 1 | ||
| - | 2 CODE +! ( ADD SECOND TO MEMORY 16 BITS ADDRESSED BY BOTTOM *) | ||
| - | | ||
| - | | ||
| - | | ||
| - | 6 | ||
| - | 7 CODE TOGGLE | ||
| - | | ||
| - | 9 | ||
| - | 10 --> | ||
| - | 11 | ||
| - | 12 | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | SCR # 32 | ||
| - | 0 ( MEMORY FETCH AND STORE WFR-781202 ) | ||
| - | 1 CODE @ ( REPLACE STACK ADDRESS WITH 16 BIT *) | ||
| - | | ||
| - | | ||
| - | 4 | ||
| - | 5 CODE C@ ( REPLACE STACK ADDRESS WITH POINTED 8 BIT BYTE *) | ||
| - | | ||
| - | 7 | ||
| - | 8 CODE ! ( STORE SECOND AT 16 BITS ADDRESSED BY BOTTOM *) | ||
| - | | ||
| - | 10 SEC 1+ LDA, BOT X) STA, POPTWO JMP, | ||
| - | 11 | ||
| - | 12 CODE C! ( STORE SECOND AT BYTE ADDRESSED BY BOTTOM *) | ||
| - | 13 SEC LDA, BOT X) STA, POPTWO JMP, | ||
| - | 14 | ||
| - | 15 DECIMAL | ||
| - | |||
| - | FORTH INTEREST GROUP MAY 1, 1979 | ||
| - | |||
| - | |||
| - | 52 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | SCR # 33 | ||
| - | 0 ( :, ;, | ||
| - | 1 | ||
| - | 2 : : ( CREATE NEW COLON-DEFINITION UNTIL ';' | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 7 | ||
| - | 8 | ||
| - | 9 : ; ( TERMINATE COLON-DEFINITION *) | ||
| - | 10 ? | ||
| - | 11 | ||
| - | 12 | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 --> | ||
| - | |||
| - | SCR # 34 | ||
| - | 0 ( CONSTANT, VARIABLE, USER | ||
| - | 1 : CONSTANT | ||
| - | | ||
| - | | ||
| - | 4 | ||
| - | 5 : VARIABLE | ||
| - | | ||
| - | | ||
| - | 8 | ||
| - | 9 | ||
| - | 10 : USER ( CREATE USER VARIABLE *) | ||
| - | 11 CONSTANT | ||
| - | 12 2 # LDY, CLC, W )Y LDA, UP ADC, PHA, | ||
| - | 13 0 # LDA, UP 1+ ADC, PUSH JMP, | ||
| - | 14 | ||
| - | 15 --> | ||
| - | |||
| - | SCR # 35 | ||
| - | 0 ( DEFINED CONSTANTS | ||
| - | 1 HEX | ||
| - | 2 00 CONSTANT | ||
| - | 3 02 CONSTANT | ||
| - | 4 20 CONSTANT | ||
| - | 5 40 CONSTANT | ||
| - | 6 | ||
| - | 7 3BE0 CONSTANT | ||
| - | 8 4000 CONSTANT | ||
| - | | ||
| - | 10 8 | ||
| - | 11 | ||
| - | 12 00 +ORIGIN | ||
| - | 13 : +ORIGIN | ||
| - | 14 --> | ||
| - | 15 | ||
| - | |||
| - | FORTH INTEREST GROUP MAY 1, 1979 | ||
| - | |||
| - | |||
| - | 53 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | SCR # 36 | ||
| - | 0 ( USER VARIABLES | ||
| - | 1 HEX ( 0 THRU 5 RESERVED, | ||
| - | 2 ( 06 USER S0 ) ( TOP OF EMPTY COMPUTATION STACK *) | ||
| - | 3 ( 08 USER R0 ) ( TOP OF EMPTY RETURN STACK *) | ||
| - | 4 0A USER TIB ( TERMINAL INPUT BUFFER *) | ||
| - | 5 0C USER WIDTH ( MAXIMUM NAME FIELD WIDTH *) | ||
| - | 6 0E USER WARNING | ||
| - | 7 10 USER FENCE ( BARRIER FOR FORGETTING *) | ||
| - | 8 12 USER DP ( DICTIONARY POINTER *) | ||
| - | 9 14 USER VOC-LINK | ||
| - | 10 16 USER BLK ( INTERPRETATION BLOCK *) | ||
| - | 11 18 USER IN ( OFFSET INTO SOURCE TEXT *) | ||
| - | 12 1A USER OUT ( DISPLAY CURSOR POSITION *) | ||
| - | 13 1C USER SCR ( EDITING SCREEN *) | ||
| - | 14 --> | ||
| - | 15 | ||
| - | |||
| - | SCR # 37 | ||
| - | 0 ( USER VARIABLES, CONT. WFR-79APR29 ) | ||
| - | 1 1E USER OFFSET | ||
| - | 2 20 USER CONTEXT | ||
| - | 3 22 USER CURRENT | ||
| - | 4 24 USER STATE ( COMPILATION STATE *) | ||
| - | 5 26 USER BASE ( FOR NUMERIC INPUT-OUTPUT *) | ||
| - | 6 28 USER DPL ( DECIMAL POINT LOCATION *) | ||
| - | 7 2A USER FLD ( OUTPUT FIELD WIDTH *) | ||
| - | 8 2C USER CSP ( CHECK STACK POSITION *) | ||
| - | 9 2E USER R# ( EDITING CURSOR POSITION *) | ||
| - | 10 30 USER HLD ( POINTS TO LAST CHARACTER HELD IN PAD *) | ||
| - | 11 --> | ||
| - | 12 | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | SCR # 38 | ||
| - | 0 ( HI-LEVEL MISC. | ||
| - | 1 : 1+ 1 | ||
| - | 2 : 2+ 2 | ||
| - | 3 : HERE DP @ ; ( FETCH NEXT FREE ADDRESS IN DICT. *) | ||
| - | 4 : ALLOT | ||
| - | 5 : , | ||
| - | 6 : C, | ||
| - | 7 : - | ||
| - | 8 : = | ||
| - | 9 : < | ||
| - | 10 : > | ||
| - | 11 : ROT > | ||
| - | 12 : SPACE | ||
| - | 13 : -DUP | ||
| - | 14 --> | ||
| - | 15 | ||
| - | |||
| - | FORTH INTEREST GROUP MAY 1, 1979 | ||
| - | |||
| - | |||
| - | 54 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | SCR # 39 | ||
| - | 0 ( VARIABLE LENGTH NAME SUPPORT | ||
| - | 1 : TRAVERSE | ||
| - | | ||
| - | | ||
| - | | ||
| - | 5 | ||
| - | 6 : LATEST | ||
| - | 7 | ||
| - | 8 | ||
| - | 9 ( FOLLOWING HAVE LITERALS DEPENDENT ON COMPUTER WORD SIZE ) | ||
| - | 10 | ||
| - | 11 : LFA 4 - ; ( CONVERT A WORDS PFA TO LFA *) | ||
| - | 12 : CFA 2 - ; ( CONVERT A WORDS PFA TO CFA *) | ||
| - | 13 : NFA 5 - -1 TRAVERSE | ||
| - | 14 : PFA | ||
| - | 15 | ||
| - | |||
| - | SCR # 40 | ||
| - | 0 ( ERROR PROCEDURES, PER SHIRA WFR-79MAR23 ) | ||
| - | 1 : !CSP | ||
| - | 2 | ||
| - | 3 : ? | ||
| - | | ||
| - | 5 | ||
| - | 6 : ?COMP STATE @ 0= 11 ?ERROR ; ( ERROR IF NOT COMPILING *) | ||
| - | 7 | ||
| - | 8 : ?EXEC | ||
| - | 9 | ||
| - | 10 : ? | ||
| - | 11 | ||
| - | 12 : ?CSP | ||
| - | 13 | ||
| - | 14 : ? | ||
| - | 15 BLK @ 0= 16 ? | ||
| - | |||
| - | SCR # 41 | ||
| - | 0 ( COMPILE, | ||
| - | 1 | ||
| - | 2 : COMPILE | ||
| - | | ||
| - | 4 | ||
| - | 5 : [ 0 STATE ! ; IMMEDIATE | ||
| - | 6 | ||
| - | 7 : ] C0 STATE ! ; ( ENTER COMPILATION STATE *) | ||
| - | 8 | ||
| - | 9 : SMUDGE | ||
| - | 10 | ||
| - | 11 : HEX 10 BASE ! ; ( MAKE HEX THE IN-OUT BASE *) | ||
| - | 12 | ||
| - | 13 : DECIMAL | ||
| - | 14 --> | ||
| - | 15 | ||
| - | |||
| - | FORTH INTEREST GROUP MAY 1, 1979 | ||
| - | |||
| - | |||
| - | 55 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | SCR # 42 | ||
| - | 0 ( ;CODE WFR-79APR20 ) | ||
| - | 1 | ||
| - | 2 : (; | ||
| - | | ||
| - | 4 | ||
| - | 5 | ||
| - | 6 : ;CODE ( TERMINATE A NEW DEFINING WORD *) | ||
| - | | ||
| - | | ||
| - | 9 --> | ||
| - | 10 | ||
| - | 11 | ||
| - | 12 | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | SCR # 43 | ||
| - | 0 ( < | ||
| - | 1 | ||
| - | 2 : < | ||
| - | 3 | ||
| - | 4 : DOES> | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 | ||
| - | 11 W 1+ LDA, 00 # ADC, PUSH JMP, | ||
| - | 12 | ||
| - | 13 --> | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | SCR # 44 | ||
| - | 0 ( TEXT OUTPUTS | ||
| - | 1 : COUNT DUP 1+ SWAP C@ ; ( LEAVE TEXT ADDR. CHAR. COUNT *) | ||
| - | 2 : TYPE ( TYPE STRING FROM ADDRESS-2, CHAR.COUNT-1 *) | ||
| - | | ||
| - | | ||
| - | 5 : -TRAILING | ||
| - | | ||
| - | | ||
| - | 8 : (." | ||
| - | | ||
| - | 10 | ||
| - | 11 | ||
| - | 12 : ." | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 IMMEDIATE | ||
| - | |||
| - | FORTH INTEREST GROUP MAY 1, 1979 | ||
| - | |||
| - | |||
| - | 56 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | SCR # 45 | ||
| - | 0 ( TERMINAL INPUT | ||
| - | 1 | ||
| - | 2 : EXPECT | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 9 : QUERY | ||
| - | 10 8081 HERE | ||
| - | 11 : X BLK @ ( END-OF-TEXT IS NULL *) | ||
| - | 12 IF ( DISC ) 1 BLK +! 0 IN ! BLK @ 7 AND 0= | ||
| - | 13 IF ( SCR END ) ?EXEC R> DROP ENDIF ( disc dependent ) | ||
| - | 14 ELSE ( TERMINAL ) R> DROP | ||
| - | 15 ENDIF ; | ||
| - | |||
| - | SCR # 46 | ||
| - | 0 ( FILL, ERASE, BLANKS, HOLD, PAD | ||
| - | 1 : FILL ( FILL MEMORY BEGIN-3, | ||
| - | | ||
| - | 3 | ||
| - | 4 : ERASE ( FILL MEMORY WITH ZEROS BEGIN-2, QUAN-1 *) | ||
| - | | ||
| - | 6 | ||
| - | 7 : BLANKS | ||
| - | | ||
| - | 9 | ||
| - | 10 : HOLD ( HOLD CHARACTER IN PAD *) | ||
| - | 11 | ||
| - | 12 | ||
| - | 13 : PAD HERE 44 + ; ( PAD IS 68 BYTES ABOVE HERE *) | ||
| - | 14 ( DOWNWARD HAS NUMERIC OUTPUTS; UPWARD MAY HOLD TEXT *) | ||
| - | 15 --> | ||
| - | |||
| - | SCR # 47 | ||
| - | 0 ( WORD, WFR-79APR02 ) | ||
| - | 1 : WORD ( ENTER WITH DELIMITER, MOVE STRING TO ' | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 R> CMOVE ; ( MOVE STRING FROM BUFFER TO HERE+1 ) | ||
| - | 11 | ||
| - | 12 | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 --> | ||
| - | |||
| - | FORTH INTEREST GROUP MAY 1, 1979 | ||
| - | |||
| - | |||
| - | 57 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | SCR # 48 | ||
| - | 0 ( (NUMBER-, | ||
| - | 1 : (NUMBER) | ||
| - | | ||
| - | | ||
| - | | ||
| - | 5 | ||
| - | 6 : NUMBER | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 | ||
| - | 11 | ||
| - | 12 : -FIND ( RETURN PFA-3, LEN BYTE-2, TRUE-1; ELSE FALSE *) | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 --> | ||
| - | |||
| - | SCR # 49 | ||
| - | 0 ( ERROR HANDLER | ||
| - | 1 | ||
| - | 2 : (ABORT) | ||
| - | 3 | ||
| - | 4 : ERROR ( WARNING: | ||
| - | | ||
| - | | ||
| - | | ||
| - | 8 | ||
| - | 9 : ID. ( PRINT NAME FIELD FROM ITS HEADER ADDRESS *) | ||
| - | 10 PAD 020 5F FILL DUP PFA LFA OVER - | ||
| - | 11 PAD SWAP CMOVE PAD COUNT 01F AND TYPE SPACE ; | ||
| - | 12 --> | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | SCR # 50 | ||
| - | 0 ( CREATE | ||
| - | 1 | ||
| - | 2 : CREATE | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 | ||
| - | 11 | ||
| - | 12 | ||
| - | 13 --> | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | FORTH INTEREST GROUP MAY 1, 1979 | ||
| - | |||
| - | |||
| - | 58 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | SCR # 51 | ||
| - | 0 ( LITERAL, | ||
| - | 1 | ||
| - | 2 : [COMPILE] | ||
| - | | ||
| - | 4 | ||
| - | 5 : LITERAL | ||
| - | | ||
| - | 7 | ||
| - | 8 : DLITERAL | ||
| - | | ||
| - | 10 | ||
| - | 11 | ||
| - | 12 ( FOLLOWING DEFINITION IS INSTALLATION DEPENDENT ) | ||
| - | 13 : ? | ||
| - | 14 | ||
| - | 15 --> | ||
| - | |||
| - | SCR # 52 | ||
| - | 0 ( INTERPRET, | ||
| - | 1 | ||
| - | 2 : INTERPRET | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 --> | ||
| - | 11 | ||
| - | 12 | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | SCR # 53 | ||
| - | 0 ( IMMEDIATE, | ||
| - | 1 : IMMEDIATE | ||
| - | | ||
| - | 3 | ||
| - | 4 : VOCABULARY | ||
| - | | ||
| - | | ||
| - | | ||
| - | 8 | ||
| - | 9 VOCABULARY | ||
| - | 10 | ||
| - | 11 : DEFINITIONS | ||
| - | 12 CONTEXT | ||
| - | 13 | ||
| - | 14 : ( ( SKIP INPUT TEXT UNTIL RIGHT PARENTHESIS *) | ||
| - | 15 29 WORD ; | ||
| - | |||
| - | FORTH INTEREST GROUP MAY 1, 1979 | ||
| - | |||
| - | |||
| - | 59 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | SCR # 54 | ||
| - | 0 ( QUIT, ABORT WFR-79MAR30 ) | ||
| - | 1 | ||
| - | 2 : QUIT ( RESTART, | ||
| - | | ||
| - | | ||
| - | | ||
| - | 6 | ||
| - | 7 : ABORT ( WARM RESTART, INCLUDING REGISTERS *) | ||
| - | | ||
| - | | ||
| - | 10 | ||
| - | 11 | ||
| - | 12 | ||
| - | 13 --> | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | SCR # 55 | ||
| - | 0 ( COLD START | ||
| - | 1 CODE COLD ( COLD START, INITIALIZING USER AREA *) | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 BEGIN, | ||
| - | 11 UP )Y STA, ( TO USER AREA ) | ||
| - | 12 | ||
| - | 13 'T ABORT 100 /MOD # LDA, IP 1+ STA, | ||
| - | 14 # LDA, IP STA, | ||
| - | 15 6C # LDA, W 1 - STA, 'T RP! JMP, ( RUN ) --> | ||
| - | |||
| - | SCR # 56 | ||
| - | 0 ( MATH UTILITY | ||
| - | 1 CODE S-> | ||
| - | | ||
| - | 3 | ||
| - | 4 : +- 0< IF MINUS ENDIF ; ( APPLY SIGN TO NUMBER BENEATH *) | ||
| - | 5 | ||
| - | 6 : D+- ( APPLY SIGN TO DOUBLE NUMBER BENEATH *) | ||
| - | | ||
| - | 8 | ||
| - | 9 : ABS | ||
| - | 10 : DABS DUP D+- ; ( DOUBLE INTEGER ABSOLUTE VALUE *) | ||
| - | 11 | ||
| - | 12 : MIN ( LEAVE SMALLER OF TWO NUMBERS *) | ||
| - | 13 | ||
| - | 14 : MAX ( LEAVE LARGER OF TWO NUMBERS *) | ||
| - | 15 | ||
| - | |||
| - | FORTH INTEREST GROUP MAY 1, 1979 | ||
| - | |||
| - | |||
| - | 60 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | SCR # 57 | ||
| - | 0 ( MATH PACKAGE | ||
| - | 1 : M* ( LEAVE SIGNED DOUBLE PRODUCT OF TWO SINGLE NUMBERS *) | ||
| - | | ||
| - | 3 : M/ ( FROM SIGNED DOUBLE-3-2, SIGNED DIVISOR-1 *) | ||
| - | | ||
| - | | ||
| - | | ||
| - | 7 : * U* DROP ; ( SIGNED PRODUCT *) | ||
| - | 8 : /MOD > | ||
| - | 9 : / /MOD SWAP DROP ; ( LEAVE QUOTIENT *) | ||
| - | 10 : MOD /MOD DROP ; ( LEAVE REMAINDER *) | ||
| - | 11 : */MOD ( TAKE RATION OF THREE NUMBERS, LEAVING *) | ||
| - | 12 >R M* R> M/ ; ( REM-2, QUOTIENT-1 *) | ||
| - | 13 : */ | ||
| - | 14 : M/MOD ( DOUBLE, SINGLE DIVISOR ... REMAINDER, DOUBLE *) | ||
| - | 15 > | ||
| - | |||
| - | SCR # 58 | ||
| - | 0 ( DISC UTILITY, | ||
| - | 1 FIRST VARIABLE | ||
| - | 2 FIRST VARIABLE | ||
| - | 3 | ||
| - | 4 : +BUF ( ADVANCE ADDRESS-1 TO NEXT BUFFER. RETURNS FALSE *) | ||
| - | | ||
| - | | ||
| - | 7 | ||
| - | 8 : UPDATE | ||
| - | | ||
| - | 10 | ||
| - | 11 : EMPTY-BUFFERS | ||
| - | 12 | ||
| - | 13 | ||
| - | 14 : DR0 0 OFFSET | ||
| - | 15 : DR1 | ||
| - | |||
| - | SCR # 59 | ||
| - | 0 ( BUFFER | ||
| - | 1 : BUFFER | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 | ||
| - | 11 | ||
| - | 12 | ||
| - | 13 | ||
| - | 14 --> | ||
| - | 15 | ||
| - | |||
| - | FORTH INTEREST GROUP MAY 1, 1979 | ||
| - | |||
| - | |||
| - | 61 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | SCR # 60 | ||
| - | 0 ( BLOCK WFR-79APR02 ) | ||
| - | 1 : BLOCK ( CONVERT BLOCK NUMBER TO ITS BUFFER ADDRESS *) | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 DUP @ R - DUP + 0= | ||
| - | 11 | ||
| - | 12 | ||
| - | 13 ENDIF | ||
| - | 14 R> DROP 2+ ; | ||
| - | 15 --> | ||
| - | |||
| - | SCR # 61 | ||
| - | 0 ( TEXT OUTPUT FORMATTING | ||
| - | 1 | ||
| - | 2 : (LINE) | ||
| - | | ||
| - | | ||
| - | 5 | ||
| - | 6 : .LINE ( LINE#, | ||
| - | | ||
| - | 8 | ||
| - | 9 : MESSAGE | ||
| - | 10 | ||
| - | 11 | ||
| - | 12 | ||
| - | 13 | ||
| - | 14 --> | ||
| - | 15 | ||
| - | |||
| - | SCR # 62 | ||
| - | 0 ( LOAD, --> | ||
| - | 1 | ||
| - | 2 : LOAD ( INTERPRET SCREENS FROM DISC *) | ||
| - | | ||
| - | | ||
| - | 5 | ||
| - | 6 : --> | ||
| - | | ||
| - | | ||
| - | 9 | ||
| - | 10 --> | ||
| - | 11 | ||
| - | 12 | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | FORTH INTEREST GROUP MAY 1, 1979 | ||
| - | |||
| - | |||
| - | 62 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | SCR # 63 | ||
| - | 0 ( INSTALLATION DEPENDENT TERMINAL I-O, TIM WFR-79APR26 ) | ||
| - | 1 ( EMIT ) ASSEMBLER | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 7 ( KEY ) | ||
| - | | ||
| - | | ||
| - | 10 | ||
| - | 11 | ||
| - | 12 0 X) CMP, 0 X) CMP, 6E02 LDA, .A LSR, PHP, TYA, | ||
| - | 13 .A LSR, PLP, CS IF, 80 # ORA, THEN, TAY, DEX, | ||
| - | 14 0= END, 731D JSR, FF # EOR, 7F # AND, 0= NOT END, | ||
| - | 15 XSAVE LDX, | ||
| - | |||
| - | SCR # 64 | ||
| - | 0 ( INSTALLATION DEPENDENT TERMINAL I-O, TIM WFR-79APR02 ) | ||
| - | 1 | ||
| - | 2 ( ?TERMINAL ) | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 7 | ||
| - | 8 ( CR ) | ||
| - | | ||
| - | 10 XSAVE STX, 728A JSR, XSAVE LDX, NEXT JMP, | ||
| - | 11 | ||
| - | 12 --> | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | SCR # 65 | ||
| - | 0 ( INSTALLATION DEPENDENT DISC WFR-79APR02 ) | ||
| - | 1 6900 CONSTANT | ||
| - | 2 6901 CONSTANT | ||
| - | 3 | ||
| - | 4 | ||
| - | 5 : #HL ( CONVERT DECIMAL DIGIT FOR DISC CONTROLLER *) | ||
| - | | ||
| - | 7 | ||
| - | 8 --> | ||
| - | 9 | ||
| - | 10 | ||
| - | 11 | ||
| - | 12 | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | FORTH INTEREST GROUP MAY 1, 1979 | ||
| - | |||
| - | |||
| - | 63 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | SCR # 66 | ||
| - | 0 ( D/ | ||
| - | 1 CODE D/ | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 6 | ||
| - | 7 : ?DISC ( UPON NAK SHOW ERR MSG, QUIT. ABSORBS TILL *) | ||
| - | | ||
| - | | ||
| - | 10 IF ( NAK ) CR | ||
| - | 11 BEGIN 4 D/ | ||
| - | 12 UNTIL ( PRINT ERR MSG TIL EOT ) QUIT | ||
| - | 13 ENDIF ( FOR ENQ, ACK ) | ||
| - | 14 | ||
| - | 15 ENDIF R> DROP ; | ||
| - | |||
| - | SCR # 67 | ||
| - | 0 ( BLOCK-WRITE | ||
| - | 1 CODE BLOCK-WRITE | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 | ||
| - | 11 | ||
| - | 12 --> | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | SCR # 68 | ||
| - | 0 ( BLOCK-READ, | ||
| - | 1 | ||
| - | 2 CODE BLOCK-READ | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 NEXT JMP, | ||
| - | 11 | ||
| - | 12 --> | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | FORTH INTEREST GROUP MAY 1, 1979 | ||
| - | |||
| - | |||
| - | 64 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | SCR # 69 | ||
| - | 0 ( R/W FOR PERSCI 1070 CONTROLLER | ||
| - | 1 0A ALLOT HERE ( WORKSPACE TO PREPARE DISC CONTROL TEXT ) | ||
| - | | ||
| - | | ||
| - | 4 : R/W ( READ/WRITE DISC BLOCK *) | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 1O #HL #HL DROP BL HOLD ( TRACK 00-76 ) | ||
| - | 11 DUP | ||
| - | 12 IF 49 ( 1=READ) | ||
| - | 13 HOLD HLD @ 0A BLOCK-WRITE | ||
| - | 14 IF BLOCK-READ | ||
| - | 15 ?DISC ; | ||
| - | |||
| - | SCR # 70 | ||
| - | 0 ( FORWARD REFERENCES | ||
| - | 1 00 BYTE.IN | ||
| - | 2 02 BYTE.IN | ||
| - | 3 04 BYTE.IN | ||
| - | 4 08 BYTE.IN | ||
| - | 5 0C BYTE.IN | ||
| - | 6 0E BYTE.IN | ||
| - | 7 10 BYTE.IN | ||
| - | 8 00 BYTE.IN | ||
| - | 9 02 BYTE.IN | ||
| - | 10 06 BYTE.IN | ||
| - | 11 08 BYTE.IN | ||
| - | 12 00 BYTE.IN | ||
| - | 13 02 BYTE.IN | ||
| - | 14 04 BYTE.IN | ||
| - | 15 06 BYTE.IN | ||
| - | |||
| - | SCR # 71 | ||
| - | 0 ( FORWARD REFERENCES | ||
| - | 1 02 BYTE.IN VARIABLE | ||
| - | 2 02 BYTE.IN USER | ||
| - | 3 06 BYTE.IN ? | ||
| - | 4 0F BYTE.IN ." | ||
| - | 5 1D BYTE.IN ." | ||
| - | 6 00 BYTE.IN (ABORT) | ||
| - | 7 19 BYTE.IN ERROR REPLACED.BY | ||
| - | 8 25 BYTE.IN ERROR REPLACED.BY | ||
| - | 9 0C BYTE.IN WORD | ||
| - | 10 1E BYTE.IN CREATE | ||
| - | 11 2C BYTE.IN CREATE | ||
| - | 12 04 BYTE.IN ABORT REPLACED.BY | ||
| - | 13 2C BYTE.IN BUFFER | ||
| - | 14 30 BYTE.IN BLOCK REPLACED.BY | ||
| - | 15 | ||
| - | |||
| - | FORTH INTEREST GROUP MAY 1, 1979 | ||
| - | |||
| - | |||
| - | 65 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | SCR # 72 | ||
| - | 0 ( ', | ||
| - | 1 HEX 3 WIDTH | ||
| - | 2 : ' | ||
| - | | ||
| - | | ||
| - | 5 | ||
| - | 6 : FORGET | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 | ||
| - | 11 | ||
| - | 12 | ||
| - | 13 --> | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | SCR # 73 | ||
| - | 0 ( CONDITIONAL COMPILER, PER SHIRA WFR-79APR01 ) | ||
| - | 1 : BACK | ||
| - | 2 | ||
| - | 3 : BEGIN ?COMP HERE 1 ; IMMEDIATE | ||
| - | 4 | ||
| - | 5 : ENDIF ?COMP 2 ? | ||
| - | 6 | ||
| - | 7 : THEN | ||
| - | 8 | ||
| - | 9 : DO | ||
| - | 10 | ||
| - | 11 : LOOP | ||
| - | 12 | ||
| - | 13 : +LOOP 3 ? | ||
| - | 14 | ||
| - | 15 : UNTIL 1 ? | ||
| - | |||
| - | SCR # 74 | ||
| - | 0 ( CONDITIONAL COMPILER | ||
| - | 1 : END [COMPILE] | ||
| - | 2 | ||
| - | 3 : AGAIN 1 ? | ||
| - | 4 | ||
| - | 5 : REPEAT | ||
| - | | ||
| - | 7 | ||
| - | 8 : IF | ||
| - | 9 | ||
| - | 10 : ELSE | ||
| - | 11 SWAP 2 [COMPILE] | ||
| - | 12 | ||
| - | 13 : WHILE | ||
| - | 14 | ||
| - | 15 --> | ||
| - | |||
| - | FORTH INTEREST GROUP MAY 1, 1979 | ||
| - | |||
| - | |||
| - | 66 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | SCR # 75 | ||
| - | 0 ( NUMERIC PRIMITIVES | ||
| - | 1 : SPACES | ||
| - | 2 | ||
| - | 3 : <# | ||
| - | 4 | ||
| - | 5 : #> | ||
| - | 6 | ||
| - | 7 : SIGN | ||
| - | 8 | ||
| - | 9 : # ( CONVERT ONE DIGIT, HOLDING IN PAD * ) | ||
| - | 10 BASE @ M/MOD ROT 9 OVER < IF 7 + ENDIF 30 + HOLD ; | ||
| - | 11 | ||
| - | 12 : #S | ||
| - | 13 --> | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | SCR # 76 | ||
| - | 0 ( OUTPUT OPERATORS | ||
| - | 1 : D.R ( DOUBLE INTEGER OUTPUT, RIGHT ALIGNED IN FIELD *) | ||
| - | | ||
| - | | ||
| - | 4 | ||
| - | 5 : D. | ||
| - | 6 | ||
| - | 7 : .R > | ||
| - | 8 | ||
| - | 9 : . S-> | ||
| - | 10 | ||
| - | 11 : ? @ . ; ( PRINT CONTENTS OF MEMORY *) | ||
| - | 12 | ||
| - | 13 . CFA | ||
| - | 14 --> | ||
| - | 15 | ||
| - | |||
| - | SCR # 77 | ||
| - | 0 ( PROGRAM DOCUMENTATION | ||
| - | 1 HEX | ||
| - | 2 : LIST ( LIST SCREEN BY NUMBER ON STACK *) | ||
| - | | ||
| - | | ||
| - | | ||
| - | 6 | ||
| - | 7 : INDEX ( PRINT FIRST LINE OF EACH SCREEN FROM-2, TO-1 *) | ||
| - | | ||
| - | | ||
| - | 10 0 I .LINE | ||
| - | 11 ? | ||
| - | 12 : TRIAD ( PRINT 3 SCREENS ON PAGE, CONTAINING # ON STACK *) | ||
| - | 13 0C EMIT ( FF ) 3 / 3 * 3 OVER + SWAP | ||
| - | 14 DO CR I LIST LOOP CR | ||
| - | 15 0F MESSAGE | ||
| - | |||
| - | FORTH INTEREST GROUP MAY 1, 1979 | ||
| - | |||
| - | |||
| - | 67 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | SCR # 78 | ||
| - | 0 ( TOOLS WPR-79APR20 ) | ||
| - | 1 HEX | ||
| - | 2 : VLIST ( LIST CONTEXT VOCABULARY *) | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 7 --> | ||
| - | 8 | ||
| - | 9 | ||
| - | 10 | ||
| - | 11 | ||
| - | 12 | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | SCR # 79 | ||
| - | 0 ( TOOLS WFR-79MAY03 ) | ||
| - | 1 HEX | ||
| - | 2 | ||
| - | 3 CREATE | ||
| - | | ||
| - | 5 | ||
| - | 6 | ||
| - | 7 | ||
| - | 8 | ||
| - | 9 | ||
| - | 10 DECIMAL | ||
| - | 11 HERE | ||
| - | 12 HERE | ||
| - | 13 HERE | ||
| - | 14 LATEST | ||
| - | 15 ' | ||
| - | |||
| - | SCR # 80 | ||
| - | 0 --> | ||
| - | 1 | ||
| - | 2 | ||
| - | 3 | ||
| - | 4 | ||
| - | 5 | ||
| - | 6 | ||
| - | 7 | ||
| - | 8 | ||
| - | 9 | ||
| - | 10 | ||
| - | 11 | ||
| - | 12 | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | FORTH INTEREST GROUP MAY 1, 1979 | ||
| - | |||
| - | |||
| - | 68 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | LINE EDITOR | ||
| - | |||
| - | |||
| - | This is a sample editor, compatible with the fig-FORTH model and | ||
| - | | ||
| - | | ||
| - | high level or translated. | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | 69 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | 70 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | SCR # 87 | ||
| - | 0 ( TEXT, LINE WFR-79MAY01 ) | ||
| - | 1 FORTH DEFINITIONS | ||
| - | 2 : TEXT ( ACCEPT FOLLOWING TEXT TO PAD *) | ||
| - | | ||
| - | 4 | ||
| - | 5 : LINE ( RELATIVE TO SCR, LEAVE ADDRESS OF LINE *) | ||
| - | | ||
| - | | ||
| - | 8 --> | ||
| - | 9 | ||
| - | 10 | ||
| - | 11 | ||
| - | 12 | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | SCR # 88 | ||
| - | 0 ( LINE EDITOR | ||
| - | 1 VOCABULARY | ||
| - | 2 : WHERE ( PRINT SCREEN # AND IMAGE OF ERROR *) | ||
| - | | ||
| - | | ||
| - | | ||
| - | 6 | ||
| - | 7 EDITOR | ||
| - | 8 : # | ||
| - | | ||
| - | 10 : #LEAD ( LINE ADDRESS-2, OFFSET-1 TO CURSOR *) | ||
| - | 11 # | ||
| - | 12 : #LAG ( CURSOR ADDRESS-2, COUNT-1 AFTER CURSOR *) | ||
| - | 13 #LEAD DUP >R + C/L R> - ; | ||
| - | 14 : -MOVE ( MOVE IN BLOCK BUFFER ADDR FROM-2, | ||
| - | 15 LINE C/L CMOVE UPDATE | ||
| - | |||
| - | SCR # 89 | ||
| - | 0 ( LINE EDITING COMMANDS | ||
| - | 1 : H ( HOLD NUMBERED LINE AT PAD *) | ||
| - | | ||
| - | 3 | ||
| - | 4 : E ( ERASE LINE-1 WITH BLANKS *) | ||
| - | | ||
| - | 6 | ||
| - | 7 : S ( SPREAD MAKING LINE # BLANK *) | ||
| - | | ||
| - | | ||
| - | 10 | ||
| - | 11 : D ( DELETE LINE-1, BUT HOLD IN PAD *) | ||
| - | 12 | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 --> | ||
| - | |||
| - | FORTH INTEREST GROUP MAY 1, 1979 | ||
| - | |||
| - | |||
| - | 71 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | SCR # 90 | ||
| - | 0 ( LINE EDITING COMMANDS | ||
| - | 1 | ||
| - | 2 : M ( MOVE CURSOR BY SIGNED AMOUNT-1, PRINT ITS LINE *) | ||
| - | | ||
| - | | ||
| - | 5 | ||
| - | 6 : T ( TYPE LINE BY #-1, SAVE ALSO IN PAD *) | ||
| - | | ||
| - | 8 | ||
| - | 9 : L ( RE-LIST SCREEN *) | ||
| - | 10 | ||
| - | 11 --> | ||
| - | 12 | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | SCR # 91 | ||
| - | 0 ( LINE EDITING COMMANDS | ||
| - | 1 : R ( REPLACE ON LINE #-1, FROM PAD *) | ||
| - | | ||
| - | 3 | ||
| - | 4 : P ( PUT FOLLOWING TEXT ON LINE-1 *) | ||
| - | | ||
| - | 6 | ||
| - | 7 : I ( INSERT TEXT FROM PAD ONTO LINE # *) | ||
| - | | ||
| - | | ||
| - | 10 : TOP ( HOME CURSOR TO TOP LEFT OF SCREEN *) | ||
| - | 11 | ||
| - | 12 --> | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | SCR # 92 | ||
| - | 0 ( SCREEN EDITING COMMANDS | ||
| - | 1 : CLEAR ( CLEAR SCREEN BY NUMBER-1 *) | ||
| - | | ||
| - | 3 | ||
| - | 4 : FLUSH ( WRITE ALL UPDATED BLOCKS TO DISC *) | ||
| - | | ||
| - | | ||
| - | 7 | ||
| - | 8 : COPY ( DUPLICATE SCREEN-2, ONTO SCREEN-1 *) | ||
| - | | ||
| - | 10 DO DUP FORTH I BLOCK 2 - ! 1+ | ||
| - | 11 DROP FLUSH ; | ||
| - | 12 --> | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | FORTH INTEREST GROUP MAY 1, 1979 | ||
| - | |||
| - | |||
| - | 72 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | SCR # 93 | ||
| - | 0 ( DOUBLE NUMBER SUPPORT | ||
| - | 1 ( OPERATES ON 32 BIT DOUBLE NUMBERS | ||
| - | 2 FORTH DEFINITIONS | ||
| - | 3 | ||
| - | 4 : 2DROP | ||
| - | 5 | ||
| - | 6 : 2DUP OVER OVER ; ( DUPLICATE A DOUBLE NUMBER ) | ||
| - | 7 | ||
| - | 8 : 2SWAP | ||
| - | | ||
| - | 10 EDITOR DEFINITIONS | ||
| - | 11 | ||
| - | 12 | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | SCR # 94 | ||
| - | 0 ( STRING MATCH FOR EDITOR | ||
| - | 1 : -TEXT ( ADDRESS-3, COUNT-2, ADDRESS-1 --- ) | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 7 : MATCH ( CURSOR ADDRESS-4, BYTES LEFT-3, STRING ADDRESS-2, ) | ||
| - | | ||
| - | | ||
| - | 10 ( CADDR-6, BLEFT-5, $ADDR-4, $LEN-3, CADDR+BLEFT-2, | ||
| - | 11 | ||
| - | 12 | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | SCR # 95 | ||
| - | 0 ( STRING EDITING COMMANDS | ||
| - | 1 : 1LINE ( SCAN LINE WITH CURSOR FOR MATCH TO PAD TEXT, *) | ||
| - | | ||
| - | | ||
| - | 4 | ||
| - | 5 : FIND ( STRING AT PAD OVER FULL SCREEN RANGE, ELSE ERROR *) | ||
| - | | ||
| - | | ||
| - | | ||
| - | 9 | ||
| - | 10 : DELETE | ||
| - | 11 > | ||
| - | 12 # | ||
| - | 13 # | ||
| - | 14 | ||
| - | 15 --> | ||
| - | |||
| - | FORTH INTEREST GROUP NOVEMBER 1980 | ||
| - | |||
| - | |||
| - | 73 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | SCR # 96 | ||
| - | 0 ( STRING EDITOR COMMANDS | ||
| - | 1 : N ( FIND NEXT OCCURANCE OF PREVIOUS TEXT *) | ||
| - | | ||
| - | 3 | ||
| - | 4 : F ( FIND OCCURANCE OF FOLLOWING TEXT *) | ||
| - | | ||
| - | 6 | ||
| - | 7 : B ( BACKUP CURSOR BY TEXT IN PAD *) | ||
| - | | ||
| - | 9 | ||
| - | 10 : X ( DELETE FOLLOWING TEXT *) | ||
| - | 11 | ||
| - | 12 | ||
| - | 13 : TILL ( DELETE ON CURSOR LINE, FROM CURSOR TO TEXT END *) | ||
| - | 14 # | ||
| - | 15 # | ||
| - | |||
| - | SCR # 97 | ||
| - | 0 ( STRING EDITOR COMMANDS | ||
| - | 1 : C ( SPREAD AT CURSOR AND COPY IN THE FOLLOWING TEXT *) | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 FORTH DEFINITIONS | ||
| - | 11 LATEST | ||
| - | 12 HERE | ||
| - | 13 HERE | ||
| - | 14 ' | ||
| - | 15 HERE FENCE | ||
| - | |||
| - | SCR # 98 | ||
| - | 0 | ||
| - | 1 | ||
| - | 2 | ||
| - | 3 | ||
| - | 4 | ||
| - | 5 | ||
| - | 6 | ||
| - | 7 | ||
| - | 8 | ||
| - | 9 | ||
| - | 10 | ||
| - | 11 | ||
| - | 12 | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | FORTH INTEREST GROUP MAY 1, 1979 | ||
| - | |||
| - | |||
| - | 74 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | | ||
| - | |||
| - | by Bill Stoddart | ||
| - | of FIG, United Kingdom | ||
| - | |||
| - | |||
| - | FORTH organizes its mass storage into " | ||
| - | If, for example, a diskette of 250k byte capacity is used entirely | ||
| - | for storing text, it will appear to the user as 250 screens | ||
| - | | ||
| - | |||
| - | Each screen is organized as 16 lines with 64 characters per line. | ||
| - | The FORTH screens are merely an arrangement of virtual memory and | ||
| - | need not correspond exactly with the screen format of a particular | ||
| - | | ||
| - | |||
| - | |||
| - | Selecting a Screen and Input of Text | ||
| - | |||
| - | To start an editing session the user types EDITOR to invoke the | ||
| - | | ||
| - | |||
| - | The screen to be edited is then selected, using either: | ||
| - | |||
| - | n LIST ( list screen n and select it for editing ) OR | ||
| - | n CLEAR ( clear screen n and select for editing ) | ||
| - | |||
| - | To input new test to screen n after LIST or CLEAR the P (put) | ||
| - | | ||
| - | |||
| - | | ||
| - | |||
| - | 0 P THIS IS HOW | ||
| - | 1 P TO INPUT TEXT | ||
| - | 2 P TO LINES 0, 1, AND 2 OF THE SELECTED SCREEN. | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | 75 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | Line Editing | ||
| - | |||
| - | | ||
| - | This is a text buffer which may hold a line of text used by or | ||
| - | saved with a line editing command, or a text string to be found or | ||
| - | | ||
| - | |||
| - | PAD can be used to transfer a line from one screen to another, as | ||
| - | well as to perform edit operations within a single screen. | ||
| - | |||
| - | |||
| - | Line Editor Commands | ||
| - | |||
| - | n H Hold line n at PAD (used by system more often than by user). | ||
| - | |||
| - | n D | ||
| - | as lines n+1 to 15 move up 1 line. | ||
| - | |||
| - | n T Type line n and save it in PAD. | ||
| - | |||
| - | n R | ||
| - | |||
| - | n I | ||
| - | and following lines down. Line 15 is lost. | ||
| - | |||
| - | n E Erase line n with blanks. | ||
| - | |||
| - | n S | ||
| - | | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | 76 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | Cursor Control and String Editing | ||
| - | |||
| - | The screen of text being edited resides in a buffer area of | ||
| - | | ||
| - | this buffer area. Commands are provided for the user to position | ||
| - | the cursor, either directly or by searching for a string of buffer | ||
| - | text, and to insert or delete text at the cursor position. | ||
| - | |||
| - | |||
| - | | ||
| - | |||
| - | | ||
| - | |||
| - | n M Move the cursor by a signed amount n and print the cursor | ||
| - | | ||
| - | a __ (underline). | ||
| - | |||
| - | |||
| - | | ||
| - | |||
| - | F text Search forward from the current cursor position until | ||
| - | | ||
| - | of the text string, and the cursor line is printed. | ||
| - | If the string is not found an error message is given | ||
| - | and the cursor is repositioned at the top of screen. | ||
| - | |||
| - | | ||
| - | the most recent text. | ||
| - | |||
| - | | ||
| - | | ||
| - | |||
| - | X text Find and delete the string " | ||
| - | |||
| - | C text Copy in text to the cursor line at the cursor position. | ||
| - | |||
| - | TILL text | ||
| - | of the text string " | ||
| - | |||
| - | | ||
| - | at the cursor position. | ||
| - | | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | 77 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | | ||
| - | |||
| - | n LIST List screen n and select it for editing | ||
| - | |||
| - | n CLEAR Clear screen n with blanks and select it for editing | ||
| - | |||
| - | n1 n2 COPY Copy screen n1 to screen n2. | ||
| - | |||
| - | | ||
| - | after the screen listing, to show the cursor position. | ||
| - | |||
| - | | ||
| - | all entries and updates of text have been transferred | ||
| - | to disc. | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | 78 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | | ||
| - | |||
| - | | ||
| - | Accept following text to pad. c is text delimiter. | ||
| - | |||
| - | | ||
| - | Leave address of line n of current screen. | ||
| - | be in the disc buffer area. | ||
| - | |||
| - | | ||
| - | n2 is the block no., n1 is offset into block. | ||
| - | found in the source when loading from disc, the recovery | ||
| - | routine ERROR leaves these values on the stack to help the user | ||
| - | locate the error. | ||
| - | line nos. and a picture of where the error occurred. | ||
| - | |||
| - | | ||
| - | A user variable which contains the offset of the editing cursor | ||
| - | from the start of the screen. | ||
| - | |||
| - | # | ||
| - | From the cursor position determine the line-no n2 and the | ||
| - | offset into the line n1. | ||
| - | |||
| - | # | ||
| - | |||
| - | # | ||
| - | |||
| - | | ||
| - | Move a line of text from addr to line of current screen. | ||
| - | |||
| - | | ||
| - | Hold numbered line at PAD. | ||
| - | |||
| - | | ||
| - | Erase line n with blanks. | ||
| - | |||
| - | | ||
| - | Spread. | ||
| - | |||
| - | | ||
| - | Delete line n, but hold in pad. | ||
| - | |||
| - | | ||
| - | Move cursor by a signed amount and print its line. | ||
| - | |||
| - | | ||
| - | Type line n and save in PAD. | ||
| - | |||
| - | | ||
| - | List the current screen. | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | 79 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | | ||
| - | Replace line n with the text in PAD. | ||
| - | |||
| - | | ||
| - | Put the following text on line n. | ||
| - | |||
| - | | ||
| - | Spread at line n and insert text from PAD. | ||
| - | |||
| - | | ||
| - | Position editing cursor at top of screen. | ||
| - | |||
| - | | ||
| - | Clear screen n, can be used to select screen n for editing. | ||
| - | |||
| - | | ||
| - | Write all updated buffers to disc. This has been modified to | ||
| - | cope with an error in the Micropolis CPM disc drivers. | ||
| - | |||
| - | | ||
| - | Copy screen n1 to screen n2. | ||
| - | |||
| - | | ||
| - | True if strings exactly match. | ||
| - | |||
| - | | ||
| - | | ||
| - | | ||
| - | Match the string at str-addr with all strings on the cursor | ||
| - | line forward from the cursor. | ||
| - | cursor R# to be updated either to the end of the matching text | ||
| - | or to the start of the next line. | ||
| - | |||
| - | | ||
| - | Scan the cursor line for a match to PAD text. Return flag and | ||
| - | update the cursor R# to the end of matching text, or to the | ||
| - | start of the next line if no match is found. | ||
| - | |||
| - | | ||
| - | Search for a match to the string at PAD, from the cursor | ||
| - | position till the end of screen. | ||
| - | error message and reposition the cursor at the top of screen. | ||
| - | |||
| - | | ||
| - | Delete n characters prior to the cursor. | ||
| - | |||
| - | | ||
| - | Find next occurrence of PAD text. | ||
| - | |||
| - | | ||
| - | Input following text to PAD and search for match from cursor | ||
| - | position till end of screen. | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | 80 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | | ||
| - | Backup cursor by text in PAD. | ||
| - | |||
| - | | ||
| - | Delete next occurrence of following text. | ||
| - | |||
| - | | ||
| - | Delete on cursor line from cursor to end of the following text. | ||
| - | |||
| - | | ||
| - | Spread at cursor and copy the following text into the cursor | ||
| - | line. | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | 81 | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | </ | ||
papierkorb/fig-forth_installation_manual.1754859049.txt.gz · Zuletzt geändert: 2025-08-10 22:50 von mka