From 5360aef59bc866d6521d81f67f7a39f6b86745e4 Mon Sep 17 00:00:00 2001 From: Nihilazo Date: Fri, 19 Mar 2021 16:10:51 +0000 Subject: [PATCH] add debugging stuff --- debug.fs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 debug.fs 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 ;