The very first "real" program that I wrote (started in 1989, and last updated in 1991: see history.txt for details) was a terminal emulator program for an Amstrad CPC (an 8-bit computer built in 1985) with a serial port (the serial port was an optional add on unit). At the time that I wrote it there were no terminal emulator programs that emulated an ANSI or VT100 terminal, and I wanted to access a public unix system which required such emulation as well as several BBSes that benefited from it.
In addition all of the existing terminal emulation programs available were too slow to keep up with a 2400bps modem streaming display information to the screen, for one reason or another; and I had recently bought a 2400bps modem.
So I wrote my own terminal emulator, in z80 assembly language, taking advantage of all the optimisations that I could find, as well as using things like page-aligned ring buffers for input and output (using a timer driven interrupt routine to do all the input and output.
In April 1991 I released a copy of the program, including the source code as what would now be called an open source program - copyright but with the source available - sent to another Amstrad user in the UK, and also given to a fellow Amstrad user in New Zealand (who used parts of it as the basis for a fancier communication program including dialing directory, file transfer and so on).
In September 2000 I rediscovered the program on the Internet, in a collection of Amstrad CPC "public domain" software, in the form of a disk image for an Amstrad CPC emulator (most emulators don't include serial support, but they do allow reading the disk image). (In theory I still have the disks with the software on, in practice it is dubious whether those disks are still readable.)
So without further comment, here is the oldest "real" program that I wrote, complete with all its embarassing quirks and documentation, and a licence before I discovered the GPL, BSD licence and friends -- rediscovered after nearly a decade. Sometimes releasing the source code really does pay off.