Ooh, I used to play around a lot with DEBUG.EXE when I was like 12. To this day, almost without looking at the keyboard, I can enter some assembly that enters Mode 13h and draws stuff on screen.
These days, I sometimes play with it to debug a pet project (Lithium, an x86 assembler and toy Lisp compiler targetting bare metal and .COM binaries, written in Clojure). And sometimes I discover things I wasn’t aware of: https://blog.danieljanus.pl/2014/04/06/dos-debugging-quirk/
Modified OP's code to add more steps to see some stepping through but T makes the program run all the way to termination - https://i.imgur.com/hiYeC2x.png
Do you know why in nathell's link the first t does not stop at mov bp,sp? It stops at other lines but not that one. Could that be a buggy emulator too?
I think the UI is just confusing. T means „execute the instruction at CS:IP, advance IP and display the next instruction to execute”. So the first T executes the first instruction but displays the second.
I'm a serious retro-computing fan, and as a result of my activism one of my sons friends has re-discovered his families Commodore PC-20-II DOS PC in the attic.
We resurrected it with great joy and interest as to what we would find on this machine - apparently it had been in his family since it was bought, brand new, back to his grandfathers house, where it was used for a few months (!) before being 'put in the attic because it was broken'.
So, we dig it out, boot it up, and try to figure out what exactly is broken. I immediately notice that any .COM file I execute gradually gets bigger .. yes, its got one of the very first TSR .COM infecting viruses on it, and thats why granddad put it in the attic ..
So we have now isolated it and gotten it booting, and are using the onboard DEBUG.COM to attack the virus, neutralize it, control it and see what else we can do with it. Just the presence of DEBUG.COM alone has made this an exciting and fun project for the kids, who are learning all about filesystems and DOS .com/.exe differences, and TSR's and BIOS calls and so on ..
This aspect of FUN is seriously missing from modern computers!
I think what is missing is the ability to really influence "what the computer does" with the tools it got shipped with. Yes, it is no problem to just download python or scratch or what else, but what is missing is the feeling i got on my C64 when it first booted: This opportunity to just start to play around, write little programs and just directly tell the machine "what to do".
Oh, this makes me remember that I had a 386 PC with the "yanke doodle" virus on it, which was fairly harmless and just played a song once a month on the speaker.
I lived with the virus and at one point I printed all the assembly in it with my matrix printer and tried reverse engineering it. But it was just way too much code for me to understand it all.
I could write symbolic assembly within Nokolisp. Sentences were feeded straight into DEBUG and
numbers were absolute addresses within COM-file. This is superfast fibonacci.
It was trivially easy back in the day to use DOS DEBUG to rewrite COMMAND.COM so that instead of giving an error message like "Command not understood" or whatever the default was, it instead responded with, eg:
"My hovercraft is full of eels"
The height of school humour. As long as the replacement was shorter than the original it was just a text substitution.
I did something similar. I ended acting as a human two-pass assembler before I before I got a real assembler.
My source was in text files. I'd script them into DEBUG to assemble them just like in the article. I'd put NOPs in place of branching instructions, script the source into DEBUG, and then use the output to get the calculated offsets for the intended branches. Then I'd go back and put the branches and offsets into the code.
Nothing frustrated me more than having to insert code and recalculate all subsequent branches. I ended up peppering a lot of NOPs into my early programs so I'd have "spare" bytes to use for instructions I needed to add.
Getting a real assembler made a huge difference in my workflow. Translating DEBUG scripts into MASM/TASM-compatible source wasn't awful either.
This is going to be ridiculous, but I didn't know that DEBUG.EXE (or DEBUG.COM as I remember it?) could be used to assemble! (maybe my version couldn't, now that I think of it). I found it when I was a 10 year old, and I could only use it to disassemble memory, and input hex values into memory. So I would write my program on paper, hand assemble it, and then enter the hex codes into debug.com. If it crashed, too bad, I would have to reenter it all over again.
I did have a lot of time away from the computer (my parents only allowed one hour per day), so this was overall a pretty good workflow. I did learn a fair amount doing this.
I thought everyone did this at that point in time.
The most interesting thing I did with debug.exe was to remove the silly write protection our schools PCs had in 7-8th grade and the installed some shareware (I think!) C++ compiler that I had found one the front page of a magazine. I didn't even really program C++ back then, mostly assembly and basic.
Removing the write protection was as simple as overwriting an ISR or something similar. It took very little time anyway.
I remember that in the first chapters of their Assembly Language Book, Peter Norton and John Socha used DEBUG to teach the principles of assembler and build a few simple programs. After this introduction, they moved to MASM and TASM for the remaining chapters.
These days, I sometimes play with it to debug a pet project (Lithium, an x86 assembler and toy Lisp compiler targetting bare metal and .COM binaries, written in Clojure). And sometimes I discover things I wasn’t aware of: https://blog.danieljanus.pl/2014/04/06/dos-debugging-quirk/