--- gforth/Attic/kernel.fs 1997/02/09 21:51:39 1.15 +++ gforth/Attic/kernel.fs 1997/03/25 23:27:13 1.21 @@ -68,7 +68,8 @@ NIL AConstant NIL \ gforth \ Aliases -' i Alias r@ +' i Alias r@ ( -- w ; R: w -- w ) \ core r-fetch +\ copy w from the return stack to the data stack \ Bit string manipulation 06oct92py @@ -264,7 +265,7 @@ Defer source ( -- addr count ) \ core : (compile) ( -- ) \ gforth r> dup cell+ >r @ compile, ; -: postpone, ( w xt -- ) +: postpone, ( w xt -- ) \ gforth postpone-comma \g Compiles the compilation semantics represented by @var{w xt}. dup ['] execute = if @@ -489,7 +490,7 @@ Defer 'throw : throw ( y1 .. ym error/0 -- y1 .. ym / z1 .. zn error ) \ exception ?DUP IF - [ here 9 cells ! ] \ entry point for signal handler + [ has-header [IF] here 9 cells ! [THEN] ] \ entry point for signal handler handler @ dup 0= IF [ has-os [IF] ] 2 (bye) @@ -747,9 +748,9 @@ Create ??? 0 , 3 c, char ? c, char ? c, : !does ( addr -- ) \ gforth store-does lastxt does-code! ; : (does>) ( R: addr -- ) - r> /does-handler + !does ; + r> cfaligned /does-handler + !does ; : dodoes, ( -- ) - here /does-handler allot does-handler! ; + cfalign here /does-handler allot does-handler! ; doer? :dovar [IF] : Create ( "name" -- ) \ core @@ -961,7 +962,7 @@ end-struct interpret/compile-struct then then ; -: find ( c-addr -- xt +-1 / c-addr 0 ) \ core +: find ( c-addr -- xt +-1 / c-addr 0 ) \ core,search dup count sfind dup if rot drop @@ -1037,7 +1038,10 @@ G -1 warnings T ! 0C constant #ff ( -- c ) \ gforth 0A constant #lf ( -- c ) \ gforth -: bell #bell emit ; +: bell ( -- ) \ gforth + \g makes a beep and flushes the output buffer + #bell emit + outfile-id flush-file drop ; : cr ( -- ) \ core \ emit a newline #lf ( sic! ) emit ; @@ -1261,6 +1265,7 @@ DEFER DOERROR ; : (DoError) ( throw-code -- ) + [ has-os [IF] ] outfile-id >r stderr to outfile-id [ [THEN] ] sourceline# IF source >in @ sourceline# 0 0 .error-frame THEN @@ -1282,7 +1287,9 @@ DEFER DOERROR ELSE .error THEN - normal-dp dpp ! ; + normal-dp dpp ! + [ has-os [IF] ] r> to outfile-id [ [THEN] ] +; ' (DoError) IS DoError @@ -1301,7 +1308,10 @@ DEFER DOERROR \ : .name ( name -- ) name>string type space ; \ : words listwords @ \ BEGIN @ dup WHILE dup .name REPEAT drop ; -Defer 'cold ' noop IS 'cold +Defer 'cold ( -- ) \ gforth tick-cold +\ hook (deferred word) for things to do right before interpreting the +\ command-line arguments +' noop IS 'cold : cold ( -- ) \ gforth [ has-files [IF] ]