Diff for /gforth/prims2x.fs between versions 1.75 and 1.78

version 1.75, 2001/01/24 13:53:32 version 1.78, 2001/02/07 09:58:46
Line 50  warnings off Line 50  warnings off
 include ./search.fs                       include ./search.fs                     
 include ./extend.fs  include ./extend.fs
 [THEN]  [THEN]
   include ./stuff.fs
   
 [IFUNDEF] environment?  [IFUNDEF] environment?
 include ./environ.fs  include ./environ.fs
Line 178  create stacks max-stacks cells allot \ a Line 179  create stacks max-stacks cells allot \ a
         i xt execute          i xt execute
     item% %size +loop ;      item% %size +loop ;
   
   \ types
   
   : print-type-prefix ( type -- )
       body> >head name>string type ;
   
 \ various variables for storing stuff of one primitive  \ various variables for storing stuff of one primitive
   
 struct%  struct%
Line 253  Variable function-number 0 function-numb Line 259  Variable function-number 0 function-numb
     item item-stack @ dup >r stack-in @ ( in-size r:stack )      item item-stack @ dup >r stack-in @ ( in-size r:stack )
     item r> stack-in-index-xt @ execute ;      item r> stack-in-index-xt @ execute ;
   
   : item-stack-type-name ( item -- addr u )
       item-stack @ stack-type @ type-c-name 2@ ;
   
 : fetch-single ( item -- )  : fetch-single ( item -- )
  \ fetch a single stack item from its stack   \ fetch a single stack item from its stack
  >r   >r
  r@ item-name 2@ type   r@ item-name 2@ type
  ."  = ("    ."  = vm_" r@ item-stack-type-name type
  r@ item-type @ type-c-name 2@ type ." ) "   ." 2" r@ item-type @ print-type-prefix ." ("
  r@ item-in-index r@ item-stack @ stack-access   r@ item-in-index r@ item-stack @ stack-access
  ." ;" cr   ." );" cr
  rdrop ;    rdrop ; 
   
 : fetch-double ( item -- )  : fetch-double ( item -- )
  \ fetch a double stack item from its stack   \ fetch a double stack item from its stack
  >r   >r
  ." FETCH_DCELL("   ." vm_two"
    r@ item-stack-type-name type ." 2"
    r@ item-type @ print-type-prefix ." ("
  r@ item-name 2@ type ." , "   r@ item-name 2@ type ." , "
  r@ item-in-index r@ item-stack @ 2dup ." (Cell)" stack-access   r@ item-in-index r@ item-stack @ 2dup ." (Cell)" stack-access
  ." , "                      -1 under+ ." (Cell)" stack-access   ." , "                      -1 under+ ." (Cell)" stack-access
Line 296  Variable function-number 0 function-numb Line 307  Variable function-number 0 function-numb
   
 : really-store-single ( item -- )  : really-store-single ( item -- )
  >r   >r
  r@ item-out-index r@ item-stack @ stack-access ."  = "   r@ item-out-index r@ item-stack @ stack-access ."  = vm_"
  r@ item-stack @ stack-cast 2@ type   r@ item-type @ print-type-prefix ." 2"
  r@ item-name 2@ type ." ;"   r@ item-stack-type-name type ." ("
    r@ item-name 2@ type ." );"
  rdrop ;   rdrop ;
   
 : store-single ( item -- )  : store-single ( item -- )
Line 318  Variable function-number 0 function-numb Line 330  Variable function-number 0 function-numb
 : store-double ( item -- )  : store-double ( item -- )
 \ !! store optimization is not performed, because it is not yet needed  \ !! store optimization is not performed, because it is not yet needed
  >r   >r
  ." STORE_DCELL(" r@ item-name 2@ type ." , "   ." vm_"
    r@ item-type @ print-type-prefix ." 2two"
    r@ item-stack-type-name type ." ("
    r@ item-name 2@ type ." , "
  r@ item-out-index r@ item-stack @ 2dup stack-access   r@ item-out-index r@ item-stack @ 2dup stack-access
  ." , "                       -1 under+ stack-access   ." , "                       -1 under+ stack-access
  ." );" cr   ." );" cr
Line 422  s" Cell"  single 0 create-type cell-type Line 437  s" Cell"  single 0 create-type cell-type
 s" Float" single 0 create-type float-type  s" Float" single 0 create-type float-type
   
 s" sp" save-mem cell-type  s" (Cell)" make-stack data-stack   s" sp" save-mem cell-type  s" (Cell)" make-stack data-stack 
 s" fp" save-mem cell-type  s" "       make-stack fp-stack  s" fp" save-mem float-type s" "       make-stack fp-stack
 s" rp" save-mem float-type s" (Cell)" make-stack return-stack  s" rp" save-mem cell-type  s" (Cell)" make-stack return-stack
 s" IP" save-mem cell-type  s" error don't use # on results" make-stack inst-stream  s" IP" save-mem cell-type  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 530  s" IP" save-mem cell-type  s" error don' Line 545  s" IP" save-mem cell-type  s" error don'
     repeat      repeat
     2drop type ;      2drop type ;
   
 : print-type-prefix ( type -- )  
     body> >head .name ;  
   
 : print-debug-arg { item -- }  : print-debug-arg { item -- }
     ." fputs(" quote space item item-name 2@ type ." =" quote ." , vm_out); "      ." fputs(" quote space item item-name 2@ type ." =" quote ." , vm_out); "
     ." printarg_" item item-type @ print-type-prefix      ." printarg_" item item-type @ print-type-prefix

Removed from v.1.75  
changed lines
  Added in v.1.78


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