| cell% field wordlist-extend \ wordlist extensions (eg bucket offset) |
cell% field wordlist-extend \ wordlist extensions (eg bucket offset) |
| end-struct wordlist-struct |
end-struct wordlist-struct |
| |
|
| |
has? f83headerstring [IF] |
| |
: f83find ( addr len wordlist -- nt / false ) |
| |
wordlist-id @ (f83find) ; |
| |
[ELSE] |
| : f83find ( addr len wordlist -- nt / false ) |
: f83find ( addr len wordlist -- nt / false ) |
| wordlist-id @ (listlfind) ; |
wordlist-id @ (listlfind) ; |
| |
[THEN] |
| |
|
| : initvoc ( wid -- ) |
: initvoc ( wid -- ) |
| dup wordlist-map @ hash-method perform ; |
dup wordlist-map @ hash-method perform ; |
| \ The constants are defined as 32 bits, but then erased |
\ The constants are defined as 32 bits, but then erased |
| \ and overwritten by the right ones |
\ and overwritten by the right ones |
| |
|
| |
has? f83headerstring [IF] |
| |
\ to save space, Gforth EC limits words to 31 characters |
| |
$80 constant alias-mask |
| |
$40 constant immediate-mask |
| |
$20 constant restrict-mask |
| |
$1f constant lcount-mask |
| |
[ELSE] |
| $80000000 constant alias-mask |
$80000000 constant alias-mask |
| 1 bits/char 1 - lshift |
1 bits/char 1 - lshift |
| -1 cells allot bigendian [IF] c, 0 1 cells 1- times |
-1 cells allot bigendian [IF] c, 0 1 cells 1- times |
| 1 bits/char 3 - lshift 1 - |
1 bits/char 3 - lshift 1 - |
| -1 cells allot bigendian [IF] c, -1 1 cells 1- times |
-1 cells allot bigendian [IF] c, -1 1 cells 1- times |
| [ELSE] -1 1 cells 1- times c, [THEN] |
[ELSE] -1 1 cells 1- times c, [THEN] |
| |
[THEN] |
| |
|
| \ higher level parts of find |
\ higher level parts of find |
| |
|
| (cfa>int) |
(cfa>int) |
| then ; |
then ; |
| |
|
| |
has? f83headerstring [IF] |
| |
: name>string ( nt -- addr count ) \ gforth head-to-string |
| |
\g @i{addr count} is the name of the word represented by @i{nt}. |
| |
cell+ count lcount-mask and ; |
| |
|
| |
: ((name>)) ( nfa -- cfa ) |
| |
name>string + cfaligned ; |
| |
|
| |
: (name>x) ( nfa -- cfa w ) |
| |
\ cfa is an intermediate cfa and w is the flags cell of nfa |
| |
dup ((name>)) |
| |
swap cell+ c@ dup alias-mask and 0= |
| |
IF |
| |
swap @ swap |
| |
THEN ; |
| |
[ELSE] |
| : name>string ( nt -- addr count ) \ gforth head-to-string |
: name>string ( nt -- addr count ) \ gforth head-to-string |
| \g @i{addr count} is the name of the word represented by @i{nt}. |
\g @i{addr count} is the name of the word represented by @i{nt}. |
| cell+ dup cell+ swap @ lcount-mask and ; |
cell+ dup cell+ swap @ lcount-mask and ; |
| IF |
IF |
| swap @ swap |
swap @ swap |
| THEN ; |
THEN ; |
| |
[THEN] |
| |
|
| : name>int ( nt -- xt ) \ gforth |
: name>int ( nt -- xt ) \ gforth |
| \G @i{xt} represents the interpretation semantics of the word |
\G @i{xt} represents the interpretation semantics of the word |