Commit Graph

39 Commits

Author SHA1 Message Date
Jens Schweikhardt
d64ada501a Fix typos, mostly s/ an / a / where appropriate and a few s/an/and/
Add FreeBSD Id tag where missing.
2002-12-30 21:18:15 +00:00
Scott Long
f1757c6ee7 Make ficl work on sparc64. The assumption that int == long == void * is
very pervasive in this code.  This fixes a few of those assumptions and
band-aids over some others.

Tested on: ia32 alpha sparc64

Reviewed by:	peter jake (in concept)
2002-08-31 01:04:53 +00:00
Daniel C. Sobral
be88b71603 Upgrade to FICL version 3.02. Anything wrong is my fault, everything right is
due Jon Mini.

PR:		36308
Submitted by:	Jon Mini <mini@haikugeek.com>
MFC after:	4 weeks
2002-04-09 17:45:28 +00:00
Doug Rabson
1a4f097e7a Avoid an alignment fault on 64bit architectures.
Reviewed by: dcs
2001-09-04 13:13:12 +00:00
Daniel C. Sobral
66bd171e5f As in with ":", check dictionary space and increase it if necessary before
"create".
2001-05-27 16:30:10 +00:00
Daniel C. Sobral
ec10295143 FICL 2.05 has a flawed definition of BASE. Fix it.
Spotted by: Peter Jeremy <peter.jeremy@alcatel.com.au>
2001-05-10 05:13:09 +00:00
Daniel C. Sobral
49acc8fe50 Bring in ficl 2.05.
This version has a step debugger, which now completely replaces the
old trace feature. Also, we moved all of the FreeBSD-specific MI
code to loader.c, reducing the diff between this and the official
FICL distribution.
2001-04-29 02:36:36 +00:00
Doug Rabson
4eedebf31f Only build PnP parts if the platform supports PnP. 2000-09-10 12:15:30 +00:00
Daniel C. Sobral
f5da975f8f Add the infrastructure necessary to handle PnP from a Forth script.
Also, export the file_findfile() function. Again, this is taken from
work in progress but frozen for the time being. Since it works, I'd
rather commit and remove any uglyness later than hide it on my tree.
2000-09-08 17:03:53 +00:00
Daniel C. Sobral
70e1899762 Fix REFILL. It must throw RESTART instead of OUTOFTEXT so that
execution can take place at the point where it stopped after the
input buffer has been refilled.

Add ANS Forth CORE EXT and FILE word SOURCE-ID.
2000-06-12 16:46:28 +00:00
Daniel C. Sobral
f0b972df2f Add setenv, getenv, setenv?, unsetenv, copyin and copyout to FICL. 2000-06-07 22:07:01 +00:00
Daniel C. Sobral
11b96475f7 Apply a number of fixes for the Alpha platform. 2000-06-02 20:07:56 +00:00
Daniel C. Sobral
b270590aeb Add "int" sized manipulation words. 2000-06-01 18:10:44 +00:00
Daniel C. Sobral
7795d19132 Bring in FICL 2.04. No bump of loader version is required by this
commit.
2000-05-26 21:35:08 +00:00
Daniel C. Sobral
ff7e939c43 Lay the groundwork for on-demand dictionary expansion. 2000-05-05 02:06:38 +00:00
Daniel C. Sobral
1ca3a0ce6a Add heap?, so we can tell how much free space we have left. 2000-05-04 20:41:30 +00:00
Daniel C. Sobral
99915e5b91 (Hopefully) make all necessary changes for ficl to support alpha. 1999-11-23 11:17:37 +00:00
Daniel C. Sobral
de271252c9 Bring in ficl version 2.03. No version bump for loader. 1999-09-29 04:43:16 +00:00
Jordan K. Hubbard
73899d2e48 Remove dictHashSummary internal function; it used doubles.
Submitted by:		Daniel C. Sobral <dcs@newsguy.com>
1999-02-09 16:04:19 +00:00
Daniel C. Sobral
7505875a0a The previous fix for "type" was absolutely lousy. Not only the buffer
allocated was not big enough, but it ended up to being used where it
was supposed to be used. The person who did that ought to be shot, but
since I'm a good person, I'll forgive myself...

PR:		bin/9743
1999-02-04 13:06:47 +00:00
Mike Smith
e9583ef187 From the PR:
I added a FICL_TRACE-conditioned trace facility based on "see".
It is ugly because words' functions are almost all static, and ficlExec,
where the trace has to be located, can't get their pointers. So, #ifdef
this staticization, and add most of see's body into ficlExec. Duplication
of code, uglyness, etc. But it is cleanly #ifdef'ed, and works like a
charm.

	It does not provide "step" facility, though, just trace. It is
tunable at run-time through "trace!". If anyone (most likely me :) ever
wants a step facility, I'll add it. Should be easy.

PR:		bin/9652
Submitted by:	"Daniel C. Sobral" <dcs@newsguy.com>
1999-01-24 06:06:21 +00:00
Mike Smith
f7f7a5d7ab From the PR:
FICL's TYPE copies the counted string to HERE, as abial has
remarked. Answering to abial's question, this is NOT garanteed to have
enough space.
...
	We have dynamic memory. Even before memory-alloc got in, we
