Diff for /gforth/prims2x.fs between versions 1.120 and 1.123

version 1.120, 2002/10/12 19:06:37 version 1.123, 2002/12/27 15:51:28
Line 95  variable include-skipped-insts Line 95  variable include-skipped-insts
 \ inline arguments (false)  \ inline arguments (false)
 include-skipped-insts off  include-skipped-insts off
   
   variable immarg \ values for immediate arguments (to be used in IMM_ARG macros)
   $12340000 immarg !
   
 : th ( addr1 n -- addr2 )  : th ( addr1 n -- addr2 )
     cells + ;      cells + ;
   
Line 325  Variable function-number 0 function-numb Line 328  Variable function-number 0 function-numb
 : complement ( set1 -- set2 )  : complement ( set1 -- set2 )
  empty ['] bit-equivalent binary-set-operation ;   empty ['] bit-equivalent binary-set-operation ;
   
   \ forward declaration for inst-stream (breaks cycle in definitions)
   defer inst-stream-f ( -- stack )
   
 \ stack access stuff  \ stack access stuff
   
 : normal-stack-access ( n stack -- )  : normal-stack-access1 ( n stack -- )
     stack-pointer 2@ type      stack-pointer 2@ type
     dup      dup
     if      if
Line 336  Variable function-number 0 function-numb Line 342  Variable function-number 0 function-numb
         drop ." TOS"          drop ." TOS"
     endif ;      endif ;
   
 \ forward declaration for inst-stream (breaks cycle in definitions)  : normal-stack-access ( n stack -- )
 defer inst-stream-f ( -- stack )      dup inst-stream-f = if
           ." IMM_ARG(" normal-stack-access1 ." ," immarg ? ." )"
           1 immarg +!
       else
           normal-stack-access1
       endif ;
   
 : stack-depth { stack -- n }  : stack-depth { stack -- n }
     current-depth stack stack-number @ th @ ;      current-depth stack stack-number @ th @ ;
Line 658  stack inst-stream IP Cell Line 669  stack inst-stream IP Cell
     prim prim-effect-in prim prim-effect-in-end @ ['] fetch map-items ;      prim prim-effect-in prim prim-effect-in-end @ ['] fetch map-items ;
   
 : stack-pointer-update { stack -- }  : stack-pointer-update { stack -- }
     \ stack grow downwards      \ stacks grow downwards
     stack stack-diff      stack stack-diff
     ?dup-if \ this check is not necessary, gcc would do this for us      ?dup-if \ this check is not necessary, gcc would do this for us
         stack inst-stream = if          stack inst-stream = if
Line 714  stack inst-stream IP Cell Line 725  stack inst-stream IP Cell
     2drop ;      2drop ;
   
 : output-label2 ( -- )  : output-label2 ( -- )
     ." LABEL2(" prim prim-c-name 2@ type ." )" cr ;      ." LABEL2(" prim prim-c-name 2@ type ." )" cr
       ." NEXT_P2;" cr ;
   
 : output-c-tail1 { xt -- }  : output-c-tail1 { xt -- }
     \ the final part of the generated C code, with xt printing LABEL2 or not.      \ the final part of the generated C code, with xt printing LABEL2 or not.
Line 723  stack inst-stream IP Cell Line 735  stack inst-stream IP Cell
     ." NEXT_P1;" cr      ." NEXT_P1;" cr
     stores      stores
     fill-tos       fill-tos 
     xt execute      xt execute ;
     ." NEXT_P2;" cr ;  
   
 : output-c-tail1-no-stores { xt -- }  : output-c-tail1-no-stores { xt -- }
     \ the final part of the generated C code for combinations      \ the final part of the generated C code for combinations
     output-super-end      output-super-end
     ." NEXT_P1;" cr      ." NEXT_P1;" cr
     fill-tos       fill-tos 
     xt execute      xt execute ;
     ." NEXT_P2;" cr ;  
   
 : output-c-tail ( -- )  : output-c-tail ( -- )
     ['] noop output-c-tail1 ;      ['] noop output-c-tail1 ;
Line 912  stack inst-stream IP Cell Line 922  stack inst-stream IP Cell
 : output-alias ( -- )   : output-alias ( -- ) 
     ( primitive-number @ . ." alias " ) ." Primitive " prim prim-name 2@ type cr ;      ( primitive-number @ . ." alias " ) ." Primitive " prim prim-name 2@ type cr ;
   
 : output-prim-num ( -- )  : output-c-prim-num ( -- )
     prim prim-num @ 8 + 4 .r space prim prim-name 2@ type cr ;      ." #define N_" prim prim-c-name 2@ type prim prim-num @ 8 + 4 .r cr ;
   
 : output-forth ( -- )    : output-forth ( -- )  
     prim prim-forth-code @ 0=      prim prim-forth-code @ 0=
Line 1156  stack inst-stream IP Cell Line 1166  stack inst-stream IP Cell
     r> in-part ! ;      r> in-part ! ;
   
 : part-stack-pointer-updates ( -- )  : part-stack-pointer-updates ( -- )
     max-stacks 0 +do      next-stack-number @ 0 +do
         i part-num @ 1+ s-c-max-depth @ dup          i part-num @ 1+ s-c-max-depth @ dup
         i num-combined @ s-c-max-depth @ =    \ final depth          i num-combined @ s-c-max-depth @ =    \ final depth
         swap i part-num @ s-c-max-depth @ <> \ just reached now          swap i part-num @ s-c-max-depth @ <> \ just reached now

Removed from v.1.120  
changed lines
  Added in v.1.123


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