[gforth] / gforth / kernel / int.fs  

gforth: gforth/kernel/int.fs

Diff for /gforth/kernel/int.fs between version 1.13 and 1.14

version 1.13, Sat Dec 19 13:43:18 1998 UTC version 1.14, Sat Jan 2 14:03:36 1999 UTC
Line 274 
Line 274 
     (name>x) tuck (x>int) ( b xt )      (name>x) tuck (x>int) ( b xt )
     swap immediate-mask and flag-sign ;      swap immediate-mask and flag-sign ;
   
   : head? ( addr -- f )
       \G heuristic check whether addr is a name token; may deliver false
       \G positives; addr must be a valid address
       \ we follow the link fields and check for plausibility; two
       \ iterations should catch most false addresses: on the first
       \ iteration, we may get an xt, on the second a code address (or
       \ some code), which is typically not in the dictionary.
       2 0 do
           dup @ dup
           if ( addr addr1 )
               dup rot forthstart within
               if \ addr1 is outside forthstart..addr, not a head
                   drop false unloop exit
               then ( addr1 )
           else \ 0 in the link field, no further checks
               2drop true unloop exit
           then
       loop
       \ in dubio pro:
       drop true ;
   
 const Create ???  0 , 3 c, char ? c, char ? c, char ? c,  const Create ???  0 , 3 c, char ? c, char ? c, char ? c,
 \ ??? is used by dovar:, must be created/:dovar  \ ??? is used by dovar:, must be created/:dovar
   
 : >head ( cfa -- nt ) \ gforth  to-name  : >head ( cfa -- nt ) \ gforth  to-head
  $21 cell do      $21 cell do ( cfa )
    dup i - count $9F and + cfaligned over alias-mask + = if          dup i - count $9F and + cfaligned over alias-mask + =
      i - cell - unloop exit          if ( cfa )
               dup i - cell - dup head?
               if
                   nip unloop exit
               then
               drop
    then     then
  cell +loop   cell +loop
  drop ??? ( wouldn't 0 be better? ) ;   drop ??? ( wouldn't 0 be better? ) ;


Generate output suitable for use with a patch program
Legend:
Removed from v.1.13  
changed lines
  Added in v.1.14

CVS Admin

Powered by ViewCVS 1.0-dev
(Powered by ViewCVS)

ViewCVS and CVS Help