| 1 | README for pForth - a Portable ANS-like Forth written in ANSI 'C' |
| 2 | |
| 3 | by Phil Burk |
| 4 | with Larry Polansky, David Rosenboom and Darren Gibbs. |
| 5 | Support for 64-bit cells by Aleksej Saushev. |
| 6 | |
| 7 | Last updated: April 24, 2018 V28 |
| 8 | |
| 9 | Code for pForth is maintained on GitHub at: |
| 10 | https://github.com/philburk/pforth |
| 11 | |
| 12 | Documentation for pForth at: |
| 13 | http://www.softsynth.com/pforth/ |
| 14 | |
| 15 | For technical support please use the pForth forum at: |
| 16 | http://groups.google.com/group/pforthdev |
| 17 | |
| 18 | -- LEGAL NOTICE ----------------------------------------- |
| 19 | |
| 20 | The pForth software code is dedicated to the public domain, |
| 21 | and any third party may reproduce, distribute and modify |
| 22 | the pForth software code or any derivative works thereof |
| 23 | without any compensation or license. The pForth software |
| 24 | code is provided on an "as is" basis without any warranty |
| 25 | of any kind, including, without limitation, the implied |
| 26 | warranties of merchantability and fitness for a particular |
| 27 | purpose and their equivalents under the laws of any jurisdiction. |
| 28 | |
| 29 | -- Contents of SDK -------------------------------------- |
| 30 | |
| 31 | build - tools for building pForth on various platforms |
| 32 | build/unix - Makefile for unix |
| 33 | |
| 34 | csrc - pForth kernel in ANSI 'C' |
| 35 | csrc/pf_main.c - main() application for a standalone Forth |
| 36 | csrc/stdio - I/O code using basic stdio for generic platforms |
| 37 | csrc/posix - I/O code for Posix platform |
| 38 | csrc/win32 - I/O code for basic WIN32 platform |
| 39 | csrc/win32_console - I/O code for WIN32 console that supports command line history |
| 40 | |
| 41 | fth - Forth code |
| 42 | fth/util - utility functions |
| 43 | |
| 44 | -- How to build pForth ------------------------------------ |
| 45 | |
| 46 | See pForth reference manual at: |
| 47 | |
| 48 | http://www.softsynth.com/pforth/pf_ref.php |
| 49 | |
| 50 | -- How to run pForth ------------------------------------ |
| 51 | |
| 52 | Once you have compiled and built the dictionary, just enter: |
| 53 | pforth |
| 54 | |
| 55 | To compile source code files use: INCLUDE filename |
| 56 | |
| 57 | To create a custom dictionary enter in pForth: |
| 58 | c" newfilename.dic" SAVE-FORTH |
| 59 | The name must end in ".dic". |
| 60 | |
| 61 | To run PForth with the new dictionary enter in the shell: |
| 62 | pforth -dnewfilename.dic |
| 63 | |
| 64 | To run PForth and automatically include a forth file: |
| 65 | pforth myprogram.fth |
| 66 | |
| 67 | -- How to Test PForth ------------------------------------ |
| 68 | |
| 69 | You can test the Forth without loading a dictionary |
| 70 | which might be necessary if the dictionary can't be built. |
| 71 | |
| 72 | Enter: pforth -i |
| 73 | In pForth, enter: 3 4 + . |
| 74 | In pForth, enter: loadsys |
| 75 | In pForth, enter: 10 0 do i . loop |
| 76 | |
| 77 | PForth comes with a small test suite. To test the Core words, |
| 78 | you can use the coretest developed by John Hayes. |
| 79 | |
| 80 | Enter: pforth |
| 81 | Enter: include tester.fth |
| 82 | Enter: include coretest.fth |
| 83 | |
| 84 | To run the other tests, enter: |
| 85 | |
| 86 | pforth t_corex.fth |
| 87 | pforth t_strings.fth |
| 88 | pforth t_locals.fth |
| 89 | pforth t_alloc.fth |
| 90 | |
| 91 | They will report the number of tests that pass or fail. |