already had dynamic memory. Use it, then! (ficlMalloc is sysdep, so I
suppose that's why it was not used for TYPE; ficl is probably designed
to work without a working ficlFree).

Submitted by:	"Daniel C. Sobral" <dcs@newsguy.com>
1999-01-24 05:58:18 +00:00
Mike Smith
6a80a16d7d Add EXCEPTION word set.
Make TIB handling use buffer size to conform with ANS Forth.

Add ANS MEMORY-ALLOC word set.

See the PRs for extensive details.

PR:		kern/9412 kern/9442 kern/9514
Submitted by:	PRs from Daniel Sobral <dcs@newsguy.com>
1999-01-22 23:52:59 +00:00
Andrzej Bialecki
1b855e4412 Change counter-intuitive pc@ and pc! to inb and outb.
Submitted by:	jkh
1999-01-14 23:48:03 +00:00
Andrzej Bialecki
c82de3cb3f Add words "pc!" and "pc@" which allow to manipulate I/O ports. This can
be helpful when directly fiddling with PC hardware.

Also, define "arch-i386" appropriately, as suggested by Daniel C. Sobral.
1999-01-13 21:31:50 +00:00
Andrzej Bialecki
8f1e6e6e22 Add support for some FACILITY words:
key? ( -- flag)  \ check to see if there's a key to be read from input
ms   ( u -- )    \ wait that many milliseconds
seconds ( -- u ) \ get number of seconds from midnight.

'words' now outputs the list page by page - this probably should go
through libstand's pager, but will have to wait for closer integration of
built-ins with Forth...

Submitted partially by:	W Gerald Hicks <wghicks@bellsouth.net>
1998-12-31 14:03:28 +00:00
Andrzej Bialecki
ac19ebdfbe Add new word ".#" which acts like "." but doesn't output a space separator.
I found it impossible to output parametrized strings like "\033[%d;%dH"
without building them first in pad area.
1998-12-22 11:46:27 +00:00
Jordan K. Hubbard
37869e957d o Add proper stack checking to all file words
o add fkey and fread
o eliminate fexists now that this can be expressed in HLL forth
  ( : fexists fopen dup -1 <> if fclose 1 else drop 0 then ; ) :-)

Once we get the ability to write files, it should be possible to do
stand-alone rescue work from the 3rd stage boot. :)
1998-11-07 17:38:40 +00:00
Jordan K. Hubbard
335edb957d Eliminate much code cruft by extending simple file I/O API to include
fopen and fclose.
1998-11-07 06:18:06 +00:00
Jordan K. Hubbard
65e7b066b3 OK, fload/fexec work properly when both compiling and interpreting
now.  Gack.
1998-11-07 01:56:06 +00:00
Jordan K. Hubbard
ebc4b7c4fb switch words to default mode. 1998-11-06 23:50:08 +00:00
Jordan K. Hubbard
f476d38a01 Make fexists/fload work with existing string literals instead. Doing
my own string literal handling is just too wonky.
1998-11-06 23:20:32 +00:00
Jordan K. Hubbard
c6c128e122 Argh, I had this right[er] before. More commits to follow. 1998-11-06 19:17:03 +00:00
Jordan K. Hubbard
11adc0d65e Use proper literal names. 1998-11-06 04:01:32 +00:00
Jordan K. Hubbard
82f35547c9 Remember a bit more of my forth and do:
o Add fexists word to check for the presence of a file
o make fexists and fload immediate words which DTRT both interpreted
  and compiled (doh!)
o add an init word which gets run at bootstrapping time to do extra
  post-coldload initialization (in the default implementation, we
  look for /boot/boot.4th and load it if found).
1998-11-05 08:39:43 +00:00
Jordan K. Hubbard
5eb1c6c169 1. rebuild all elements of testmain properly for safety.
2. add fload and key prims for doing simple file and terminal I/O, respectively
1998-11-05 07:27:55 +00:00
Mike Smith
4ce140ae69 Fix includes; we were still pulling in <stdlib.h> in some places.
Support building a standalone interpreter with 'make testmain', remove
win32 and egregious gets() in testmain.c
1998-11-04 03:42:16 +00:00
Mike Smith
cbb5c0dd58 Make this work in the libstand environment; don't use stdio/stdlib headers. 1998-11-04 00:29:33 +00:00
Mike Smith
780ebb4b00 Add the Ficl (Forth Inspired Command Language) interpreter. If all goes well,
this will allow us to manage bloat in the loader by using a bytecoded HLL
rather than lots of C code.  It also offers an opportunity for vendors
or others with special applications to significantly customise the boot
process without having to commit to a divergent code branch.

This early commit is to allow others to experiment with the most effective
mechanisms for integrating FICL with the loader as it currently stands.

Ficl is distributed with the following license conditions:

"Ficl is freeware.  Use it in any way that you like, with the understanding
 that the code is not supported."

All source files contain authorship attributions.

Obtained from:	John Sadler (john_sadler@alum.mit.edu)
1998-11-03 06:11:35 +00:00