I was going through a backup of my dos machine, taken in 1998, and came across some source code which I haven’t seen for a long time. It was great to see that old code, and I must set-up a machine so that I can run some of it again. In particular I came across an attempt at writing the world’s smallest communication program for an x86 based PC running DOS. I used to love writing these sort of little programs to test different things. I know we get more done these days, but it was fun tinkering around at such a low-level. So here follows the program.
The Assembly Code
The following code was written, for Borland Turbo Assembler, when I was 17. It maybe that, with experience, I could now write a smaller version, so my boast of 15 years ago may no longer be true!
I used Borland Turbo Assembler to assemble this file and produce an executable
If you don’t have this assembler, the source can easily be converted to the format of your favourite assembler.
Using Debug to Create the Executable
For those not able to assemble the above code, I created a script with
HEXBUG which can be run through the DOS command,
debug, which will create the executable
Copy the following script into
Run this script through debug:
Using the Program
This program is very simple, as you can see, and operates on COM2. It is so small because it relies on your ability to command the modem directly.
To run it just type:
Commanding a Hayes Compatible Modem
To reset the modem:
To dial a number, where number is the number that you wish to dial:
Operating Once the Connection Has Been Established
Once the number has been dialed, by using the above commands, the modem will establish the connection and you will be linked to the computer on the other end of the modem. Most dial-up systems, however, use a variety of terminal emulations to control how to display things on your screen, so you will have to use a basic plain text protocol.
I once had an old machine on which the 5¼" drive wasn’t working, so I couldn’t transfer anything to or from it. I had no other drive with me to replace it, so I connected the machine to another using a null-modem cable. I then entered a slightly altered version of the above program, using debug, into both machines. This allowed me to redirect it’s output to a file on one end, and send a serial transfer program to it from the other end. To make this transfer reliable enough, all I had to do was slow the COM port down with the DOS command
mode. For these sorts of transfers, if nothing else, the program could still be of some use to those operating older machines.