Diff for /gforth/cross.fs between versions 1.36 and 1.52

version 1.36, 1996/05/13 16:36:55 version 1.52, 1997/08/31 19:31:28
Line 37 Line 37
 \             targets                         09jun93jaw  \             targets                         09jun93jaw
 \       added: 2user and value                11jun93jaw  \       added: 2user and value                11jun93jaw
   
 \ include other.fs       \ ansforth extentions for cross  \       needed? works better now!!!             01mar97jaw
   \       mach file is only loaded into target
   \       cell corrected
   \       romable extansions                      27apr97-5jun97jaw
   
 : string, ( c-addr u -- )  
     \ puts down string as cstring  
     dup c, here swap chars dup allot move ;  
 ' falign Alias cfalign  
 : comment? ( c-addr u -- c-addr u )  
         2dup s" (" compare 0=  
         IF    postpone (  
         ELSE  2dup s" \" compare 0= IF postpone \ THEN  
         THEN ;  
   
 decimal  hex     \ the defualt base for the cross-compiler is hex !!
   Warnings off
   
 \ Begin CROSS COMPILER:  \ words that are generaly useful
   
 \ GhostNames                                            9may93jaw  : >wordlist ( vocabulary-xt -- wordlist-struct )
 \ second name source to search trough list    also execute get-order swap >r 1- set-order r> ;
   
 VARIABLE GhostNames  : umax 2dup u< IF swap THEN drop ;
 0 GhostNames !  : umin 2dup u> IF swap THEN drop ;
 : GhostName ( -- addr )  
     here GhostNames @ , GhostNames ! here 0 ,  
     bl word count  
     \ 2dup type space  
     string, cfalign ;  
   
 hex  : string, ( c-addr u -- )
       \ puts down string as cstring
       dup c, here swap chars dup allot move ;
   
   : SetValue ( n -- <name> )
   \G Same behaviour as "Value" when the <name> is not defined
   \G Same behaviour as "to" when <name> is defined
   \G SetValue searches in the current vocabulary
    save-input bl word >r restore-input throw r> count
    get-current search-wordlist
    IF bl word drop >body ! ELSE Value THEN ;
   
   : DefaultValue ( n -- <name> )
   \G Same behaviour as "Value" when the <name> is not defined
   \G SetValue searches in the current vocabulary
    save-input bl word >r restore-input throw r> count
    get-current search-wordlist
    IF bl word drop drop drop ELSE Value THEN ;
   
   hex
   
 Vocabulary Cross  Vocabulary Cross
 Vocabulary Target  Vocabulary Target
Line 91  H Line 99  H
   
 >CROSS  >CROSS
   
 \ Variables                                            06oct92py  \ 1 Constant Cross-Flag \ to check whether assembler compiler plug-ins are
                           \ for cross-compiling
   \ No! we use "[IFUNDEF]" there to find out whether we are target compiling!!!
   
 -1 Constant NIL  : comment? ( c-addr u -- c-addr u )
 Variable image          2dup s" (" compare 0=
 Variable tlast    NIL tlast !  \ Last name field          IF    postpone (
 Variable tlastcfa \ Last code field          ELSE  2dup s" \" compare 0= IF postpone \ THEN
 Variable tdoes    \ Resolve does> calls          THEN ;
 Variable bit$  
 Variable tdp  \ Begin CROSS COMPILER:
 : there  tdp @ ;  
   
   
   \ \ --------------------        Error Handling                  05aug97jaw
   
   \ Flags
   
   also forth definitions  \ these values may be predefined before
                           \ the cross-compiler is loaded
   
   false DefaultValue stack-warn            \ check on empty stack at any definition
   false DefaultValue create-forward-warn   \ warn on forward declaration of created words
   
   [IFUNDEF] DebugMaskSrouce Variable DebugMaskSource 0 DebugMaskSource ! [THEN]
   [IFUNDEF] DebugMaskCross  Variable DebugMaskCross  0 DebugMaskCross  ! [THEN]
   
   previous >CROSS
   
   : .sourcepos
     cr sourcefilename type ." :"
     base @ decimal sourceline# . base ! ;
   
   : warnhead
   \G display error-message head
   \G perhaps with linenumber and filename
     .sourcepos ." Warning: " ;
   
   : empty? depth IF .sourcepos ." Stack not empty!"  THEN ;
   
   stack-warn [IF]
   : defempty? empty? ;
   [ELSE]
   : defempty? ; immediate
   [THEN]
   
   
   \ \ GhostNames Ghosts                                  9may93jaw
   
   \ second name source to search trough list
   
   VARIABLE GhostNames
   0 GhostNames !
   
   : GhostName ( -- addr )
       here GhostNames @ , GhostNames ! here 0 ,
       bl word count
       \ 2dup type space
       string, \ !! cfalign ?
       align ;
   
   \ Ghost Builder                                        06oct92py
   
   \ <T T> new version with temp variable                 10may93jaw
   
   VARIABLE VocTemp
   
   : <T  get-current VocTemp ! also Ghosts definitions ;
   : T>  previous VocTemp @ set-current ;
   
   hex
   4711 Constant <fwd>             4712 Constant <res>
   4713 Constant <imm>             4714 Constant <do:>
   
   \ iForth makes only immediate directly after create
   \ make atonce trick! ?
   
   Variable atonce atonce off
   
   : NoExec true ABORT" CROSS: Don't execute ghost" ;
   
   : GhostHeader <fwd> , 0 , ['] NoExec , ;
   
   : >magic ;              \ type of ghost
   : >link cell+ ;         \ pointer where ghost is in target, or if unresolved
                           \ points to the where we have to resolve (linked-list)
   : >exec cell+ cell+ ;   \ execution symantics (while target compiling) of ghost
   : >end 3 cells + ;      \ room for additional tags
                           \ for builder (create, variable...) words the
                           \ execution symantics of words built are placed here
   
   Variable executed-ghost \ last executed ghost, needed in tcreate and gdoes>
   Variable last-ghost     \ last ghost that is created
   Variable last-header-ghost \ last ghost definitions with header
   
   : Make-Ghost ( "name" -- ghost )
     >in @ GhostName swap >in !
     <T Create atonce @ IF immediate atonce off THEN
     here tuck swap ! ghostheader T>
     dup last-ghost !
     DOES> dup executed-ghost ! >exec @ execute ;
   
   \ ghost words                                          14oct92py
   \                                          changed:    10may93py/jaw
   
   : gfind   ( string -- ghost true/1 / string false )
   \ searches for string in word-list ghosts
     dup count [ ' ghosts >wordlist ] ALiteral search-wordlist
     dup IF >r >body nip r>  THEN ;
   
   : gdiscover ( xt -- ghost true | xt false )
     GhostNames
     BEGIN @ dup
     WHILE 2dup
           cell+ @ dup >magic @ <fwd> <>
           >r >link @ = r> and
           IF cell+ @ nip true EXIT THEN
     REPEAT
     drop false ;
   
   VARIABLE Already
   
   : ghost   ( "name" -- ghost )
     Already off
     >in @  bl word gfind   IF  Already on nip EXIT  THEN
     drop  >in !  Make-Ghost ;
   
   : >ghostname ( ghost -- adr len )
     GhostNames
     BEGIN @ dup
     WHILE 2dup cell+ @ =
     UNTIL nip 2 cells + count
     ELSE  2drop true abort" CROSS: Ghostnames inconsistent"
     THEN ;
   
   ' >ghostname ALIAS @name
   
   : forward? ( ghost -- flag )
     >magic @ <fwd> = ;
   
   \ Predefined ghosts                                    12dec92py
   
   ghost 0=                                        drop
   ghost branch    ghost ?branch                   2drop
   ghost (do)      ghost (?do)                     2drop
   ghost (for)                                     drop
   ghost (loop)    ghost (+loop)                   2drop
   ghost (next)                                    drop
   ghost unloop    ghost ;S                        2drop
   ghost lit       ghost (compile) ghost !         2drop drop
   ghost (does>)   ghost noop                      2drop
   ghost (.")      ghost (S")      ghost (ABORT")  2drop drop
   ghost '                                         drop
   ghost :docol    ghost :doesjump ghost :dodoes   2drop drop
   ghost over      ghost =         ghost drop      2drop drop
   ghost - drop
   
   \ \ Parameter for target systems                         06oct92py
   
 \ Parameter for target systems                         06oct92py  \ we define it ans like...
   wordlist Constant target-environment
   
 included  VARIABLE env-current \ save information of current dictionary to restore with environ>
   
 \ Create additional parameters                         19jan95py  : >ENVIRON get-current env-current ! target-environment set-current ;
   : ENVIRON> env-current @ set-current ; 
   
   >TARGET
   
   : environment?
     target-environment search-wordlist 
     IF execute true ELSE false THEN ;
   
   : e? name T environment? H 0= ABORT" environment variable not defined!" ;
   
   : has? name T environment? H IF ELSE false THEN ;
   
   : $has? T environment? H IF ELSE false THEN ;
   
   >ENVIRON
   true Value cross
   >TARGET
   
   mach-file count included hex
   
   >TARGET
   
   [IFUNDEF] has-interpreter true Value has-interpreter [THEN]
   [IFUNDEF] itc true Value itc [THEN]
   [IFUNDEF] has-rom false Value has-rom [THEN]
   
   >CROSS
   
   \ \ Create additional parameters                         19jan95py
   
 T  T
   NIL                Constant TNIL
 cell               Constant tcell  cell               Constant tcell
 cell<<             Constant tcell<<  cell<<             Constant tcell<<
 cell>bit           Constant tcell>bit  cell>bit           Constant tcell>bit
Line 117  float              Constant tfloat Line 304  float              Constant tfloat
 1 bits/byte lshift Constant maxbyte  1 bits/byte lshift Constant maxbyte
 H  H
   
   \ Variables                                            06oct92py
   
   Variable image
   Variable tlast    TNIL tlast !  \ Last name field
   Variable tlastcfa \ Last code field
   Variable tdoes    \ Resolve does> calls
   Variable bit$
   
   \ statistics                                            10jun97jaw
   
   Variable headers-named 0 headers-named !
   Variable user-vars 0 user-vars !
   
   \ Memory initialisation                                05dec92py
   
   [IFDEF] Memory \ Memory is a bigFORTH feature
      also Memory
      : initmem ( var len -- )
        2dup swap handle! >r @ r> erase ;
      toss
   [ELSE]
      : initmem ( var len -- )
        tuck allocate abort" CROSS: No memory for target"
        ( len var adr ) dup rot !
        ( len adr ) swap erase ;
   [THEN]
   
   \ MakeKernal                                           12dec92py
   
   : makekernel ( targetsize -- targetsize )
     bit$  over 1- tcell>bit rshift 1+ initmem
     image over initmem ;
   
   >MINIMAL
   : makekernel makekernel ;
   
   
   >CROSS
   
   \ memregion.fs
   
   
   Variable last-defined-region    \ pointer to last defined region
   Variable region-link            \ linked list with all regions
   Variable mirrored-link          \ linked list for mirrored regions
   0 dup mirrored-link ! region-link !
   
   
   : >rdp 2 cells + ;
   : >rlen cell+ ;
   : >rstart ;
   
   
   : region ( addr len -- )                \G create a new region
     \ check whether predefined region exists 
     save-input bl word find >r >r restore-input throw r> r> 0= 
     IF    \ make region
           drop
           save-input create restore-input throw
           here last-defined-region !
           over ( startaddr ) , ( length ) , ( dp ) ,
           region-link linked name string,
     ELSE  \ store new parameters in region
           bl word drop
           >body >r r@ last-defined-region !
           r@ cell+ ! dup r@ ! r> 2 cells + !
     THEN ;
   
   : borders ( region -- startaddr endaddr ) \G returns lower and upper region border
     dup @ swap cell+ @ over + ;
   
   : extent  ( region -- startaddr len )   \G returns the really used area
     dup @ swap 2 cells + @ over - ;
   
   : area ( region -- startaddr totallen ) \G returns the total area
     dup @ swap cell+ @ ;
   
   : mirrored                              \G mark a region as mirrored
     mirrored-link
     linked last-defined-region @ , ;
   
   : .addr
     base @ >r hex
     tcell 2 u>
     IF s>d <# # # # # '. hold # # # # #> type
     ELSE s>d <# # # # # # #> type
     THEN r> base ! ;
   
   : .regions                      \G display region statistic
   
     \ we want to list the regions in the right order
     \ so first collect all regions on stack
     0 region-link @
     BEGIN dup WHILE dup @ REPEAT drop
     BEGIN dup
     WHILE cr 3 cells - >r
           r@ 4 cells + count tuck type
           12 swap - 0 max spaces space
           ." Start: " r@ @ dup .addr space
           ." End: " r@ 1 cells + @ + .addr space
           ." DP: " r> 2 cells + @ .addr 
     REPEAT drop
     s" rom" $has? 0= ?EXIT
     cr ." Mirrored:"
     mirrored-link @
     BEGIN dup
     WHILE space dup cell+ @ 4 cells + count type @
     REPEAT drop cr
     ;
   
   \ -------- predefined regions
   
   0 0 region address-space
   \ total memory addressed and used by the target system
   
   0 0 region dictionary
   \ rom area for the compiler
   
   has? rom 
   [IF]
   0 0 region ram-dictionary mirrored
   \ ram area for the compiler
   [ELSE]
   ' dictionary ALIAS ram-dictionary
   [THEN]
   
   0 0 region return-stack
   
   0 0 region data-stack
   
   0 0 region tib-region
   
   ' dictionary ALIAS rom-dictionary
   
   
   : setup-target ( -- )   \G initialize targets memory space
     s" rom" $has?
     IF  \ check for ram and rom...
         address-space area nip
         ram-dictionary area nip
         rom-dictionary area nip
         and and 0=
         ABORT" CROSS: define address-space, rom- , ram-dictionary, with rom-support!"
     THEN
     address-space area nip
     IF
         address-space area
     ELSE
         dictionary area
     THEN
     dup 0=
     ABORT" CROSS: define at least address-space or dictionary!!"
     + makekernel drop ;
   
   \ switched tdp for rom support                          03jun97jaw
   
   \ second value is here to store some maximal value for statistics
   \ tempdp is also embedded here but has nothing to do with rom support
   \ (needs switched dp)
   
   variable tempdp 0 ,     \ temporary dp for resolving
   variable tempdp-save
   
   0 [IF]
   variable romdp 0 ,      \ Dictionary-Pointer for ramarea
   variable ramdp 0 ,      \ Dictionary-Pointer for romarea
   
   \
   variable sramdp         \ start of ram-area for forth
   variable sromdp         \ start of rom-area for forth
   
   [THEN]
   
   
   0 value tdp
   variable fixed          \ flag: true: no automatic switching
                           \       false: switching is done automatically
   
   \ Switch-Policy:
   \
   \ a header is always compiled into rom
   \ after a created word (create and variable) compilation goes to ram
   \
   \ Be careful: If you want to make the data behind create into rom
   \ you have to put >rom before create!
   
   variable constflag constflag off
   
   : (switchram)
     fixed @ ?EXIT has-rom 0= ?EXIT
     ram-dictionary >rdp to tdp ;
   
   : switchram
     constflag @
     IF constflag off ELSE (switchram) THEN ;
   
   : switchrom
     fixed @ ?EXIT rom-dictionary >rdp to tdp ;
   
   : >tempdp ( addr -- ) 
     tdp tempdp-save ! tempdp to tdp tdp ! ;
   : tempdp> ( -- )
     tempdp-save @ to tdp ;
   
   : >ram  fixed off (switchram) fixed on ;
   : >rom  fixed off switchrom fixed on ;
   : >auto fixed off switchrom ;
   
   
   
   \ : romstart dup sromdp ! romdp ! ;
   \ : ramstart dup sramdp ! ramdp ! ;
   
   \ default compilation goed to rom
   \ when romable support is off, only the rom switch is used (!!)
   >auto
   
   : there  tdp @ ;
   
 >TARGET  >TARGET
   
   \ \ Target Memory Handling
   
 \ Byte ordering and cell size                          06oct92py  \ Byte ordering and cell size                          06oct92py
   
 : cell+         tcell + ;  : cell+         tcell + ;
 : cells         tcell<< lshift ;  : cells         tcell<< lshift ;
 : chars         ;  : chars         ;
   : char+         1 + ;
 : floats        tfloat * ;  : floats        tfloat * ;
           
 >CROSS  >CROSS
 : cell/         tcell<< rshift ;  : cell/         tcell<< rshift ;
 >TARGET  >TARGET
 20 CONSTANT bl  20 CONSTANT bl
 -1 Constant NIL  \ TNIL Constant NIL
 -2 Constant :docol  
 -3 Constant :docon  
 -4 Constant :dovar  
 -5 Constant :douser  
 -6 Constant :dodefer  
 -7 Constant :dofield  
 -8 Constant :dodoes  
 -9 Constant :doesjump  
   
 >CROSS  >CROSS
   
 bigendian  bigendian
 [IF]  [IF]
    : T!  ( n addr -- )  >r s>d r> tcell bounds swap 1-     : S!  ( n addr -- )  >r s>d r> tcell bounds swap 1-
      DO  maxbyte ud/mod rot I c!  -1 +LOOP  2drop ;       DO  maxbyte ud/mod rot I c!  -1 +LOOP  2drop ;
    : T@  ( addr -- n )  >r 0 0 r> tcell bounds     : S@  ( addr -- n )  >r 0 0 r> tcell bounds
      DO  maxbyte * swap maxbyte um* rot + swap I c@ + swap  LOOP d>s ;       DO  maxbyte * swap maxbyte um* rot + swap I c@ + swap  LOOP d>s ;
 [ELSE]  [ELSE]
    : T!  ( n addr -- )  >r s>d r> tcell bounds     : S!  ( n addr -- )  >r s>d r> tcell bounds
      DO  maxbyte ud/mod rot I c!  LOOP  2drop ;       DO  maxbyte ud/mod rot I c!  LOOP  2drop ;
    : T@  ( addr -- n )  >r 0 0 r> tcell bounds swap 1-     : S@  ( addr -- n )  >r 0 0 r> tcell bounds swap 1-
      DO  maxbyte * swap maxbyte um* rot + swap I c@ + swap  -1 +LOOP d>s ;       DO  maxbyte * swap maxbyte um* rot + swap I c@ + swap  -1 +LOOP d>s ;
 [THEN]  [THEN]
   
 \ Memory initialisation                                05dec92py  
 \ Fixed bug in else part                               11may93jaw  
   
 [IFDEF] Memory \ Memory is a bigFORTH feature  
    also Memory  
    : initmem ( var len -- )  
      2dup swap handle! >r @ r> erase ;  
    toss  
 [ELSE]  
    : initmem ( var len -- )  
      tuck allocate abort" CROSS: No memory for target"  
      ( len var adr ) dup rot !  
      ( len adr ) swap erase ;  
 [THEN]  
   
 \ MakeKernal                                           12dec92py  
   
 >MINIMAL  
 : makekernal ( targetsize -- targetsize )  
   bit$  over 1- cell>bit rshift 1+ initmem  
   image over initmem tdp off ;  
   
 >CROSS  >CROSS
 \ Bit string manipulation                               06oct92py  \ Bit string manipulation                               06oct92py
 \                                                       9may93jaw  \                                                       9may93jaw
Line 192  CREATE Bittable 80 c, 40 c, 20 c, 10 c, Line 571  CREATE Bittable 80 c, 40 c, 20 c, 10 c,
 \ Target memory access                                 06oct92py  \ Target memory access                                 06oct92py
   
 : align+  ( taddr -- rest )  : align+  ( taddr -- rest )
     cell tuck 1- and - [ cell 1- ] Literal and ;      tcell tuck 1- and - [ tcell 1- ] Literal and ;
 : cfalign+  ( taddr -- rest )  : cfalign+  ( taddr -- rest )
     \ see kernal.fs:cfaligned      \ see kernel.fs:cfaligned
     float tuck 1- and - [ float 1- ] Literal and ;      /maxalign tuck 1- and - [ /maxalign 1- ] Literal and ;
   
 >TARGET  >TARGET
 : aligned ( taddr -- ta-addr )  dup align+ + ;  : aligned ( taddr -- ta-addr )  dup align+ + ;
 \ assumes cell alignment granularity (as GNU C)  \ assumes cell alignment granularity (as GNU C)
   
 : cfaligned ( taddr1 -- taddr2 )  : cfaligned ( taddr1 -- taddr2 )
     \ see kernal.fs      \ see kernel.fs
     dup cfalign+ + ;      dup cfalign+ + ;
   
 >CROSS  >CROSS
 : >image ( taddr -- absaddr )  image @ + ;  : >image ( taddr -- absaddr )  image @ + ;
 >TARGET  >TARGET
 : @  ( taddr -- w )     >image t@ ;  : @  ( taddr -- w )     >image S@ ;
 : !  ( w taddr -- )     >image t! ;  : !  ( w taddr -- )     >image S! ;
 : c@ ( taddr -- char )  >image c@ ;  : c@ ( taddr -- char )  >image c@ ;
 : c! ( char taddr -- )  >image c! ;  : c! ( char taddr -- )  >image c! ;
 : 2@ ( taddr -- x1 x2 ) T dup cell+ @ swap @ H ;  : 2@ ( taddr -- x1 x2 ) T dup cell+ @ swap @ H ;
Line 220  CREATE Bittable 80 c, 40 c, 20 c, 10 c, Line 599  CREATE Bittable 80 c, 40 c, 20 c, 10 c,
   
 : here  ( -- there )    there ;  : here  ( -- there )    there ;
 : allot ( n -- )        tdp +! ;  : allot ( n -- )        tdp +! ;
 : ,     ( w -- )        T here H cell T allot  ! H ;  : ,     ( w -- )        T here H tcell T allot  ! H T here drop H ;
 : c,    ( char -- )     T here    1 allot c! H ;  : c,    ( char -- )     T here    1 allot c! H ;
 : align ( -- )          T here H align+ 0 ?DO  bl T c, H LOOP ;  : align ( -- )          T here H align+ 0 ?DO  bl T c, H LOOP ;
 : cfalign ( -- )  : cfalign ( -- )
Line 231  CREATE Bittable 80 c, 40 c, 20 c, 10 c, Line 610  CREATE Bittable 80 c, 40 c, 20 c, 10 c,
   
 >CROSS  >CROSS
   
 \ threading modell                                     13dec92py  : tcmove ( source dest len -- )
   \G cmove in target memory
 \ generic threading modell    bounds
 : docol,  ( -- ) :docol T A, 0 , H ;    ?DO  dup T c@ H I T c! H 1+
     LOOP  drop ;
   
 >TARGET  >TARGET
 : >body   ( cfa -- pfa ) T cell+ cell+ H ;  H also Forth definitions \ ." asm: " order
 >CROSS  
   
 : dodoes, ( -- ) T :doesjump A, 0 , H ;  
   
 \ Ghost Builder                                        06oct92py  
   
 \ <T T> new version with temp variable                 10may93jaw  : X     also target bl word find
           IF      state @ IF compile,
 VARIABLE VocTemp                  ELSE execute THEN
           ELSE    previous ABORT" Cross: access method not supported!"
           THEN 
           previous ; immediate
   
   [IFDEF] asm-include asm-include [THEN] hex
   
   previous
   >CROSS H
   
   \ \ --------------------        Compiler Plug Ins               01aug97jaw
   
   Defer lit, ( n -- )
   Defer alit, ( n -- )
   Defer branch, ( target-addr -- )
   Defer ?branch, ( target-addr -- )
   Defer branchmark, ( -- branch-addr )
   Defer ?branchmark, ( -- branch-addr )
   Defer branchto,
   Defer branchtoresolve, ( branch-addr -- )
   Defer branchfrom, ( -- )
   Defer branchtomark, ( -- target-addr )
   Defer colon, ( tcfa -- )                \ compiles call to tcfa at current position
   Defer colon-resolve ( tcfa addr -- )
   Defer addr-resolve ( target-addr addr -- )
   
 : <T  get-current VocTemp ! also Ghosts definitions ;  [IFUNDEF] ca>native
 : T>  previous VocTemp @ set-current ;  defer ca>native 
   [THEN]
 4711 Constant <fwd>             4712 Constant <res>  
 4713 Constant <imm>  
   
 \ iForth makes only immediate directly after create  >TARGET
 \ make atonce trick! ?  DEFER >body             \ we need the system >body
                           \ and the target >body
   >CROSS
   T 2 cells H VALUE xt>body
   DEFER doprim,
   DEFER docol,     \ compiles start of definition and doer
   DEFER doer,             
   DEFER fini,      \ compiles end of definition ;s
   DEFER doeshandler,
   DEFER dodoes,
   
   DEFER ]comp     \ starts compilation
   DEFER comp[     \ ends compilation
   
   : (cc) T a, H ;                 ' (cc) IS colon,
   : (cr) >tempdp ]comp colon, comp[ tempdp> ; ' (cr) IS colon-resolve
   : (ar) T ! H ;                  ' (ar) IS addr-resolve
   
 Variable atonce atonce off  >TARGET
   : compile, colon, ;
   >CROSS
   
 : NoExec true ABORT" CROSS: Don't execute ghost" ;  
   
 : GhostHeader <fwd> , 0 , ['] NoExec , ;  
   
 : >magic ; : >link cell+ ; : >exec cell+ cell+ ;  \ resolve structure
 : >end 3 cells + ;  
   
 Variable last-ghost  : >next ;               \ link to next field
 : Make-Ghost ( "name" -- ghost )  : >tag cell+ ;          \ indecates type of reference: 0: call, 1: address
   >in @ GhostName swap >in !  : >taddr cell+ cell+ ;
   <T Create atonce @ IF immediate atonce off THEN  : >ghost 3 cells + ;
   here tuck swap ! ghostheader T>  
   DOES> dup last-ghost ! >exec @ execute ;  
   
 \ ghost words                                          14oct92py  : refered ( ghost tag -- )
 \                                          changed:    10may93py/jaw    swap >r here r@ >link @ , r@ >link ! ( tag ) ,
     T here aligned H , r> drop  last-header-ghost @ , ;
   
 : gfind   ( string -- ghost true/1 / string false )  Defer resolve-warning
 \ 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 IF  >r >body nip r>  THEN ;  
   
 VARIABLE Already  : reswarn-test ( ghost res-struct -- ghost res-struct )
     over cr ." Resolving " >ghostname type dup ."  in " >ghost @ >ghostname type ;
   
 : ghost   ( "name" -- ghost )  : reswarn-forward ( ghost res-struct -- ghost res-struct )
   Already off    over warnhead >ghostname type dup ."  is referenced in " 
   >in @  bl word gfind   IF  Already on nip EXIT  THEN    >ghost @ >ghostname type ;
   drop  >in !  Make-Ghost ;  
   
   \ ' reswarn-test IS resolve-warning
    
 \ resolve                                              14oct92py  \ resolve                                              14oct92py
   
 : resolve-loop ( ghost tcfa -- ghost tcfa )   : resolve-loop ( ghost tcfa -- ghost tcfa )
   >r dup >link @    >r dup >link
   BEGIN  dup  WHILE  dup T @ H r@ rot T ! H REPEAT  drop r> ;    BEGIN @ dup WHILE 
           resolve-warning 
           r@ over >taddr @ 
           2 pick >tag @
           IF      addr-resolve
           ELSE    colon-resolve
           THEN
     REPEAT drop r> ;
   
   \ : resolve-loop ( ghost tcfa -- ghost tcfa )
   \  >r dup >link @
   \  BEGIN  dup  WHILE  dup T @ H r@ rot T ! H REPEAT  drop r> ;
   
 \ exists                                                9may93jaw  \ exists                                                9may93jaw
   
   Variable TWarnings
   TWarnings on
   Variable Exists-Warnings
   Exists-Warnings on
   
 : exists ( ghost tcfa -- )  : exists ( ghost tcfa -- )
   over GhostNames    over GhostNames
   BEGIN @ dup    BEGIN @ dup
   WHILE 2dup cell+ @ =    WHILE 2dup cell+ @ =
   UNTIL    UNTIL
         2 cells + count cr ." CROSS: Exists: " type 4 spaces drop          2 cells + count
         swap cell+ !          TWarnings @ Exists-Warnings @ and
           IF warnhead type ."  exists"
           ELSE 2drop THEN
           drop swap >link !
   ELSE  true abort" CROSS: Ghostnames inconsistent "    ELSE  true abort" CROSS: Ghostnames inconsistent "
   THEN ;    THEN ;
   
 : resolve  ( ghost tcfa -- )  : resolve  ( ghost tcfa -- )
   over >magic @ <fwd> <>  IF  exists EXIT THEN  \ resolve referencies to ghost with tcfa
   resolve-loop  over >link ! <res> swap >magic ! ;    over forward? 0= IF  exists EXIT THEN
     resolve-loop  over >link ! <res> swap >magic ! 
     ['] noop IS resolve-warning 
     ;
   
 \ gexecute ghost,                                      01nov92py  \ gexecute ghost,                                      01nov92py
   
 : do-forward   ( ghost -- )  : is-forward   ( ghost -- )
   >link dup @  there rot !  T  A,  H ;  \  >link dup @ there rot !  T  A,  H ;
 : do-resolve   ( ghost -- )    0 refered  -1 colon, ;
   >link @                   T  A,  H ;  
   : is-resolved   ( ghost -- )
 : gexecute   ( ghost -- )   dup @    >link @ colon, ; \ compile-call
              <fwd> = IF  do-forward  ELSE  do-resolve  THEN ;  
 : ghost,     ghost  gexecute ;  : gexecute   ( ghost -- )
     dup @ <fwd> = IF  is-forward  ELSE  is-resolved  THEN ;
   
   : addr,  ( ghost -- )
     dup @ <fwd> = IF  1 refered 0 T a, H ELSE >link @ T a, H THEN ;
   
   \ !! : ghost,     ghost  gexecute ;
   
 \ .unresolved                                          11may93jaw  \ .unresolved                                          11may93jaw
   
Line 328  variable ResolveFlag Line 765  variable ResolveFlag
   
 \ ?touched                                             11may93jaw  \ ?touched                                             11may93jaw
   
 : ?touched ( ghost -- flag ) dup >magic @ <fwd> = swap >link @  : ?touched ( ghost -- flag ) dup forward? swap >link @
                                0 <> and ;                                 0 <> and ;
   
 : ?resolved  ( ghostname -- )  : ?resolved  ( ghostname -- )
Line 343  variable ResolveFlag Line 780  variable ResolveFlag
   WHILE dup ?resolved    WHILE dup ?resolved
   REPEAT drop ResolveFlag @    REPEAT drop ResolveFlag @
   IF    IF
       abort" Unresolved words!"        -1 abort" Unresolved words!"
   ELSE    ELSE
       ." Nothing!"        ." Nothing!"
   THEN    THEN
   cr ;    cr ;
   
   : .stats
     base @ >r decimal
     cr ." named Headers: " headers-named @ . 
   \  cr ." MaxRam*" ramdp @ . 
   \  cr ." MaxRom*" romdp @ . 
     r> base ! ;
   
 >CROSS  >CROSS
 \ Header states                                        12dec92py  \ Header states                                        12dec92py
   
Line 362  VARIABLE ^imm Line 806  VARIABLE ^imm
                 <res> <> ABORT" CROSS: Cannot immediate a unresolved word"                  <res> <> ABORT" CROSS: Cannot immediate a unresolved word"
                 <imm> ^imm @ ! ;                  <imm> ^imm @ ! ;
 : restrict      20 flag! ;  : restrict      20 flag! ;
   
   : isdoer        <do:> last-header-ghost @ >magic ! ;
 >CROSS  >CROSS
   
 \ ALIAS2 ansforth conform alias                          9may93jaw  \ ALIAS2 ansforth conform alias                          9may93jaw
Line 372  VARIABLE ^imm Line 818  VARIABLE ^imm
   
 \ Target Header Creation                               01nov92py  \ Target Header Creation                               01nov92py
   
   >TARGET
 : string,  ( addr count -- )  : string,  ( addr count -- )
   dup T c, H bounds  ?DO  I c@ T c, H  LOOP ;     dup T c, H bounds  ?DO  I c@ T c, H  LOOP ; 
 : name,  ( "name" -- )  bl word count string, T cfalign H ;  : name,  ( "name" -- )  bl word count T string, cfalign H ;
 : view,   ( -- ) ( dummy ) ;  : view,   ( -- ) ( dummy ) ;
   >CROSS
   
 \ Target Document Creation (goes to crossdoc.fd)       05jul95py  \ Target Document Creation (goes to crossdoc.fd)       05jul95py
   
 s" crossdoc.fd" r/w create-file throw value doc-file-id  s" doc/crossdoc.fd" r/w create-file throw value doc-file-id
 \ contains the file-id of the documentation file  \ contains the file-id of the documentation file
   
 : \G ( -- )  : T-\G ( -- )
     source >in @ /string doc-file-id write-line throw      source >in @ /string doc-file-id write-line throw
     source >in ! drop ; immediate      postpone \ ;
   
 Variable to-doc  Variable to-doc  to-doc on
   
 : cross-doc-entry  ( -- )  : cross-doc-entry  ( -- )
     to-doc @ tlast @ 0<> and    \ not an anonymous (i.e. noname) header      to-doc @ tlast @ 0<> and    \ not an anonymous (i.e. noname) header
Line 399  Variable to-doc Line 847  Variable to-doc
         [char] ) parse doc-file-id write-file throw          [char] ) parse doc-file-id write-file throw
         s"  )" doc-file-id write-file throw          s"  )" doc-file-id write-file throw
         [char] \ parse 2drop                                              [char] \ parse 2drop                                    
         POSTPONE \g          T-\G
         >in !          >in !
     THEN  to-doc on ;      THEN ;
   
 \ Target TAGS creation  \ Target TAGS creation
   
 s" kernal.TAGS" r/w create-file throw value tag-file-id  s" kernel.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,
Line 438  Create tag-bof 1 c,  0C c, Line 886  Create tag-bof 1 c,  0C c,
         base !          base !
     THEN ;      THEN ;
   
   \ Check for words
   
   Defer skip? ' false IS skip?
   
   : defined? ( -- flag ) \ name
       ghost forward? 0= ;
   
   : needed? ( -- flag ) \ name
   \G returns a false flag when
   \G a word is not defined
   \G a forward reference exists
   \G so the definition is not skipped!
       bl word gfind
       IF dup forward?
           nip
           0=
       ELSE  drop true  THEN ;
   
   : doer? ( -- flag ) \ name
       ghost >magic @ <do:> = ;
   
   : skip-defs ( -- )
       BEGIN  refill  WHILE  source -trailing nip 0= UNTIL  THEN ;
   
 \ Target header creation  \ Target header creation
   
   
 VARIABLE CreateFlag CreateFlag off  VARIABLE CreateFlag CreateFlag off
   
 : (Theader ( "name" -- ghost ) T align H view,  : 0.r ( n1 n2 -- ) 0 swap <# 0 ?DO # LOOP #> type ;
   : .sym
     bounds 
     DO I c@ dup
           CASE    '/ OF drop ." \/" ENDOF
                   '\ OF drop ." \\" ENDOF
                   dup OF emit ENDOF
           ENDCASE
     LOOP ;
   
   : (Theader ( "name" -- ghost )
   \  >in @ bl word count type 2 spaces >in !
   \ wordheaders will always be compiled to rom
     switchrom
     T align H view,
   tlast @ dup 0> IF  T 1 cells - THEN  A, H  there tlast !    tlast @ dup 0> IF  T 1 cells - THEN  A, H  there tlast !
   >in @ name, >in ! T here H tlastcfa !    1 headers-named +!    \ Statistic
     >in @ T name, H >in ! T here H tlastcfa !
     \ Symbol table
     \ >in @ cr ." sym:s/CFA=" there 4 0.r ." /"  bl word count .sym ." /g" cr >in !
   CreateFlag @ IF    CreateFlag @ IF
        >in @ alias2 swap >in !         \ create alias in target         >in @ alias2 swap >in !         \ create alias in target
        >in @ ghost swap >in !         >in @ ghost swap >in !
        swap also ghosts ' previous swap !     \ tick ghost and store in alias         swap also ghosts ' previous swap !     \ tick ghost and store in alias
        CreateFlag off         CreateFlag off
   ELSE ghost THEN    ELSE ghost THEN
     dup Last-Header-Ghost !
   dup >magic ^imm !     \ a pointer for immediate    dup >magic ^imm !     \ a pointer for immediate
   Already @ IF  dup >end tdoes !    Already @ IF  dup >end tdoes !
   ELSE 0 tdoes ! THEN    ELSE 0 tdoes ! THEN
Line 458  VARIABLE CreateFlag CreateFlag off Line 949  VARIABLE CreateFlag CreateFlag off
   cross-doc-entry cross-tag-entry ;    cross-doc-entry cross-tag-entry ;
   
 VARIABLE ;Resolve 1 cells allot  VARIABLE ;Resolve 1 cells allot
   \ this is the resolver information from ":"
   \ resolving is done by ";"
   
 : Theader  ( "name" -- ghost )  : Theader  ( "name" -- ghost )
   (THeader dup there resolve 0 ;Resolve ! ;    (THeader dup there resolve 0 ;Resolve ! ;
   
 >TARGET  >TARGET
 : Alias    ( cfa -- ) \ name  : Alias    ( cfa -- ) \ name
   dup 0< IF  to-doc off  THEN      >in @ skip? IF  2drop  EXIT  THEN  >in !
   (THeader over resolve T A, H 80 flag! ;      dup 0< has-prims 0= and
       IF
           ." needs prim: " >in @ bl word count type >in ! cr
       THEN
       (THeader over resolve T A, H 80 flag! ;
   : Alias:   ( cfa -- ) \ name
       >in @ skip? IF  2drop  EXIT  THEN  >in !
       dup 0< has-prims 0= and
       IF
           ." needs doer: " >in @ bl word count type >in ! cr
       THEN
       ghost tuck swap resolve <do:> swap >magic ! ;
 >CROSS  >CROSS
   
 \ Conditionals and Comments                            11may93jaw  \ Conditionals and Comments                            11may93jaw
Line 489  VARIABLE ;Resolve 1 cells allot Line 993  VARIABLE ;Resolve 1 cells allot
   
 Comment (       Comment \  Comment (       Comment \
   
 \ Predefined ghosts                                    12dec92py  
   
 ghost 0=                                        drop  
 ghost branch    ghost ?branch                   2drop  
 ghost (do)      ghost (?do)                     2drop  
 ghost (for)                                     drop  
 ghost (loop)    ghost (+loop)                   2drop  
 ghost (next)                                    drop  
 ghost unloop    ghost ;S                        2drop  
 ghost lit       ghost (compile) ghost !         2drop drop  
 ghost (does>)   ghost noop                      2drop  
 ghost (.")      ghost (S")      ghost (ABORT")  2drop drop  
 ghost '  
   
 \ compile                                              10may93jaw  \ compile                                              10may93jaw
   
 : compile  ( -- ) \ name  : compile  ( -- ) \ name
Line 513  ghost ' Line 1003  ghost '
   ELSE  postpone literal postpone gexecute  THEN ;    ELSE  postpone literal postpone gexecute  THEN ;
                                         immediate                                          immediate
   
   : [G'] 
   \G ticks a ghost and returns its address
     bl word gfind 0= ABORT" CROSS: Ghost don't exists"
     state @
     IF   postpone literal
     THEN ; immediate
   
   : ghost>cfa
     dup forward? ABORT" CROSS: forward " >link @ ;
                  
 >TARGET  >TARGET
 : '  ( -- cfa ) bl word gfind 0= ABORT" CROSS: undefined "  
   dup >magic @ <fwd> = ABORT" CROSS: forward " >link @ ;  
   
 Cond: [']  compile lit ghost gexecute ;Cond  : '  ( -- cfa ) 
   \ returns the target-cfa of a ghost
     bl word gfind 0= ABORT" CROSS: Ghost don't exists"
     ghost>cfa ;
   
   Cond: [']  T ' H alit, ;Cond
   
   >CROSS
   
   : [T']
   \ returns the target-cfa of a ghost, or compiles it as literal
     postpone [G'] state @ IF postpone ghost>cfa ELSE ghost>cfa THEN ; immediate
   
   \ \ threading modell                                    13dec92py
   \ modularized                                           14jun97jaw
   
   : fillcfa   ( usedcells -- )
     T cells H xt>body swap - 0 ?DO 0 T c, H LOOP ;
   
   : (>body)   ( cfa -- pfa ) xt>body + ;          ' (>body) T IS >body H
   
   : (doer,)   ( ghost -- ) ]comp gexecute comp[ 1 fillcfa ;   ' (doer,) IS doer,
   
   : (docol,)  ( -- ) [G'] :docol doer, ;          ' (docol,) IS docol,
   
   : (doprim,) ( -- )
     there xt>body + ca>native T a, H 1 fillcfa ;  ' (doprim,) IS doprim,
   
   : (doeshandler,) ( -- ) 
     T cfalign H compile :doesjump T 0 , H ;       ' (doeshandler,) IS doeshandler,
   
   : (dodoes,) ( does-action-ghost -- )
     ]comp [G'] :dodoes gexecute comp[
     addr,
     T here H tcell - reloff 2 fillcfa ;           ' (dodoes,) IS dodoes,
   
   : (lit,) ( n -- )   compile lit T  ,  H ;       ' (lit,) IS lit,
   
   : (alit,) ( n -- )  lit, T here cell - H relon ;        ' (alit,) IS alit,
   
   : (fini,)         compile ;s ;                ' (fini,) IS fini,
   
   [IFUNDEF] (code) 
   Defer (code)
   Defer (end-code)
   [THEN]
   
   >TARGET
   : Code
     defempty?
     (THeader there resolve
     [ has-prims 0= [IF] ITC [ELSE] true [THEN] ] [IF]
     doprim, 
     [THEN]
     depth (code) ;
   
   : Code:
     defempty?
       ghost dup there ca>native resolve  <do:> swap >magic !
       depth (code) ;
   
   : end-code
       (end-code)
       depth ?dup IF   1- <> ABORT" CROSS: Stack changed"
       ELSE true ABORT" CROSS: Stack empty" THEN
       ;
   
 Cond: chars ;Cond  Cond: chars ;Cond
   
 >CROSS  >CROSS
 \ tLiteral                                             12dec92py  
   
 : lit, ( n -- )   compile lit T  ,  H ;  \ tLiteral                                             12dec92py
 : alit, ( n -- )  compile lit T A,  H ;  
   
 >TARGET  >TARGET
   Cond: \G  T-\G ;Cond
   
 Cond:  Literal ( n -- )   restrict? lit, ;Cond  Cond:  Literal ( n -- )   restrict? lit, ;Cond
 Cond: ALiteral ( n -- )   restrict? alit, ;Cond  Cond: ALiteral ( n -- )   restrict? alit, ;Cond
   
 : Char ( "<char>" -- )  bl word char+ c@ ;  : Char ( "<char>" -- )  bl word char+ c@ ;
 Cond: [Char]   ( "<char>" -- )  restrict? Char  lit, ;Cond  Cond: [Char]   ( "<char>" -- )  restrict? Char  lit, ;Cond
   
   \ some special literals                                 27jan97jaw
   
   \ !! Known Bug: Special Literals and plug-ins work only correct
   \ on 16 and 32 Bit Targets and 32 Bit Hosts!
   
   Cond: MAXU
     restrict? 
     tcell 1 cells u> 
     IF    compile lit tcell 0 ?DO FF T c, H LOOP 
     ELSE  $ffffffff lit, THEN
     ;Cond
   
   Cond: MINI
     restrict?
     tcell 1 cells u>
     IF    compile lit bigendian 
           IF      80 T c, H tcell 1 ?DO 0 T c, H LOOP 
           ELSE    tcell 1 ?DO 0 T c, H LOOP 80 T c, H
           THEN
     ELSE  tcell 2 = IF $8000 ELSE $80000000 THEN lit, THEN
     ;Cond
    
   Cond: MAXI
    restrict?
    tcell 1 cells u>
    IF     compile lit bigendian 
           IF      7F T c, H tcell 1 ?DO FF T c, H LOOP
           ELSE    tcell 1 ?DO FF T c, H LOOP 7F T c, H
           THEN
    ELSE   tcell 2 = IF $7fff ELSE $7fffffff THEN lit, THEN
    ;Cond
   
 >CROSS  >CROSS
 \ Target compiling loop                                12dec92py  \ Target compiling loop                                12dec92py
 \ ">tib trick thrown out                               10may93jaw  \ ">tib trick thrown out                               10may93jaw
Line 566  Cond: [Char]   ( "<char>" -- )  restrict Line 1161  Cond: [Char]   ( "<char>" -- )  restrict
 \             is not allowed if a system should be ans conform  \             is not allowed if a system should be ans conform
   
 : : ( -- colon-sys ) \ Name  : : ( -- colon-sys ) \ Name
     defempty?
     constflag off \ don't let this flag work over colon defs
                   \ just to go sure nothing unwanted happens
     >in @ skip? IF  drop skip-defs  EXIT  THEN  >in !
   (THeader ;Resolve ! there ;Resolve cell+ !    (THeader ;Resolve ! there ;Resolve cell+ !
   docol, depth T ] H ;    docol, ]comp depth T ] H ;
   
   : :noname ( -- colon-sys )
     T cfalign H there docol, 0 ;Resolve ! 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
   
   >CROSS
   : LastXT ;Resolve @ 0= abort" CROSS: no definition for LastXT"
            ;Resolve cell+ @ ;
   
   >TARGET
   
   Cond: recurse ( -- ) Last-Ghost @ gexecute ;Cond
   
 Cond: ; ( -- ) restrict?  Cond: ; ( -- ) restrict?
                depth ?dup IF   1- <> ABORT" CROSS: Stack changed"                 depth ?dup IF   1- <> ABORT" CROSS: Stack changed"
                           ELSE true ABORT" CROSS: Stack empty" THEN                            ELSE true ABORT" CROSS: Stack empty" THEN
                compile ;S state off                 fini,
                  comp[
                  state off
                ;Resolve @                 ;Resolve @
                IF ;Resolve @ ;Resolve cell+ @ resolve THEN                 IF ;Resolve @ ;Resolve cell+ @ resolve THEN
                ;Cond                 ;Cond
 Cond: [  restrict? state off ;Cond  Cond: [  restrict? state off ;Cond
   
 >CROSS  >CROSS
 : !does  :dodoes tlastcfa @ tuck T ! cell+ ! H ;  : !does ( does-action -- )
   \ !! zusammenziehen und dodoes, machen!
       tlastcfa @ dup there >r tdp ! compile :dodoes r> tdp ! T cell+ ! H ;
   \ !! geht so nicht, da dodoes, ghost will!
   \     tlastcfa @ >tempdp dodoes, tempdp> ;
   
 >TARGET  >TARGET
 Cond: DOES> restrict?  Cond: DOES> restrict?
         compile (does>) dodoes, tdoes @ ?dup IF  @ T here H resolve THEN          compile (does>) doeshandler, 
           \ resolve words made by builders
           tdoes @ ?dup IF  @ T here H resolve THEN
         ;Cond          ;Cond
 : DOES> dodoes, T here H !does depth T ] H ;  : DOES> switchrom doeshandler, T here H !does depth T ] H ;
   
 >CROSS  >CROSS
 \ Creation                                             01nov92py  \ Creation                                             01nov92py
   
 \ Builder                                               11may93jaw  \ Builder                                               11may93jaw
   
 : Builder    ( Create do: "name" -- )  : Builder    ( Create-xt do:-xt "name" -- )
   \ builds up a builder in current vocabulary
   \ create-xt is executed when word is interpreted
   \ do:-xt is executet when the created word from builder is executed
   \ for do:-xt an additional entry after the normal ghost-enrys is used
   
   >in @ alias2 swap dup >in ! >r >r    >in @ alias2 swap dup >in ! >r >r
   Make-Ghost rot swap >exec ! ,    Make-Ghost rot swap >exec ! ,
   r> r> >in !    r> r> >in !
   also ghosts ' previous swap ! ;    also ghosts ' previous swap ! ;
 \  DOES>  dup >exec @ execute ;  \  DOES>  dup >exec @ execute ;
   
 : gdoes,  ( ghost -- )  >end @ dup >magic @ <fwd> <>  : gdoes,  ( ghost -- )
   IF dup >link @ dup 0< IF T A, 0 , H drop EXIT THEN drop THEN  \ makes the codefield for a word that is built
   :dodoes T A, H gexecute T here H cell - reloff ;    >end @ dup forward? 0=
     IF
           dup >magic @ <do:> =
           IF  doer, EXIT THEN
     THEN
   \  compile :dodoes gexecute
   \  T here H tcell - reloff 
     dodoes,
   ;
   
 : TCreate ( -- )  : TCreate ( <name> -- )
   last-ghost @    executed-ghost @
   CreateFlag on    CreateFlag on
     create-forward-warn
     IF ['] reswarn-forward IS resolve-warning THEN
   Theader >r dup gdoes,    Theader >r dup gdoes,
   \ stores execution symantic in the built word
     >end @ >exec @ r> >exec ! ;
   
   : RTCreate ( <name> -- )
   \ creates a new word with code-field in ram
     executed-ghost @
     CreateFlag on
     create-forward-warn
     IF ['] reswarn-forward IS resolve-warning THEN
     \ make Alias
     (THeader there 0 T a, H 80 flag! ( S executed-ghost new-ghost )
     \ store  poiter to code-field
     switchram T cfalign H
     there swap T ! H
     there tlastcfa ! 
     dup there resolve 0 ;Resolve !
     >r dup gdoes,
   >end @ >exec @ r> >exec ! ;    >end @ >exec @ r> >exec ! ;
   
 : Build:  ( -- [xt] [colon-sys] )  : Build:  ( -- [xt] [colon-sys] )
   :noname  postpone TCreate ;    :noname postpone TCreate ;
   
   : BuildSmart:  ( -- [xt] [colon-sys] )
     :noname
     [ has-rom [IF] ]
     postpone RTCreate
     [ [ELSE] ]
     postpone TCreate 
     [ [THEN] ] ;
   
 : gdoes>  ( ghost -- addr flag )  : gdoes>  ( ghost -- addr flag )
   last-ghost @    executed-ghost @
   state @ IF  gexecute true EXIT  THEN    state @ IF  gexecute true EXIT  THEN
   cell+ @ T >body H false ;    >link @ T >body H false ;
   
 \ DO: ;DO                                               11may93jaw  \ DO: ;DO                                               11may93jaw
 \ changed to ?EXIT                                      10may93jaw  \ changed to ?EXIT                                      10may93jaw
Line 628  Cond: DOES> restrict? Line 1286  Cond: DOES> restrict?
   here ghostheader    here ghostheader
   :noname postpone gdoes> postpone ?EXIT ;    :noname postpone gdoes> postpone ?EXIT ;
   
 : ;DO ( addr [xt] [colon-sys] -- )  : by:     ( -- addr [xt] [colon-sys] ) \ name
     ghost
     :noname postpone gdoes> postpone ?EXIT ;
   
   : ;DO ( addr [xt] [colon-sys] -- addr )
   postpone ;    ( S addr xt )    postpone ;    ( S addr xt )
   over >exec ! ; immediate    over >exec ! ; immediate
   
Line 638  Cond: DOES> restrict? Line 1300  Cond: DOES> restrict?
 >TARGET  >TARGET
 \ Variables and Constants                              05dec92py  \ Variables and Constants                              05dec92py
   
 Build:  ;  Build:  ( n -- ) ;
 DO: ( ghost -- addr ) ;DO  by: :docon ( ghost -- n ) T @ H ;DO
   Builder (Constant)
   
   Build:  ( n -- ) T , H ;
   by (Constant)
   Builder Constant
   
   Build:  ( n -- ) T A, H ;
   by (Constant)
   Builder AConstant
   
   Build:  ( d -- ) T , , H ;
   DO: ( ghost -- d ) T dup cell+ @ swap @ H ;DO
   Builder 2Constant
   
   BuildSmart: ;
   by: :dovar ( ghost -- addr ) ;DO
 Builder Create  Builder Create
 by Create :dovar resolve  
   
   has-rom [IF]
   Build: ( n -- ) T here 0 , H switchram T align here swap ! 0 , H ( switchrom ) ;
   by (Constant)
   Builder Variable
   [ELSE]
 Build: T 0 , H ;  Build: T 0 , H ;
 by Create  by Create
 Builder Variable  Builder Variable
   [THEN]
   
   has-rom [IF]
   Build: ( n -- ) T here 0 , H switchram T align here swap ! 0 , H ( switchrom ) ;
   by (Constant)
   Builder AVariable
   [ELSE]
 Build: T 0 A, H ;  Build: T 0 A, H ;
 by Create  by Create
 Builder AVariable  Builder AVariable
   [THEN]
   
 \ User variables                                       04may94py  \ User variables                                       04may94py
   
Line 665  Variable tudp 0 tudp ! Line 1354  Variable tudp 0 tudp !
 >TARGET  >TARGET
   
 Build: T 0 u, , H ;  Build: T 0 u, , H ;
 DO: ( ghost -- up-addr )  T @ H tup @ + ;DO  by: :douser ( ghost -- up-addr )  T @ H tup @ + ;DO
 Builder User  Builder User
 by User :douser resolve  
   
 Build: T 0 u, , 0 u, drop H ;  Build: T 0 u, , 0 u, drop H ;
 by User  by User
Line 677  Build: T 0 au, , H ; Line 1365  Build: T 0 au, , H ;
 by User  by User
 Builder AUser  Builder AUser
   
 Build:  ( n -- ) T , H ;  BuildSmart: T , H ;
 DO: ( ghost -- n ) T @ H ;DO  by (Constant)
 Builder Constant  
 by Constant :docon resolve  
   
 Build:  ( n -- ) T A, H ;  
 by Constant  
 Builder AConstant  
   
 Build:  ( d -- ) T , , H ;  
 DO: ( ghost -- d ) T dup cell+ @ swap @ H ;DO  
 Builder 2Constant  
   
 Build: T 0 , H ;  
 by Constant  
 Builder Value  Builder Value
   
 Build: T 0 A, H ;  BuildSmart: T A, H ;
 by Constant  by (Constant)
 Builder AValue  Builder AValue
   
 Build:  ( -- ) compile noop ;  BuildSmart:  ( -- ) [T'] noop T A, H ;
 DO: ( ghost -- ) ABORT" CROSS: Don't execute" ;DO  by: :dodefer ( ghost -- ) ABORT" CROSS: Don't execute" ;DO
 Builder Defer  Builder Defer
 by Defer :dodefer resolve  
   BuildSmart:  ( inter comp -- ) swap T immediate A, A, H ;
   DO: ( ghost -- ) ABORT" CROSS: Don't execute" ;DO
   Builder interpret/compile:
   
 \ Sturctures                                           23feb95py  \ Sturctures                                           23feb95py
   
Line 711  by Defer :dodefer resolve Line 1389  by Defer :dodefer resolve
  1- tuck +  swap invert and ;   1- tuck +  swap invert and ;
 >TARGET  >TARGET
   
 Build:  >r rot r@ nalign  dup T , H  ( align1 size offset )  Build: ;
         + swap r> nalign ;  by: :dofield T @ H + ;DO
 DO: T @ H + ;DO  Builder (Field)
   
   Build: ( align1 offset1 align size "name" --  align2 offset2 )
       rot dup T , H ( align1 align size offset1 )
       + >r nalign r> ;
   by (Field)
 Builder Field  Builder Field
 by Field :dofield resolve  
   
 : struct  T 0 1 chars H ;  : struct  T 1 chars 0 H ;
 : end-struct  T 2Constant H ;  : end-struct  T 2Constant H ;
   
 : cells: ( n -- size align )  : cell% ( n -- size align )
     T cells 1 cells H ;      T 1 cells H dup ;
   
 \ ' 2Constant Alias2 end-struct  \ ' 2Constant Alias2 end-struct
 \ 0 1 T Chars H 2Constant struct  \ 0 1 T Chars H 2Constant struct
   
   0 [IF]
   
 \ structural conditionals                              17dec92py  \ structural conditionals                              17dec92py
   
 >CROSS  >CROSS
 : ?struc      ( flag -- )       ABORT" CROSS: unstructured " ;  : ?struc      ( flag -- )       ABORT" CROSS: unstructured " ;
 : sys?        ( sys -- sys )    dup 0= ?struc ;  : sys?        ( sys -- sys )    dup 0= ?struc ;
 : >mark       ( -- sys )        T here  0 , H ;  : >mark       ( -- sys )        T here  ( dup ." M" hex. ) 0 , H ;
 : >resolve    ( sys -- )        T here over - swap ! H ;  
 : <resolve    ( sys -- )        T here - , H ;  : branchoffset ( src dest -- ) - ;
   : >resolve    ( sys -- )        T here ( dup ." >" hex. ) over branchoffset swap ! H ;
   : <resolve    ( sys -- )        T here ( dup ." <" hex. ) branchoffset , H ;
 >TARGET  >TARGET
   
 \ Structural Conditionals                              12dec92py  \ Structural Conditionals                              12dec92py
Line 760  Cond: ?LEAVE    restrict? compile 0=  co Line 1446  Cond: ?LEAVE    restrict? compile 0=  co
   
 Cond: AHEAD     restrict? compile branch >mark ;Cond  Cond: AHEAD     restrict? compile branch >mark ;Cond
 Cond: IF        restrict? compile ?branch >mark ;Cond  Cond: IF        restrict? compile ?branch >mark ;Cond
 Cond: THEN      restrict? sys? dup T @ H ?struc >resolve ;Cond  Cond: THEN      restrict? sys? branchto, dup T @ H ?struc >resolve ;Cond
 Cond: ELSE      restrict? sys? compile AHEAD swap compile THEN ;Cond  Cond: ELSE      restrict? sys? compile AHEAD swap compile THEN ;Cond
   
 Cond: BEGIN     restrict? T here H ;Cond  Cond: BEGIN     restrict? T branchto, here ( dup ." B" hex. ) H ;Cond
 Cond: WHILE     restrict? sys? compile IF swap ;Cond  Cond: WHILE     restrict? sys? compile IF swap ;Cond
 Cond: AGAIN     restrict? sys? compile branch <resolve ;Cond  Cond: AGAIN     restrict? sys? compile branch <resolve ;Cond
 Cond: UNTIL     restrict? sys? compile ?branch <resolve ;Cond  Cond: UNTIL     restrict? sys? compile ?branch <resolve ;Cond
 Cond: REPEAT    restrict? over 0= ?struc compile AGAIN compile THEN ;Cond  Cond: REPEAT    restrict? over 0= ?struc compile AGAIN compile THEN ;Cond
   
   Cond: CASE      restrict? 0 ;Cond
   Cond: OF        restrict? 1+ >r compile over compile =
                   compile IF compile drop r> ;Cond
   Cond: ENDOF     restrict? >r compile ELSE r> ;Cond
   Cond: ENDCASE   restrict? compile drop 0 ?DO  compile THEN  LOOP ;Cond
   
   \ Structural Conditionals                              12dec92py
   
   Cond: DO        restrict? compile (do)   T here H ;Cond
   Cond: ?DO       restrict? compile (?do)  T (leave here H ;Cond
   Cond: FOR       restrict? compile (for)  T here H ;Cond
   
   >CROSS
   : loop]   dup <resolve tcell - compile DONE compile unloop ;
   >TARGET
   
   Cond: LOOP      restrict? sys? compile (loop)  loop] ;Cond
   Cond: +LOOP     restrict? sys? compile (+loop) loop] ;Cond
   Cond: NEXT      restrict? sys? compile (next)  loop] ;Cond
   
   [ELSE]
   
   \ structural conditionals                              17dec92py
   
   >CROSS
   : ?struc      ( flag -- )       ABORT" CROSS: unstructured " ;
   : sys?        ( sys -- sys )    dup 0= ?struc ;
   : >mark       ( -- sys )        T here  ( dup ." M" hex. ) 0 , H ;
   
   : branchoffset ( src dest -- ) - ;
   
   : >resolve    ( sys -- )        T here ( dup ." >" hex. ) over branchoffset swap ! H ;
   
   : <resolve    ( sys -- )        T here ( dup ." <" hex. ) branchoffset , H ;
   
   :noname compile branch T here branchoffset , H ; IS branch,
   :noname compile ?branch T here branchoffset , H ; IS ?branch,
   :noname compile branch T here 0 , H ; IS branchmark,
   :noname compile ?branch T here 0 , H ; IS  ?branchmark,
   :noname dup T @ H ?struc T here over branchoffset swap ! H ; IS branchtoresolve,
   :noname branchto, T here H ; IS branchtomark,
   
   >TARGET
   
   \ Structural Conditionals                              12dec92py
   
   Cond: BUT       restrict? sys? swap ;Cond
   Cond: YET       restrict? sys? dup ;Cond
   
   >CROSS
   Variable tleavings
   >TARGET
   
   Cond: DONE   ( addr -- )  restrict? tleavings @
         BEGIN  2dup u> 0=  WHILE  dup T @ H swap >resolve REPEAT
         tleavings ! drop ;Cond
   
   >CROSS
   : (leave  T here H tleavings @ T , H  tleavings ! ;
   >TARGET
   
   Cond: LEAVE     restrict? compile branch (leave ;Cond
   Cond: ?LEAVE    restrict? compile 0=  compile ?branch (leave  ;Cond
   
   \ Structural Conditionals                              12dec92py
   
   Cond: AHEAD     restrict? branchmark, ;Cond
   Cond: IF        restrict? ?branchmark, ;Cond
   Cond: THEN      restrict? sys? branchto, branchtoresolve, ;Cond
   Cond: ELSE      restrict? sys? compile AHEAD swap compile THEN ;Cond
   
   Cond: BEGIN     restrict? branchtomark, ;Cond
   Cond: WHILE     restrict? sys? compile IF swap ;Cond
   Cond: AGAIN     restrict? sys? branch, ;Cond
   Cond: UNTIL     restrict? sys? ?branch, ;Cond
   Cond: REPEAT    restrict? over 0= ?struc compile AGAIN compile THEN ;Cond
   
   Cond: CASE      restrict? 0 ;Cond
   Cond: OF        restrict? 1+ >r compile over compile =
                   compile IF compile drop r> ;Cond
   Cond: ENDOF     restrict? >r compile ELSE r> ;Cond
   Cond: ENDCASE   restrict? compile drop 0 ?DO  compile THEN  LOOP ;Cond
   
 \ Structural Conditionals                              12dec92py  \ Structural Conditionals                              12dec92py
   
 Cond: DO        restrict? compile (do)   T here H ;Cond  Cond: DO        restrict? compile (do)   T here H ;Cond
 Cond: ?DO       restrict? compile (?do)  (leave T here H ;Cond  Cond: ?DO       restrict? compile (?do)  T (leave here H ;Cond
 Cond: FOR       restrict? compile (for)  T here H ;Cond  Cond: FOR       restrict? compile (for)  T here H ;Cond
   
 >CROSS  >CROSS
 : loop]   dup <resolve cell - compile DONE compile unloop ;  : loop]   dup <resolve tcell - compile DONE compile unloop ;
 >TARGET  >TARGET
   
 Cond: LOOP      restrict? sys? compile (loop)  loop] ;Cond  Cond: LOOP      restrict? sys? compile (loop)  loop] ;Cond
 Cond: +LOOP     restrict? sys? compile (+loop) loop] ;Cond  Cond: +LOOP     restrict? sys? compile (+loop) loop] ;Cond
 Cond: NEXT      restrict? sys? compile (next)  loop] ;Cond  Cond: NEXT      restrict? sys? compile (next)  loop] ;Cond
   
   [THEN]
   
 \ String words                                         23feb93py  \ String words                                         23feb93py
   
 : ,"            [char] " parse string, T align H ;  : ,"            [char] " parse T string, align H ;
   
 Cond: ."        restrict? compile (.")     T ," H ;Cond  Cond: ."        restrict? compile (.")     T ," H ;Cond
 Cond: S"        restrict? compile (S")     T ," H ;Cond  Cond: S"        restrict? compile (S")     T ," H ;Cond
Line 796  Cond: IS        T ' >body H compile ALit Line 1567  Cond: IS        T ' >body H compile ALit
 Cond: TO        T ' >body H compile ALiteral compile ! ;Cond  Cond: TO        T ' >body H compile ALiteral compile ! ;Cond
 : TO            T ' >body ! H ;  : TO            T ' >body ! H ;
   
   Cond: defers    T ' >body @ compile, H ;Cond
   : on            T -1 swap ! H ; 
   : off           T 0 swap ! H ;
   
 \ LINKED ERR" ENV" 2ENV"                                18may93jaw  \ LINKED ERR" ENV" 2ENV"                                18may93jaw
   
 \ linked list primitive  \ linked list primitive
 : linked        T here over @ A, swap ! H ;  : linked        T here over @ A, swap ! H ;
   : chained       T linked A, H ;
   
 : err"   s" ErrLink linked" evaluate T , H  : err"   s" ErrLink linked" evaluate T , H
          [char] " parse string, T align H ;           [char] " parse T string, align H ;
   
 : env"  [char] " parse s" EnvLink linked" evaluate  : env"  [char] " parse s" EnvLink linked" evaluate
         string, T align , H ;          T string, align , H ;
   
 : 2env" [char] " parse s" EnvLink linked" evaluate  : 2env" [char] " parse s" EnvLink linked" evaluate
         here >r string, T align , , H          here >r T string, align , , H
         r> dup T c@ H 80 and swap T c! H ;          r> dup T c@ H 80 and swap T c! H ;
   
 \ compile must be last                                 22feb93py  \ compile must be last                                 22feb93py
Line 835  also minimal Line 1611  also minimal
   
 \ define new [IFDEF] and [IFUNDEF]                      20may93jaw  \ define new [IFDEF] and [IFUNDEF]                      20may93jaw
   
 : there? bl word gfind IF >magic @ <fwd> <> ELSE drop false THEN ;  : defined? defined? ;
   : needed? needed? ;
   : doer? doer? ;
   
 : [IFDEF] there? postpone [IF] ;  \ we want to use IFDEF on compiler directives (e.g. E?) in the source, too
 : [IFUNDEF] there? 0= postpone [IF] ;  
   : directive? 
     bl word count [ ' target >wordlist ] aliteral search-wordlist 
     dup IF nip THEN ;
   
   : [IFDEF]  >in @ directive? swap >in !
              0= IF defined? ELSE name 2drop true THEN
              postpone [IF] ;
   
   : [IFUNDEF] defined? 0= postpone [IF] ;
   
 \ C: \- \+ Conditional Compiling                         09jun93jaw  \ C: \- \+ Conditional Compiling                         09jun93jaw
   
 : C: >in @ there? 0=  : C: >in @ defined? 0=
      IF    >in ! T : H       IF    >in ! T : H
      ELSE drop       ELSE drop
         BEGIN bl word dup c@          BEGIN bl word dup c@
Line 854  also minimal Line 1641  also minimal
   
 also minimal  also minimal
   
 : \- there? IF postpone \ THEN ;  \G doesn't skip line when bit is set in debugmask
 : \+ there? 0= IF postpone \ THEN ;  : \D name evaluate debugmasksource @ and 0= IF postpone \ THEN ;
   
   \G interprets the line if word is not defined
   : \- defined? IF postpone \ THEN ;
   
   \G interprets the line if word is defined
   : \+ defined? 0= IF postpone \ THEN ;
   
   Cond: \- \- ;Cond
   Cond: \+ \+ ;Cond
   Cond: \D \D ;Cond
   
   : ?? bl word find IF execute ELSE drop 0 THEN ;
   
   : needed:
   \G defines ghost for words that we want to be compiled
     BEGIN >in @ bl word c@ WHILE >in ! ghost drop REPEAT drop ;
   
 : [IF]   postpone [IF] ;  : [IF]   postpone [IF] ;
 : [THEN] postpone [THEN] ;  : [THEN] postpone [THEN] ;
Line 867  Cond: [IFUNDEF] [IFUNDEF] ;Cond Line 1670  Cond: [IFUNDEF] [IFUNDEF] ;Cond
 Cond: [THEN]    [THEN] ;Cond  Cond: [THEN]    [THEN] ;Cond
 Cond: [ELSE]    [ELSE] ;Cond  Cond: [ELSE]    [ELSE] ;Cond
   
 \ save-cross                                           17mar93py  previous
   
 \ i'm not interested in bigforth features this time    10may93jaw  
 \ [IFDEF] file  
 \ also file  
 \ [THEN]  
 \ included throw after create-file                     11may93jaw  
   
 bigendian Constant bigendian  \ save-cross                                           17mar93py
   
   >CROSS
 Create magic  s" Gforth10" here over allot swap move  Create magic  s" Gforth10" here over allot swap move
   
 char 1 bigendian + cell + magic 7 + c!  char 1 bigendian + tcell + magic 7 + c!
   
 : save-cross ( "image-name" "binary-name" -- )  : save-cross ( "image-name" "binary-name" -- )
   bl parse ." Saving to " 2dup type cr    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    TNIL IF
   bl parse r@ write-file throw        s" #! "   r@ write-file throw
   s"  -i"  r@ write-file throw        bl parse  r@ write-file throw
   #lf      r@ emit-file throw        s"  -i"   r@ write-file throw
   r@ dup file-position throw drop 8 mod 8 swap ( file-id limit index )        #lf       r@ emit-file throw
   ?do        r@ dup file-position throw drop 8 mod 8 swap ( file-id limit index )
       bl over emit-file throw        ?do
   loop            bl over emit-file throw
   drop        loop
   magic 8       r@ write-file throw \ write magic        drop
   image @ there r@ write-file throw \ write image        magic 8       r@ write-file throw \ write magic
   bit$  @ there 1- cell>bit rshift 1+    ELSE
         bl parse 2drop
     THEN
     image @ there 
     r@ write-file throw \ write image
     TNIL IF
         bit$  @ there 1- tcell>bit rshift 1+
                 r@ write-file throw \ write tags                  r@ write-file throw \ write tags
     THEN
     r> close-file throw ;
   
   : save-region ( addr len -- )
     bl parse w/o bin create-file throw >r
     swap image @ + swap r@ write-file throw
   r> close-file throw ;    r> close-file throw ;
   
 \ words that should be in minimal  \ words that should be in minimal
   
 : + + ;         : 1- 1- ;  create s-buffer 50 chars allot
 : - - ;         : 2* 2* ;  
 : * * ;         : / / ;  >MINIMAL
 : dup dup ;     : over over ;  also minimal
 : swap swap ;   : rot rot ;  
 : drop drop ;   : =   = ;  
 : lshift lshift ; : 2/ 2/ ;  
 : . . ;  
 cell constant cell  
   
 \ include bug5.fs  bigendian Constant bigendian
 \ only forth also minimal definitions  : here there ;
   : >ram >ram ;
   : >rom >rom ;
   : >auto >auto ;
   : >tempdp >tempdp ;
   : tempdp> tempdp> ;
   : const constflag on ;
   : warnings name 3 = 0= twarnings ! drop ;
   
   
   : save-cross save-cross ;
   : save-region save-region ;
   : tdump swap >image swap dump ;
   
   also forth 
   [IFDEF] Label           : Label defempty? Label ; [THEN] 
   [IFDEF] start-macros    : start-macros defempty? start-macros ; [THEN]
   [IFDEF] builttag        : builttag builttag ;   [THEN]
   previous
   
   : s" [char] " parse s-buffer place s-buffer count ; \ for environment?
   : + + ;
   : 1+ 1 + ;
   : 2+ 2 + ;
   : or or ;
   : 1- 1- ;
   : - - ;
   : and and ;
   : or or ;
   : 2* 2* ;
   : * * ;
   : / / ;
   : dup dup ;
   : over over ;
   : swap swap ;
   : rot rot ;
   : drop drop ;
   : =   = ;
   : 0=   0= ;
   : lshift lshift ;
   : 2/ 2/ ;
   : . . ;
   
 : \  postpone \ ;  : all-words    ['] false    IS skip? ;
 : \G postpone \G ;  : needed-words ['] needed?  IS skip? ;
 : (  postpone ( ;  : undef-words  ['] defined? IS skip? ;
   
   : \  postpone \ ;  immediate
   : \G T-\G ; immediate
   : (  postpone ( ;  immediate
 : include bl word count included ;  : include bl word count included ;
   : require require ;
 : .( [char] ) parse type ;  : .( [char] ) parse type ;
   : ." [char] " parse type ;
 : cr cr ;  : cr cr ;
   
 : times 0 ?DO dup T c, H LOOP drop ; \ used for space table creation  : times 0 ?DO dup T c, H LOOP drop ; \ used for space table creation
Line 930  only forth also minimal definitions Line 1782  only forth also minimal definitions
 : hex           hex ;  : hex           hex ;
   
 : tudp          T tudp H ;  : tudp          T tudp H ;
 : tup           T tup H ;  minimal  : tup           T tup H ;
   
   : doc-off       false T to-doc H ! ;
   : doc-on        true  T to-doc H ! ;
   [IFDEF] dbg : dbg dbg ; [THEN]
   
   minimal
   
 \ for debugging...  \ for debugging...
 : order         order ;  : order         order ;
 : words         words ;  : hwords         words ;
   : words         also ghosts words previous ;
 : .s            .s ;  : .s            .s ;
   
 : bye           bye ;  : bye           bye ;
   
 \ turnkey direction  \ turnkey direction
Line 952  only forth also minimal definitions Line 1810  only forth also minimal definitions
 : lock   turnkey ;  : lock   turnkey ;
 : unlock forth also cross ;  : unlock forth also cross ;
   
   : [[ also unlock ;
   : ]] previous previous ;
   
 unlock definitions also minimal  unlock definitions also minimal
 : lock   lock ;  : lock   lock ;
 lock  lock

Removed from v.1.36  
changed lines
  Added in v.1.52


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>