Adding posix signal handling.

This commit is contained in:
Brad Nelson
2022-12-31 16:21:43 -08:00
parent f77a65ce3c
commit 5afdbf0423
9 changed files with 57 additions and 10 deletions

View File

@ -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 ;