pforth/.git
7 years agoAdd .gitignore to prevent unix build files from getting submitted.
Phil Burk [Sun, 1 Jan 2017 23:23:22 +0000 (15:23 -0800)]
Add .gitignore to prevent unix build files from getting submitted.

7 years agoMerge pull request #25 from ellerh/implement-save-input
Phil Burk [Sat, 31 Dec 2016 17:24:24 +0000 (09:24 -0800)]
Merge pull request #25 from ellerh/implement-save-input

Implement SAVE-INPUT and RESTORE-INPUT

7 years agoUse 4 spaces for indentation.
Helmut Eller [Sat, 31 Dec 2016 08:53:11 +0000 (09:53 +0100)]
Use 4 spaces for indentation.

* fth/save-input.fth (restore-column): Use ELSE instead of EXIT THEN.

7 years agoImplement SAVE-INPUT and RESTORE-INPUT
Helmut Eller [Tue, 27 Dec 2016 08:42:45 +0000 (09:42 +0100)]
Implement SAVE-INPUT and RESTORE-INPUT

There used to be primitive tokens ID_SAVE_INPUT and ID_RESTORE_INPUT
but those weren't used.  Saving/restoring positions in files is
somewhat involved so I decided to it in Forth.  To support this, I
re-purposed the codes of ID_SAVE_INPUT and ID_RESTORE_INPUT to
save/store the current line number (ID_SOURCE_LINE_NUMBER_FETCH, and
ID_SOURCE_LINE_NUMBER_STORE).  Those can also be used for something
like C's __LINE__ macro.

* fth/save-input.fth: New file.
* fth/loadp4th.fth: Load it.
* fth/system.fth (D=): New. Needed to compare file positions.
* fth/t_corex.fth: Add simple tests.

* csrc/pf_guts.h (ID_SOURCE_LINE_NUMBER_FETCH,
ID_SOURCE_LINE_NUMBER_STORE): Renamed from ID_SAVE_INPUT and
ID_RESTORE_INPUT.

* csrc/pf_inner.c (ID_SOURCE_LINE_NUMBER_FETCH,
ID_SOURCE_LINE_NUMBER_STORE): Implement.
(ID_SAVE_INPUT): Deleted. It's now in Forth.

* csrc/pfcompil.c (pfBuildDictionary): Define SOURCE-LINE-NUMBER@ and
 SOURCE-LINE-NUMBER!.

7 years agoMerge pull request #24 from ellerh/implement-environment-query
Phil Burk [Tue, 27 Dec 2016 02:00:51 +0000 (18:00 -0800)]
Merge pull request #24 from ellerh/implement-environment-query

Implement environment-query

7 years agoList missing query strings in comment
Helmut Eller [Mon, 26 Dec 2016 17:18:25 +0000 (18:18 +0100)]
List missing query strings in comment

7 years agoImplement ENVIRONMENT?
Helmut Eller [Sun, 25 Dec 2016 23:33:10 +0000 (00:33 +0100)]
Implement ENVIRONMENT?

* fth/misc2.fth (ENVIRONMENT?): New.
(env=, 2env=, max-u, max-n): New helpers.

* fth/t_corex.fth: Add basic tests for ENVIRONMENT?.

7 years agoMerge pull request #22 from ellerh/implement-included
Phil Burk [Sat, 24 Dec 2016 02:08:00 +0000 (18:08 -0800)]
Merge pull request #22 from ellerh/implement-included

Implement standard word INCLUDED

7 years agoMerge pull request #23 from ellerh/forth2012-number-syntax
Phil Burk [Fri, 23 Dec 2016 19:26:36 +0000 (11:26 -0800)]
Merge pull request #23 from ellerh/forth2012-number-syntax

Recognize Forth 2012 number syntax

7 years agoUse C version of LWORD in INTERPRET
Helmut Eller [Wed, 21 Dec 2016 19:45:50 +0000 (20:45 +0100)]
Use C version of LWORD in INTERPRET

* csrc/pf_words.c (ffLWord): New.
(Word): Factored out from ffWord.
(ffWord): Call Word.

* csrc/pfcompil.c (ffInterpret): Use ffLWord instead of ffWord to
preserve case for NUMBER?.  Can't use ffWord because that would
convert a character written as "'a'" to "'A'".

* csrc/pfcompil.h (ffLWord): Define prototype.

