--- gforth/cross.fs 1995/11/07 18:06:35 1.30 +++ gforth/cross.fs 1996/07/16 20:57:07 1.37 @@ -357,11 +357,11 @@ variable ResolveFlag VARIABLE ^imm >TARGET -: immediate 20 flag! +: immediate 40 flag! ^imm @ @ dup = IF drop EXIT THEN <> ABORT" CROSS: Cannot immediate a unresolved word" ^imm @ ! ; -: restrict 40 flag! ; +: restrict 20 flag! ; >CROSS \ ALIAS2 ansforth conform alias 9may93jaw @@ -405,7 +405,7 @@ Variable to-doc \ 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 Create tag-beg 2 c, 7F c, bl c, @@ -418,7 +418,7 @@ Create tag-bof 1 c, 0C c, loadfilename 2@ last-loadfilename 2@ d<> IF tag-bof count tag-file-id write-line throw - loadfilename 2@ 2dup + sourcefilename 2dup tag-file-id write-file throw last-loadfilename 2! s" ,0" tag-file-id write-line throw @@ -432,7 +432,7 @@ Create tag-bof 1 c, 0C c, tag-beg count tag-file-id write-file throw tlast @ >image count $1F and tag-file-id write-file throw tag-end count tag-file-id write-file throw - base @ decimal loadline @ 0 <# #s #> tag-file-id write-file throw + base @ decimal sourceline# 0 <# #s #> tag-file-id write-file throw \ >in @ 0 <# #s [char] , hold #> tag-file-id write-line throw s" ,0" tag-file-id write-line throw base ! @@ -569,6 +569,9 @@ Cond: [Char] ( "" -- ) restrict (THeader ;Resolve ! there ;Resolve cell+ ! docol, depth T ] H ; +: :noname ( -- colon-sys ) + T align H there docol, depth T ] H ; + Cond: EXIT ( -- ) restrict? compile ;S ;Cond Cond: ?EXIT ( -- ) 1 abort" CROSS: using ?exit" ;Cond @@ -694,11 +697,19 @@ Build: T 0 , H ; by Constant Builder Value +Build: T 0 A, H ; +by Constant +Builder AValue + Build: ( -- ) compile noop ; DO: ( ghost -- ) ABORT" CROSS: Don't execute" ;DO Builder Defer by Defer :dodefer resolve +Build: ( inter comp -- ) swap T immediate A, A, H ; +DO: ( ghost -- ) ABORT" CROSS: Don't execute" ;DO +Builder special: + \ Sturctures 23feb95py >CROSS @@ -873,13 +884,22 @@ Cond: [ELSE] [ELSE] ;Cond 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" -- ) - bl parse ." Saving to " 2dup type +: save-cross ( "image-name" "binary-name" -- ) + bl parse ." Saving to " 2dup type cr 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 image @ there r@ write-file throw \ write image bit$ @ there 1- cell>bit rshift 1+