\ ********************************************************************* \ * \ Filename: core.fth * \ Date: 10.2.2008 * \ FF Version: 3.3 * \ Copyright: Mikael Nordman * \ Author: Mikael Nordman * \ ********************************************************************* \ FlashForth is licensed acording to the GNU General Public License* \ ********************************************************************* \ Some extra core words -core marker -core hex ram \ Interpret a string. The string must be in ram : evaluate ( caddr n -- ) 'source 2@ >r >r >in @ >r interpret r> >in ! r> r> 'source 2! ; \ Dump can left out from the core and compiled from here : dump ( addr +n -- ) $10 u/ for cr dup 4 u.r [char] : emit \ display row address $10 for \ display bytes c@+ 2 u.r next $10 - $10 for \ display ASCII c@+ dup bl $7f within 0= if drop [char] . then emit next next drop cr ; : forget ( --- name ) bl word latest @ (f) 0= ?abort? cfa>nfa nfa>lfa dup @ 0= ?abort? dup flash dp ! @ latest ! ; : fill ( addr n c -- ) \ fill addr to addr+n with c rot !p>r swap for dup pc! p+ next r>p drop ; : erase ( addr n -- ) 0 fill ; : blanks ( addr n -- ) bl fill ; : ?dup ( x -- 0 | x x ) dup if dup then ; : pick ( xu ... x0 u -- xu ... x0 xu) 2* 3 + sp@ swap - @ ;