* fth/numberio.fth: Fix typso.

7 years agoRevert last commit.
Helmut Eller [Wed, 21 Dec 2016 19:26:42 +0000 (20:26 +0100)]
Revert last commit.

7 years agoDefine backward compatible version of WORD
Helmut Eller [Wed, 21 Dec 2016 10:14:31 +0000 (11:14 +0100)]
Define backward compatible version of WORD

* fth/system.fth (TOUPPER, UPCASE): New helpers.
(WORD, WORD-SAVE-AREA): New.

7 years agoRecognize Forth 2012 number syntax
Helmut Eller [Mon, 19 Dec 2016 20:45:50 +0000 (21:45 +0100)]
Recognize Forth 2012 number syntax

Forth 2012 adds more convenient syntax for numbers and characters.

* csrc/pf_words.c (ffWord): Don't upcase input.  Without this
change we can't support the '<char>' syntax.
(ffNumberQ): Recgonize new syntax.

* fth/numerio.fth (>number-with-base): New helper.
(((NUMBER?))): Recognize new syntax.

* fth/t_corex.fth: Add test for number prefixes, from Gerry Jackson's
Forth2012 test suite.

7 years agoMerge pull request #21 from ellerh/fix-+loop
Phil Burk [Mon, 19 Dec 2016 16:20:08 +0000 (08:20 -0800)]
Merge pull request #21 from ellerh/fix-+loop

Fix +loop on 64-bit machines

7 years agoImplememnt standard word INCLUDED
Helmut Eller [Sun, 18 Dec 2016 10:57:03 +0000 (11:57 +0100)]
Implememnt standard word INCLUDED

* fth/system.fth (INCLUDED): Rewrite existing $INCLUDE to use addr+len strings.
($INCLUDE): Call INCLUDED.
(INCLUDE.MARK.START): Also take addr+len string as argument.

7 years agoFix +loop on 64-bit machines
Helmut Eller [Sun, 18 Dec 2016 09:45:06 +0000 (10:45 +0100)]
Fix +loop on 64-bit machines

* csrc/pf_inner.c: Use idea from Gforth with signed arithmetic and
clever bit manipulation to avoid word size specific code.

* fth/t_corex.fth: +loop tests adopted from Gerry Jackson's Forth2012
test suite.

7 years agoMerge pull request #18 from ellerh/travis-script
Phil Burk [Sat, 17 Dec 2016 23:18:33 +0000 (15:18 -0800)]
Merge pull request #18 from ellerh/travis-script

Add Travis configuration file

7 years agoAdd Travis configuration file
Helmut Eller [Fri, 16 Dec 2016 21:10:25 +0000 (22:10 +0100)]
Add Travis configuration file

7 years agoMerge pull request #17 from ellerh/linux-crossbuild-amiga
Phil Burk [Fri, 16 Dec 2016 03:15:19 +0000 (19:15 -0800)]
Merge pull request #17 from ellerh/linux-crossbuild-amiga

Linux crossbuild Amiga

7 years agoAdd Makefile to cross-compile from Linux to Amiga
Helmut Eller [Mon, 12 Dec 2016 15:59:25 +0000 (16:59 +0100)]
Add Makefile to cross-compile from Linux to Amiga

This Makefile can be used to cross-compile pForth on a Linux host to
an Amiga target.  GCC is used as host-compiler and VBCC as
cross-compiler.

* build/linux-crossbuild-amiga/Makefile: New file.
* csrc/pf_io.c, csrc/pf_inner.c: Add some quirks to satisfy VBCC. In
particular fseek and ftell needed some help.

7 years agoInstead of hardcoding PF_SEEK_* constants use SEEK_* values from stdio.h.
Helmut Eller [Mon, 12 Dec 2016 15:39:17 +0000 (16:39 +0100)]
Instead of hardcoding PF_SEEK_* constants use SEEK_* values from stdio.h.

7 years agoUse static in definition too, not just in prototype declaration
Helmut Eller [Mon, 12 Dec 2016 15:36:59 +0000 (16:36 +0100)]
Use static in definition too, not just in prototype declaration

* csrc/pfcompil.c (ffUnSmudge, FindAndCompile): VBCC refuses to
compile this unless function with static prototypes also have use
static definitions.

7 years agoMerge pull request #16 from philburk/winattributes
Phil Burk [Mon, 30 May 2016 00:13:40 +0000 (17:13 -0700)]
Merge pull request #16 from philburk/winattributes

