| |
|
| : gfind ( string -- ghost true/1 / string false ) |
: gfind ( string -- ghost true/1 / string false ) |
| \ searches for string in word-list ghosts |
\ searches for string in word-list ghosts |
| \ !! wouldn't it be simpler to just use search-wordlist ? ae |
|
| dup count [ ' ghosts >body ] ALiteral search-wordlist |
dup count [ ' ghosts >body ] ALiteral search-wordlist |
| dup IF >r >body nip r> THEN ; |
dup IF >r >body nip r> THEN ; |
| |
|
| VARIABLE ^imm |
VARIABLE ^imm |
| |
|
| >TARGET |
>TARGET |
| : immediate 20 flag! |
: immediate 40 flag! |
| ^imm @ @ dup <imm> = IF drop EXIT THEN |
^imm @ @ dup <imm> = IF drop EXIT THEN |
| <res> <> ABORT" CROSS: Cannot immediate a unresolved word" |
<res> <> ABORT" CROSS: Cannot immediate a unresolved word" |
| <imm> ^imm @ ! ; |
<imm> ^imm @ ! ; |
| : restrict 40 flag! ; |
: restrict 20 flag! ; |
| >CROSS |
>CROSS |
| |
|
| \ ALIAS2 ansforth conform alias 9may93jaw |
\ ALIAS2 ansforth conform alias 9may93jaw |
| |
|
| \ Target TAGS creation |
\ Target TAGS creation |
| |
|
| s" TAGS" r/w create-file throw value tag-file-id |
s" kernal.TAGS" r/w create-file throw value tag-file-id |
| \ contains the file-id of the tags file |
\ contains the file-id of the tags file |
| |
|
| Create tag-beg 2 c, 7F c, bl c, |
Create tag-beg 2 c, 7F c, bl c, |
| (THeader ;Resolve ! there ;Resolve cell+ ! |
(THeader ;Resolve ! there ;Resolve cell+ ! |
| docol, depth T ] H ; |
docol, depth T ] H ; |
| |
|
| |
: :noname ( -- colon-sys ) |
| |
T align H there docol, depth T ] H ; |
| |
|
| Cond: EXIT ( -- ) restrict? compile ;S ;Cond |
Cond: EXIT ( -- ) restrict? compile ;S ;Cond |
| |
|
| Cond: ?EXIT ( -- ) 1 abort" CROSS: using ?exit" ;Cond |
Cond: ?EXIT ( -- ) 1 abort" CROSS: using ?exit" ;Cond |
| Builder Defer |
Builder Defer |
| by Defer :dodefer resolve |
by Defer :dodefer resolve |
| |
|
| |
Build: ( inter comp -- ) swap T immediate A, A, H ; |
| |
DO: ( ghost -- ) ABORT" CROSS: Don't execute" ;DO |
| |
Builder interpret/compile: |
| |
|
| \ Sturctures 23feb95py |
\ Sturctures 23feb95py |
| |
|
| >CROSS |
>CROSS |
| |
|
| bigendian Constant bigendian |
bigendian Constant bigendian |
| |
|
| Create magic s" gforth00" here over allot swap move |
Create magic s" Gforth10" here over allot swap move |
| |
|
| [char] 1 bigendian + cell + magic 7 + c! |
char 1 bigendian + cell + magic 7 + c! |
| |
|
| : save-cross ( "name" -- ) |
: save-cross ( "image-name" "binary-name" -- ) |
| bl parse ." Saving to " 2dup type |
bl parse ." Saving to " 2dup type cr |
| w/o bin create-file throw >r |
w/o bin create-file throw >r |
| |
s" #! " r@ write-file throw |
| |
bl parse r@ write-file throw |
| |
s" -i" r@ write-file throw |
| |
#lf r@ emit-file throw |
| |
r@ dup file-position throw drop 8 mod 8 swap ( file-id limit index ) |
| |
?do |
| |
bl over emit-file throw |
| |
loop |
| |
drop |
| magic 8 r@ write-file throw \ write magic |
magic 8 r@ write-file throw \ write magic |
| image @ there r@ write-file throw \ write image |
image @ there r@ write-file throw \ write image |
| bit$ @ there 1- cell>bit rshift 1+ |
bit$ @ there 1- cell>bit rshift 1+ |