diff --git a/debug.fs b/debug.fs new file mode 100644 index 0000000..7952c7e --- /dev/null +++ b/debug.fs @@ -0,0 +1,23 @@ +\ debug.fs contains functions overwritten from the debug.fs in gforth, +\ to make debugging floatingpoint stuff easier. + +: (_debug) ( body ip -- ) + 0 Nesting ! + BEGIN Unnest off + cr ." Scanning code..." cr C-Formated on + swap scanword dbg-ip ! + cr ." Nesting debugger ready!" cr + BEGIN .s f.s disp-step D-Key + WHILE C-Stop @ 0= + WHILE 0 get-next set-bp + dbg-ip @ jump + [ here DebugLoop ! ] + restore-bp + REPEAT + Nesting @ 0= IF EXIT THEN + -1 Nesting +! r> + ELSE + get-next >r 1 Nesting +! + THEN + dup + AGAIN ;