freebsd-dev/sys/boot/ficl/softwords/marker.fr
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

26 lines
752 B
Forth

\ ** ficl/softwords/marker.fr
\ ** Ficl implementation of CORE EXT MARKER
\ John Sadler, 4 Oct 98
\ Requires ficl 2.02 FORGET-WID !!
: marker ( "name" -- )
create
get-current ,
get-order dup ,
0 ?do , loop
does>
0 set-order \ clear search order
dup body> >name drop
here - allot \ reset HERE to my xt-addr
dup @ ( pfa current-wid )
dup set-current forget-wid ( pfa )
cell+ dup @ swap ( count count-addr )
over cells + swap ( last-wid-addr count )
0 ?do
dup @ dup ( wid-addr wid wid )
>search forget-wid ( wid-addr )
cell-
loop
drop
;