Adding posix signal handling.
This commit is contained in:
12
common/io.fs
12
common/io.fs
@ -104,9 +104,13 @@ sp0 'stack-cells @ 2 3 */ cells + constant sp-limit
|
||||
: evaluate ( a n -- ) 'tib @ >r #tib @ >r >in @ >r
|
||||
#tib ! 'tib ! 0 >in ! evaluate-buffer
|
||||
r> >in ! r> #tib ! r> 'tib ! ;
|
||||
: quit begin ['] evaluate-buffer catch
|
||||
if 0 state ! sp0 sp! fp0 fp! rp0 rp! ." ERROR" cr then
|
||||
prompt refill drop again ;
|
||||
: evaluate&fill
|
||||
begin >in @ #tib @ >= if prompt refill drop then evaluate-buffer again ;
|
||||
: quit
|
||||
#tib @ >in !
|
||||
begin ['] evaluate&fill catch
|
||||
if 0 state ! sp0 sp! fp0 fp! rp0 rp! ." ERROR " cr then
|
||||
again ;
|
||||
variable boot-prompt
|
||||
: free. ( nf nu -- ) 2dup swap . ." free + " . ." used = " 2dup + . ." total ("
|
||||
over + 100 -rot */ n. ." % free)" ;
|
||||
@ -114,4 +118,4 @@ variable boot-prompt
|
||||
boot-prompt @ if boot-prompt @ execute then
|
||||
." Forth dictionary: " remaining used free. cr
|
||||
." 3 x Forth stacks: " 'stack-cells @ cells . ." bytes each" cr
|
||||
prompt refill drop quit ;
|
||||
quit ;
|
||||
|
||||
Reference in New Issue
Block a user