gitattributes: add EOL attributes for various file types

7 years agogitattributes: add EOL attributes for various file types
Phil Burk [Mon, 30 May 2016 00:10:45 +0000 (17:10 -0700)]
gitattributes: add EOL attributes for various file types

7 years agoMerge pull request #15 from philburk/round2
Phil Burk [Wed, 27 Apr 2016 16:16:17 +0000 (09:16 -0700)]
Merge pull request #15 from philburk/round2

Implement FROUND

7 years agoImplement FROUND
Phil Burk [Wed, 27 Apr 2016 16:14:49 +0000 (09:14 -0700)]
Implement FROUND

7 years agoMerge pull request #14 from philburk/fixwhite
Phil Burk [Wed, 27 Apr 2016 15:56:48 +0000 (08:56 -0700)]
Merge pull request #14 from philburk/fixwhite

Fix white spaces.

7 years agoFix white spaces.
Phil Burk [Wed, 27 Apr 2016 15:51:38 +0000 (08:51 -0700)]
Fix white spaces.

Convert tabs to spaces.
Remove trailing whitespaces.
Convert EOL to LF.
No real code changes.

8 years agoMerge pull request #13 from philburk/fixrom
Phil Burk [Sun, 27 Dec 2015 07:33:39 +0000 (23:33 -0800)]
Merge pull request #13 from philburk/fixrom

Fix $ROM

8 years agoFix $ROM
Phil Burk [Sun, 27 Dec 2015 07:31:41 +0000 (23:31 -0800)]
Fix $ROM

Was using DO instead of ?DO
so it failed on index 0.

8 years agoMerge pull request #10 from philburk/fix-history
Phil Burk [Sat, 25 Jul 2015 01:02:21 +0000 (18:02 -0700)]
Merge pull request #10 from philburk/fix-history

Fix auto.term in history

8 years agoFix auto.term in history
Phil Burk [Sat, 25 Jul 2015 00:50:12 +0000 (17:50 -0700)]
Fix auto.term in history

It was calling auto.init by mistake.

Signed-off-by: Phil Burk <philburk@mobileer.com>
8 years agoMerge pull request #9 from philburk/fix-makefile
Phil Burk [Sat, 25 Jul 2015 00:58:19 +0000 (17:58 -0700)]
Merge pull request #9 from philburk/fix-makefile

Fix Makefile for Mac clang

8 years agoFix Makefile for Mac clang
Phil Burk [Sat, 25 Jul 2015 00:51:31 +0000 (17:51 -0700)]
Fix Makefile for Mac clang

Signed-off-by: Phil Burk <philburk@mobileer.com>
8 years agoMerge pull request #7 from letoh/fix-linux-build
Phil Burk [Wed, 15 Jul 2015 15:11:51 +0000 (08:11 -0700)]
Merge pull request #7 from letoh/fix-linux-build

Better Linux support

8 years agouse _GNU_SOURCE instead of _DEFAULT_SOURCE for older glibc
letoh [Wed, 15 Jul 2015 05:07:17 +0000 (13:07 +0800)]
use _GNU_SOURCE instead of _DEFAULT_SOURCE for older glibc

9 years agoMerge pull request #4 from vuokko/master
Phil Burk [Sat, 21 Feb 2015 02:48:59 +0000 (18:48 -0800)]
Merge pull request #4 from vuokko/master

Build fix and crossbuild example

9 years agoSample crossbuild makefile
Hannu Vuolasaho [Sat, 21 Feb 2015 01:44:05 +0000 (03:44 +0200)]
Sample crossbuild makefile

Crossbuild Makefile for building win32 without floating point support

9 years agoMakefile fix for Linux compilation
Hannu Vuolasaho [Sat, 21 Feb 2015 00:37:25 +0000 (02:37 +0200)]
Makefile fix for Linux compilation

Simple fix to compile with GCC 4.9.2 on Arch Linux

9 years agoMerge pull request #3 from avysk/fix-sign
Phil Burk [Sat, 31 Jan 2015 02:47:19 +0000 (18:47 -0800)]
Merge pull request #3 from avysk/fix-sign

allow Read32FromFile to return signed value

9 years agoallow Read32FromFile to return signed value
Alexey Vyskubov [Fri, 30 Jan 2015 22:33:09 +0000 (00:33 +0200)]
allow Read32FromFile to return signed value

