add debugging stuff

This commit is contained in:
Nico 2021-03-19 16:10:51 +00:00
parent 5c132631b3
commit 5360aef59b
1 changed files with 23 additions and 0 deletions

23
debug.fs Normal file
View File

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