Diff for /gforth/simp-see.fs between versions 1.1 and 1.5

version 1.1, 2001/03/28 09:06:57 version 1.5, 2007/06/23 15:42:31
Line 1 Line 1
 \ simple-minded see (good for seeing what the compiler produces)  \ simple-minded see (good for seeing what the compiler produces)
   
 \ Copyright (C) 2001 Free Software Foundation, Inc.  \ Copyright (C) 2001,2003 Free Software Foundation, Inc.
   
 \ This file is part of Gforth.  \ This file is part of Gforth.
   
Line 20 Line 20
   
 require see.fs  require see.fs
   
 : simple-see-range ( addr1 addr2 -- )  : simple-see-word { addr -- }
       xpos off addr hex. addr cell+ addr @ .word drop ;
   
   : simple-see-range ( addr1 addr2 -- ) \ gforth
     swap u+do      swap u+do
         cr i hex. i cell+ i @ .word drop          cr i simple-see-word
         cell +loop      cell +loop ;
 ;  
   
 : simple-see ( "name" -- )  : simple-see ( "name" -- ) \ gforth
       \G a simple decompiler that's closer to @code{dump} than @code{see}.
     \ !! at the moment NEXT-HEAD is a little too optimistic (see      \ !! at the moment NEXT-HEAD is a little too optimistic (see
     \ comment in HEAD?)      \ comment in HEAD?)
     ' >body dup next-head simple-see-range ;      ' >body dup next-head simple-see-range ;
   
   : see-code-next-inline { addr1 addr2 -- addr3 }
       \ decompile starting at addr1 until an inlined primitive is found,
       \ or addr2 is reached; addr3 is addr2 or the next inlined
       \ primitive
       addr1 begin { addr }
           addr addr2 u< while
               addr @ dup decompile-prim = while
                   addr cr simple-see-word
                   addr cell+
           repeat then
       addr ;
   
   : see-code-range { addr1 addr2 -- } \ gforth
       cr addr1 begin { a }
           a simple-see-word
           a cell+ addr2 see-code-next-inline { b }
           b addr2 u< while
               a @ b @ over - discode
               b
       repeat ;
   
   : see-code ( "name" -- ) \ gforth
   \G like @code{simple-see}, but also shows the dynamic native code for
   \G the inlined primitives (except for the last).
       ' >body dup next-head see-code-range ;
       

Removed from v.1.1  
changed lines
  Added in v.1.5


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