9 years agoMerge pull request #1 from philburk/fix-readme
Phil Burk [Wed, 24 Dec 2014 02:21:27 +0000 (18:21 -0800)]
Merge pull request #1 from philburk/fix-readme

Fix readme

9 years ago[readme] Updated readme.txt to reflect new home on GitHub
Phil Burk [Wed, 24 Dec 2014 02:08:15 +0000 (18:08 -0800)]
[readme] Updated readme.txt to reflect new home on GitHub

Signed-off-by: Phil Burk <philburk@mobileer.com>
9 years ago[readme] Updated readme.txt to reflect new home on GitHub
Phil Burk [Wed, 24 Dec 2014 02:08:15 +0000 (18:08 -0800)]
[readme] Updated readme.txt to reflect new home on GitHub

Signed-off-by: Phil Burk <philburk@mobileer.com>
10 years agoFix floating point conversion and printing.
burkphil [Tue, 13 Aug 2013 15:41:07 +0000 (15:41 +0000)]
Fix floating point conversion and printing.

D>F and F>D were broken for 64-bit versions of Forth.
A fix was proposed by Denis Bernard. Thanks Denis.

11 years agoRemove trailing white space.
burkphil [Sat, 23 Mar 2013 05:53:29 +0000 (05:53 +0000)]
Remove trailing white space.
Fix link in readme.txt

11 years agoSuppress CR in quiet mode, patch by Derek Fawcus.
burkphil [Fri, 8 Jun 2012 17:50:20 +0000 (17:50 +0000)]
Suppress CR in quiet mode, patch by Derek Fawcus.
Delete extra trace.fth file.
Fix some comments in t_floats.fth.

12 years agoChange throw code for abort quote from -1 to -2.
burkphil [Tue, 6 Dec 2011 18:57:15 +0000 (18:57 +0000)]
Change throw code for abort quote from -1 to -2.

13 years agoFrom Aleksej,
burkphil [Tue, 30 Nov 2010 03:14:21 +0000 (03:14 +0000)]
From Aleksej,

Separate building of binary dictionary image
and C source (inlined) dictionary image.

Make CPPFLAGS, CFLAGS, LDFLAGS semantics more traditional.
XCPPFLAGS, XCFLAGS, XLDFLAGS contain "extension" flags now,
resetting them to empty values effects in building of bare pForth
without FPN support, optimisations and other features.

Declare phony (non-material) targets as suggested by standards.

Use parameters where names were hardcoded.

13 years agoAdd MINGW suport.
burkphil [Tue, 23 Nov 2010 19:26:21 +0000 (19:26 +0000)]
Add MINGW suport.
Change 32 to BL.

13 years agoremove scribbled text from unit test
burkphil [Sun, 21 Nov 2010 22:21:54 +0000 (22:21 +0000)]
remove scribbled text from unit test

13 years agoAdd support for WATCOMC
burkphil [Sun, 21 Nov 2010 19:11:30 +0000 (19:11 +0000)]
Add support for WATCOMC
Add size checks for C to Forth string conversion

13 years agoImprove Makefile to make it more standard and so that
phil@softsynth.com [Fri, 27 Aug 2010 17:50:07 +0000 (17:50 +0000)]
Improve Makefile to make it more standard and so that
everything is built in current directory (where make tool is invoked),
it relies only on one feature not guaranteed by POSIX/SUS, VPATH
(present in BSD and GNU Make), and it provides conventional variables to
provide compiler (CC), compiler flags (CFLAGS), preprocessor flags (CPPFLAGS),
linker flags (LDFLAGS), and additional libraries and objects to link to (LDADD).

Thanks to Aleksej for this mod.

13 years agoFix inconsistent line endings. Thanks Aleksej.
phil@softsynth.com [Thu, 26 Aug 2010 22:02:31 +0000 (22:02 +0000)]
Fix inconsistent line endings. Thanks Aleksej.

13 years agoFixed lots of warning and made code compatible with C89 and ANSI with -pedantic.
phil@softsynth.com [Thu, 26 Aug 2010 02:07:37 +0000 (02:07 +0000)]
Fixed lots of warning and made code compatible with C89 and ANSI with -pedantic.
Use fseek and ftell on WIN32 instead of fseeko and ftello.

