TD saved the day
»Now what’s that TD supposed to be«, you may ask. It’s the common abbreviation and executable name for Borland’s Turbo Debugger, an easy-to-use DOS-based debugger that was popular in the early 90’s. Your next question might be, »and why should anyone use that in 2007«? Well, to debug DOS programs, of course. »And who writes DOS programs in 2007«? I do – in this special case, it was a 256-byte intro.
The situation was a bit strange: Out of the blue, biff (one of the coders of our demo group) asked me whether I »still know assembly language«. As it turned out, he found some old C program on his hard drive and had the idea to turn it into a 256-byte intro … or rather a 512-byte one, because he was well above the limit :) Anyway, he sent me the code so I could help him with debugging it. The code was far away from readable and highly redundant (even the original C program wasn’t free of questionable parts). I told him that I’d have to rewrite the assembly port from scratch – and all of a sudden, I was back into the good old times of 16-bit assembly :)
I fired up a DOSBox instance for testing and began to make sense of the original C code. I rearranged the data structures for optimal access, wrote the code and voilĂ , I had a final 252 byte executable. Nice, except that it didn’t work and displayed nothing but crap. That’s quite a problem, because in a pure assembly program, you can’t just go ahead and insert printf()
‘s at will …
After some brief brainstorming, biff came up with the magic word: TD. I looked into my old Borland Pascal installation directories, and there it was: TD.EXE, the classic Turbo Debugger in all its textmode-windowed beauty.
Here I could finally do what I longed for: step through the machine code, instruction by instruction, and see how register contents changed. It was truely nostalgic to revive such an old program into productive use :)
By the way, it turned out that there actually was only one bug in the program: two instructions were accidentally swapped. In the end, we had an extremely simple and unoptimized 256-byte effect which we promptly submitted to pouët.net. TD saved the day.