VolksForth/msdos/tools.fb

1 line
12 KiB
Plaintext
Raw Normal View History

2017-04-23 22:25:49 +00:00
\ ks 22 dez 87 Some simple tools for debugging. A state-of-the-art, interactive single step tracer and a couple of tools for decompiling and dumping \ Trace Loadscreen ks cas 25sep16 Onlyforth \needs Assembler 2 loadfrom asm.fb Vocabulary Tools Tools also definitions 1 9 +thru Onlyforth .( Tools geladen) cr \ trace - next ks 11 jun 87 | Variable nest? nest? off Label tracenext 0 # nest? #) byte cmp 0= ?[ $5555 # I cmp here 2- >label (ip >= ?[ [[ swap lods A W xchg W ) jmp ]? $5555 # I cmp here 2- >label ip) CS ?] ][ 0 # nest? #) byte mov ]? $5555 # W mov here 2- >label >tracing W ) jmp end-code | (ip Constant <ip | ip) Constant ip> | : (debug ( addr -- ) dup <ip ! BEGIN 1+ dup @ ['] unnest = UNTIL 2+ ip> ! ; \ install Tracer ks 11 jun 87 Label (do-trace next-link # W mov D push $E9 # A- mov tracenext 1+ # C mov [[ W ) W mov W W or 0= not ?[[ A- -4 W D) mov C D mov W D sub D -3 W D) mov ]]? D pop ret end-code Code do-trace (do-trace # call Next end-code ' end-trace Alias end-trace | Code (step (do-trace # call R ) I mov R inc R inc lods A W xchg W ) jmp | Create: nextstep (step ;