--- gforth/prims2x.fs 2003/10/16 18:48:03 1.146 +++ gforth/prims2x.fs 2004/01/20 19:07:41 1.149 @@ -535,8 +535,8 @@ defer inst-stream-f ( -- stack ) : store-single { item -- } item item-stack @ { stack } store-optimization @ in-part @ 0= and item same-as-in? and - item item-in-index stack state-in stack-reg 0= and \ in in memory? - item item-out-index stack state-out stack-reg 0= and \ out in memory? + item item-in-index stack state-in stack-reg \ in reg/mem + item item-out-index stack state-out stack-reg = and \ out reg/mem 0= if item really-store-single cr endif ; @@ -716,6 +716,9 @@ stack inst-stream IP Cell default-ss s state-sss i th ! loop ; +: .state ( state -- ) + 0 >body - >name .name ; + : set-ss ( ss stack state -- ) state-sss swap stack-number @ th ! ; @@ -961,7 +964,9 @@ variable tail-nextp2 \ xt to execute for ." LABEL(" prim prim-c-name 2@ type ." )" ; : output-c ( -- ) - print-entry ." /* " prim prim-name 2@ type ." ( " prim prim-stack-string 2@ type ." ) */" cr + print-entry ." /* " prim prim-name 2@ type + ." ( " prim prim-stack-string 2@ type ." ) " + state-in .state ." -- " state-out .state ." */" cr ." /* " prim prim-doc 2@ type ." */" cr ." NAME(" quote prim prim-name 2@ type quote ." )" cr \ debugging ." {" cr @@ -1110,8 +1115,11 @@ variable tail-nextp2 \ xt to execute for : output-alias ( -- ) ( primitive-number @ . ." alias " ) ." Primitive " prim prim-name 2@ type cr ; -: output-c-prim-num ( -- ) +defer output-c-prim-num ( -- ) + +:noname ( -- ) ." N_" prim prim-c-name 2@ type ." ," cr ; +is output-c-prim-num : output-forth ( -- ) prim prim-forth-code @ 0=