To use this file copy and paste this:
// #URL-lib "http://pin1.org/forthlib/flb/General/decompile.flb" into BV Terminal 3
or here to download.
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// Two main words: Decompiles and Words
// This also contains useful words for looking at the forth
// header
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
//
// HISTORY:
// * v1.15 uses locals
// * aborts if word not found
// HISTORY:
// * v1.15 uses locals
// * aborts if word not found
Full Contents of File
: tab19  emit  ;       
: dc1   
sig
exitaddress       
-
0=  if
        sig  ph.  tab1  ."  Exit"
        v  1-           
else
        v       
then  ;
: dc2a 
    addr  ?c@  32  122  between
    if 
        addr  ?c@  emit 
    else 
        46  emit       
    then
;       
: dc2     
7  0  do
        addr  dc2a
        1  +>  addr
loop 
;
: dc3 
cfa  ph.  tab1 
cfa  12  -  ?@  &f00  and  &900  =     
if                   
        cfa  8  - 
        dc2 
else 
        cfa  ?@  ph.           
then 
cr
;
: <0>decompile   
int#:  exits  1
int:  cfa  cfa-n
depth  0  >  if  =>  exits  then
cr
."  Addr"  tab1   
."  Wrd-Adr"  tab1
."  Name"  tab1
cr
?'    =>  cfa     
cfa  0=  abort"  Word  not  found"
cfa  u.  tab1 
cfa  8  -  stype     
cfa  12  -  @  16  rshift  tab1  ."  Hash  =  "  ph.  cr   
begin
    4  +>  cfa     
    cfa  u.  tab1   
    cfa  ?@  =>  cfa-n       
    exits  cfa-n  dc1  =>  exits 
    exits  0=  if  abort  then   
    cfa-n  dc3             
again   
;
: nfa
        8  +
;
: wtype
        4  +  @  &2000  and
;
: wimed
        4  +  @  &8000  and
;                               
: whead
        cr
        ."  Name        Hash        Type        Immediate"  cr
;
: wline
        dup  nfa  stype  space 
        dup  4  +  @  &ffff0000  and  16  rshift  <#  #  #  #  #  #>  stype  4  spaces
        dup  wtype  if  ."  Code        "  else  ."  Forth      "  then
        wimed  if  ."  Immediate"  then   
;               
: <0>words
        whead
        latest               
        begin
                @  dup  0=  if  drop  escape  then     
                dup  wline  cr 
        again
;           
: hash
        bl  word  toupper  rshash  &0000ffff  and  ph. 
;