Editing Binaries in DOS (2002)
susam.net
susam.net
Finding extra space for adding code, like the welcome message, was always fun -- although it would be better form to have the code zero out the "borrowed" bytes after the message is written, just in case. Sometimes it was necessary to rewrite the assembly to squeeze in a few more bytes, eg, zeroing a register using an XOR instead of a MOV command with a 0000 parameter.
One could save these patches as text files that were designed to be piped directly into DEBUG.EXE, and these could be distributed -- by floppy, BBS, or printout -- to other users of the same DOS version. This was also a common way to format and distribute assembly language source code, since anyone could use their local copy of DEBUG.EXE to assemble it.
I discovered that my computer's 80186 processor had onboard features that no other x86 processor had: among them, three onboard very high resolution timers. I used one of those timers and a very tight loop to toggle the speaker with a sort of PWM to make it play at different volumes. I didn't really know what I was doing, I should have timed the various instructions and adjusted the timer delay so I could tune the speaker to different frequencies. But I got within spitting distance of being able to play music with some degree of timbre and even polyphony on that thing, which it wasn't designed to do!
Similarly, EDLIN was derived from ED in CP/M which was also a clone of "ed" on Unix. So, EDLIN and VIM are distant cousins. :)
Even MS-DOS 3.3 had better alternatives like QEdit available, with its WordStar shortcuts.