13 years agoFix REPOSITION-FILE, HISTORY, locked file handle and other problems.
phil@softsynth.com [Mon, 23 Aug 2010 21:32:46 +0000 (21:32 +0000)]
Fix REPOSITION-FILE, HISTORY, locked file handle and other problems.

13 years agoFix FILE-POSITION REPOSITION-FILE and FILE-SIZE. Now use double precision offsets.
phil@softsynth.com [Sun, 1 Aug 2010 21:41:34 +0000 (21:41 +0000)]
Fix FILE-POSITION REPOSITION-FILE and FILE-SIZE. Now use double precision offsets.

13 years agoAdd support for DELETE-FILE from Aleksej.
phil@softsynth.com [Sun, 1 Aug 2010 20:38:49 +0000 (20:38 +0000)]
Add support for DELETE-FILE from Aleksej.

13 years agoAdd patch from Aleksej for 64 bit cells on 32 bit system.
phil@softsynth.com [Mon, 5 Jul 2010 22:52:35 +0000 (22:52 +0000)]
Add patch from Aleksej for 64 bit cells on 32 bit system.

13 years agofixes for M* and UM* from Aleksej
phil@softsynth.com [Thu, 20 May 2010 18:33:14 +0000 (18:33 +0000)]
fixes for M* and UM* from Aleksej

13 years agoV25 with 64-bit support
phil@softsynth.com [Thu, 20 May 2010 00:15:20 +0000 (00:15 +0000)]
V25 with 64-bit support

14 years agoAdd -m32 and -x c to Makefile for 64-bit Snow Leopard.
phil@softsynth.com [Thu, 8 Oct 2009 20:36:22 +0000 (20:36 +0000)]
Add -m32 and   -x c  to Makefile for 64-bit Snow Leopard.

15 years agoFix build of posix io on sun.
phil@softsynth.com [Tue, 17 Mar 2009 22:40:47 +0000 (22:40 +0000)]
Fix build of posix io on sun.

15 years agoFix Saushev spelling, allow space after -d, restore tty mode after dic loading error.
phil@softsynth.com [Mon, 16 Mar 2009 01:42:33 +0000 (01:42 +0000)]
Fix Saushev spelling, allow space after -d, restore tty mode after dic loading error.

15 years agoFixed POSIX IO, (ACCEPT) now emits SPACE at end of line.
phil@softsynth.com [Fri, 20 Feb 2009 18:38:25 +0000 (18:38 +0000)]
Fixed POSIX IO, (ACCEPT) now emits SPACE at end of line.

15 years agoFix cell increment error in RESIZE
phil@softsynth.com [Wed, 18 Feb 2009 17:59:02 +0000 (17:59 +0000)]
Fix cell increment error in RESIZE

15 years agoDocumented change to Makefile.
phil@softsynth.com [Mon, 4 Aug 2008 17:41:23 +0000 (17:41 +0000)]
Documented change to Makefile.

15 years agoRemoved -v from second mkdir.
phil@softsynth.com [Mon, 4 Aug 2008 17:36:41 +0000 (17:36 +0000)]
Removed -v from second mkdir.

15 years agoRemove -v option from mkdir for compatibility with FreeBSD.
phil@softsynth.com [Mon, 4 Aug 2008 17:35:25 +0000 (17:35 +0000)]
Remove -v option from mkdir for compatibility with FreeBSD.

15 years agoRemove debug statement.
phil@softsynth.com [Mon, 21 Jul 2008 22:26:04 +0000 (22:26 +0000)]
Remove debug statement.

15 years agoRemove stale pfdicdat.h
phil@softsynth.com [Mon, 21 Jul 2008 21:04:50 +0000 (21:04 +0000)]
Remove stale pfdicdat.h

15 years agoUpdated Makefile for Mac OS X
phil@softsynth.com [Mon, 21 Jul 2008 20:56:40 +0000 (20:56 +0000)]
Updated Makefile for Mac OS X

15 years agoFix create-file for Mac OS X so that SDAD will work. The r/w fam now maps to "w+...
phil@softsynth.com [Mon, 21 Jul 2008 20:50:31 +0000 (20:50 +0000)]
Fix create-file for Mac OS X so that SDAD will work. The r/w fam now maps to "w+" mode.

15 years agoInitial import.
phil@softsynth.com [Mon, 21 Jul 2008 02:58:11 +0000 (02:58 +0000)]
Initial import.