1 README for pForth - a Portable ANS-like Forth written in ANSI 'C'
\r
4 with Larry Polansky, David Rosenboom and Darren Gibbs.
\r
6 Last updated: 4/6/98 V19
\r
8 Please direct feedback, bug reports, and suggestions to:
\r
10 philburk@softsynth.com.
\r
13 The author is available for customization of pForth, porting to new
\r
15 platforms, or developing pForth applications on a contractual basis.
\r
17 If interested, contact Phil Burk at philburk@softsynth.com.
\r
21 -- LEGAL NOTICE -----------------------------------------
\r
23 The pForth software code is dedicated to the public domain,
\r
24 and any third party may reproduce, distribute and modify
\r
25 the pForth software code or any derivative works thereof
\r
26 without any compensation or license. The pForth software
\r
27 code is provided on an "as is" basis without any warranty
\r
28 of any kind, including, without limitation, the implied
\r
29 warranties of merchantability and fitness for a particular
\r
30 purpose and their equivalents under the laws of any jurisdiction.
\r
32 -- How to run PForth ------------------------------------
\r
35 Note: Please refer to "pf_ref.htm" for more complete information.
\r
38 Once you have compiled and built the dictionary, just enter:
\r
42 To compile source code files use: INCLUDE filename
\r
44 To create a custom dictionary enter in pForth:
\r
45 c" newfilename.dic" SAVE-FORTH
\r
46 The name must end in ".dic".
\r
48 To run PForth with the new dictionary enter in the shell:
\r
49 pforth -dnewfilename.dic
\r
51 To run PForth and automatically include a forth file:
\r
52 pforth myprogram.fth
\r
54 -- How to run PForth ------------------------------------
\r
56 You can test the Forth without loading a dictionary
\r
57 which might be necessary if the dictionary can't be built.
\r
61 In pForth, enter: 3 4 + .
\r
62 In pForth, enter: loadsys
\r
63 In pForth, enter: 10 0 do i . loop
\r
65 PForth comes with a small test suite. To test the Core words,
\r
66 you can use the coretest developed by John Hayes.
\r
69 Enter: include tester.fth
\r
70 Enter: include coretest.fth
\r
72 To run the other tests, enter:
\r
75 pforth t_strings.fth
\r
79 They will report the number of tests that pass or fail.
\r
81 -- Version History --------------------------------------
\r
84 - built pForth from various Forths including HMSL
\r
87 - made improvements necessary for use with M2 Verilog testing
\r
90 - Added support for embedded systems: PF_NO_FILEIO
\r
92 - Fixed bug in dictionary loader that treated HERE as name relative.
\r
95 - Added smart conditionals to allow IF THEN DO LOOP etc.
\r
96 outside colon definitions.
\r
97 - Fixed RSHIFT, made logical.
\r
98 - Added ARSHIFT for arithmetic shift.
\r
101 - Added FM/MOD SM/REM /MOD MOD */ */MOD
\r
102 - Added +LOOP EVALUATE UNLOOP EXIT
\r
103 - Everything passes "coretest.fth" except UM/MOD FIND and WORD
\r
106 - Added pfReportError()
\r
107 - Fixed problem with NumPrimitives growing and breaking dictionaries
\r
108 - Reduced size of saved dictionaries, 198K -> 28K in one instance
\r
109 - Funnel all terminal I/O through ioKey() and ioEmit()
\r
110 - Removed dependencies on printf() except for debugging
\r
113 - Added floating point
\r
114 - Changed NUMBER? to return a numeric type
\r
115 - Support double number entry, eg. 234. -> 234 0
\r
118 - Converted to 3DO Teamware environment
\r
119 - Added conditional compiler [IF] [ELSE] [THEN], use like #if
\r
120 - Fixed W->S B->S for positive values
\r
121 - Fixed ALLOCATE FREE validation. Was failing on some 'C' compilers.
\r
123 - Fixed ERASE, now fills with zero instead of BL
\r
126 - Report line number and line dump when INCLUDE aborts
\r
127 - Abort if stack depth changes in colon definition. Helps
\r
128 detect unbalanced conditionals (IF without THEN).
\r
129 - Print bytes added by include. Helps determine current file.
\r
130 - Added RETURN-CODE which is returned to caller, eg. UNIX shell.
\r
131 - Changed Header and Code sizes to 60000 and 150000
\r
132 - Added check for overflowing dictionary when creating secondaries.
\r
135 - Cleaned up and documented for alpha release.
\r
137 - compile floats.fth if F* exists
\r
138 - got PF_NO_SHELL working
\r
139 - added TURNKEY to build headerless dictionary apps
\r
140 - improved release script and rlsMakefile
\r
141 - added FS@ and FS! for FLPT structure members
\r
144 - Close nested source files when INCLUDE aborts.
\r
145 - Add PF_NO_CLIB option to reduce OS dependencies.
\r
146 - Add CREATE-FILE, fix R/W access mode for OPEN-FILE.
\r
147 - Use PF_FLOAT instead of FLOAT to avoid DOS problem.
\r
148 - Add PF_HOST_DOS for compilation control.
\r
149 - Shorten all long file names to fit in the 8.3 format
\r
150 required by some primitive operating systems. My
\r
151 apologies to those with modern computers who suffer
\r
155 - Added support for AUTO.INIT and AUTO.TERM. These are called
\r
156 automagically when the Forth starts and quits.
\r
157 - Change all int to int32.
\r
158 - Changed DO LOOP to ?DO LOOP in ENDCASE and LV.MATCH
\r
159 to fix hang when zero local variables.
\r
160 - Align long word members in :STRUCT to avoid bus errors.
\r
163 - Advance pointers in pfCopyMemory() and pfSetMemory()
\r
164 to fix PF_NO_CLIB build.
\r
165 - Increase size of array for PF_NO_MALLOC
\r
166 - Eliminate many warnings involving type casts and (const char *)
\r
167 - Fix error recovery in dictionary creation.
\r
168 - Conditionally eliminate some include files for embedded builds.
\r
169 - Cleanup some test files.
\r
172 - Add "extern 'C' {" to pf_mem.h for C++
\r
173 - Separate PF_STATIC_DIC from PF_NO_FILEIO so that we can use a static
\r
174 dictionary but also have file I/O.
\r
175 - Added PF_USER_FILEIO, PF_USER_CHARIO, PF_USER_CLIB.
\r
176 - INCLUDE now aborts if file not found.
\r
177 - Add +-> which allows you to add to a local variable, like +! .
\r
178 - VALUE now works properly as a self fetching constant.
\r
179 - Add CODE-SIZE and HEADERS-SIZE which lets you resize
\r
180 dictionary saved using SAVE-FORTH.
\r
181 - Added FILE?. Enter "FILE? THEN" to see what files THEN is defined in.
\r
182 - Fixed bug in local variables that caused problems if compilation
\r
183 aborted in a word with local variables.
\r
184 - Added SEE which "disassembles" Forth words. See "see.fth".
\r
185 - Added PRIVATE{ which can be used to hide low level support
\r
186 words. See "private.fth".
\r
189 * pforth command now requires -d before dictionary name.
\r
190 Eg. pforth -dcustom.dic test.fth
\r
191 * PF_USER_* now need to be defined as include file names.
\r
192 * PF_USER_CHARIO now requires different functions to be defined.
\r
193 See "csrc/pf_io.h".
\r
194 - Moved pfDoForth() from pf_main.c to pf_core.c to simplify
\r
196 - Fix build with PF_NO_INIT
\r
197 - Makefile now has target for embedded dictionary, "gmake pfemb".
\r
200 * If you use PF_USER_FILEIO, you must now define PF_STDIN and PF_STDOUT
\r
201 among other additions. See "pf_io.h".
\r
202 * COMPARE now matches ANS STRING word set!
\r
203 - Added PF_USER_INC1 and PF_USER_INC2 for optional includes
\r
204 and host customization. See "pf_all.h".
\r
205 - Fixed more warnings.
\r
206 - Fixed >NAME and WORDS for systems with high "negative" addresses.
\r
207 - Added WORDS.LIKE utility. Enter: WORDS.LIKE EMIT
\r
208 - Added stack check after every word in high level interpreter.
\r
209 Enter QUIT to enter high level interpreter which uses this feature.
\r
210 - THROW will no longer crash if not using high level interpreter.
\r
211 - Isolated all host dependencies into "pf_unix.h", "pf_win32.h",
\r
212 "pf_mac.h", etc. See "pf_all.h".
\r
213 - Added tests for CORE EXT, STRINGS words sets.
\r
215 - Fixed WHILE and REPEAT for multiple WHILEs.
\r
216 - Fixed .( ) for empty strings.
\r
217 - Fixed FATAN2 which could not compile on some systems (Linux gcc).
\r
220 * Define PF_USER_CUSTOM if you are defining your own custom
\r
221 'C' glue routines. This will ifndef the published example.
\r
222 - Fixed warning in pf_cglue.c.
\r
223 - Fixed SDAD in savedicd.fth. It used to generate bogus 'C' code
\r
224 if called when (BASE != 10), as in HEX mode.
\r
225 - Fixed address comparisons in forget.fth and private.fth for
\r
226 addresses above 0x80000000. Must be unsigned.
\r
227 - Call FREEZE at end of system.fth to initialize rfence.
\r
228 - Fixed 0.0 F. which used to leave 0.0 on FP stack.
\r
229 - Added FPICK ( n -- ) ( i*f -- i*f f[n] )
\r
230 - .S now prints hex numbers as unsigned.
\r
231 - Fixed internal number to text conversion for unsigned nums.
\r
234 - Fixed input of large floats. 0.7071234567 F. used to fail.
\r
237 - Make FILL a 'C' primitive.
\r
238 - optimized locals with (1_LOCAL@)
\r
239 - optimized inner interpreter by 15%
\r
240 - fix tester.fth failures
\r
241 - Added define for PF_KEY_ECHOS which turns off echo in ACCEPT if defined.
\r
242 - Fixed MARKER. Was equivalent to ANEW instead of proper ANS definition.
\r
243 - Fixed saving and restoring of TIB when nesting include files.
\r
247 - Warn if local var name matches dictionary, : foo { count -- } ;
\r
248 - TO -> and +-> now parse input stream. No longer use to-flag.
\r
249 - TO -> and +-> now give error if used with non-immediate word.
\r
250 - Added (FLITERAL) support to SEE.
\r
251 - Aded TRACE facility for single step debugging of Forth words.
\r
252 - Added stub for ?TERMINAL and KEY? for embedded systems.
\r
253 - Added PF_NO_GLOBAL_INIT for no reliance on global initialization.
\r
254 - Added PF_USER_FLOAT for customization of FP support.
\r
255 - Added floating point to string conversion words (F.) (FS.) (FE.)
\r
256 For example: : F. (F.) TYPE SPACE ;
\r
257 - Reversed order that values are placed on return stack in 2>R
\r
258 so that it matches ANS standard. 2>R is now same as SWAP >R >R
\r
259 Thank you Leo Wong for reporting this bug.
\r
261 - Added PF_USER_INIT and PF_USER_TERM for user definable init and term calls.
\r
263 - FIXED memory leak in pfDoForth()
\r
266 - Expand PAD for ConvertNumberToText so "-1 binary .s" doesn't crash.
\r
267 Thank you Michael Connor of Vancouver for reporting this bug.
\r
269 - Removed FDROP in REPRESENT to fix stack underflow after "0.0 F.".
\r
270 Thank you Jim Rosenow of Minnesota for reporting this bug.
\r
271 - Changed pfCharToLower to function to prevent macro expansion bugs under VXWORKS
\r
272 Thank you Jim Rosenow of Minnesota for reporting this bug.
\r
274 - "0.0 F~" now checks actual binary encoding of floats. Before this it used to just
\r
275 compare value which was incorrect. Now "0.0 -0.0 0.0 F~" returns FALSE.
\r
277 - Fixed definition of INPUT$ in tutorial.
\r
278 Thank you Hampton Miller of California for reporting this bug.
\r
280 - Added support for producing a target dictionary with a different
\r
281 Endian-ness than the host CPU. See PF_BIG_ENDIAN_DIC and PF_LITTLE_ENDIAN_DIC.
\r
283 - PForth kernel now comes up in a mode that uses BASE for numeric input when
\r
284 started with "-i" option. It used to always consider numeric input as HEX.
\r
285 Initial BASE is decimal.
\r
288 - Fixed some compiler warnings.
\r