PC magazines used to publish source code listings for little utilities in the form of DEBUG scripts.
For those who want to re-live the moment, look at this PDF starting on internal page 873 (file page 894): http://vtda.org/books/Computing/OperatingSystems/DOSPowerToo...