Diff for /gforth/prims2x.fs between versions 1.59 and 1.62

version 1.59, 2000/12/26 20:01:49 version 1.62, 2001/01/06 19:29:14
Line 125  end-struct type% Line 125  end-struct type%
 s" sp" save-mem s" (Cell)" make-stack data-stack   s" sp" save-mem s" (Cell)" make-stack data-stack 
 s" fp" save-mem s" "       make-stack fp-stack  s" fp" save-mem s" "       make-stack fp-stack
 s" rp" save-mem s" (Cell)" make-stack return-stack  s" rp" save-mem s" (Cell)" make-stack return-stack
 s" ip" save-mem s" error don't use # on results" make-stack inst-stream  s" IP" save-mem s" error don't use # on results" make-stack inst-stream
 ' inst-in-index inst-stream stack-in-index-xt !  ' inst-in-index inst-stream stack-in-index-xt !
 \ !! initialize stack-in and stack-out  \ !! initialize stack-in and stack-out
   
Line 383  warnings @ [IF] Line 383  warnings @ [IF]
  >r   >r
  ." FETCH_DCELL("   ." FETCH_DCELL("
  r@ item-name 2@ type ." , "   r@ item-name 2@ type ." , "
  r@ item-in-index r@ item-stack @ 2dup stack-access   r@ item-in-index r@ item-stack @ 2dup ." (Cell)" stack-access
  ." , "                      -1 under+ stack-access   ." , "                      -1 under+ ." (Cell)" stack-access
  ." );" cr   ." );" cr
  rdrop ;   rdrop ;
   
Line 672  does> ( item -- ) Line 672  does> ( item -- )
     ." } else "      ." } else "
     1 function-number +! ;      1 function-number +! ;
   
   
   
   
   : gen-arg-parm { item -- }
       item item-stack @ inst-stream = if
           ." , " item item-type @ type-c-name 2@ type space
           item item-name 2@ type
       endif ;
   
   : gen-args-parm ( -- )
    effect-in-end @ effect-in ?do
      i gen-arg-parm
    item% %size +loop ; 
   
   : gen-arg-gen { item -- }
       item item-stack @ inst-stream = if
           ."   genarg_" item item-type @ print-type-prefix
           ." (ctp, " item item-name 2@ type ." );" cr
       endif ;
   
   : gen-args-gen ( -- )
    effect-in-end @ effect-in ?do
      i gen-arg-gen
    item% %size +loop ; 
   
   : output-gen ( -- )
       \ generate C code for generating VM instructions
       ." /* " declarations ." */" cr
       compute-offsets
       ." void gen_" c-name 2@ type ." (Inst **ctp" gen-args-parm ." )" cr
       ." {" cr
       ."   gen_inst(ctp, vm_prim[" function-number @ 0 .r ." ]);" cr
       gen-args-gen
       ." }" cr
       1 function-number +! ;
   
 : stack-used? { stack -- f }  : stack-used? { stack -- f }
     stack stack-in @ stack stack-out @ or 0<> ;      stack stack-in @ stack stack-out @ or 0<> ;
   
Line 762  does> ( item -- ) Line 798  does> ( item -- )
   
 : process-file ( addr u xt -- )  : process-file ( addr u xt -- )
     >r      >r
     2dup filename 2!      save-mem 2dup filename 2!
     0 function-number !      0 function-number !
     r/o open-file abort" cannot open file"      r/o open-file abort" cannot open file"
     warnings @ if      warnings @ if

Removed from v.1.59  
changed lines
  Added in v.1.62


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