Interesting code, serves a real purpose, solves a real problem.
Codewise, the oldest running code probably lives in the banking system or the telephony system. Typically code that has grown over time and can't just be shut down for an upgrade -- "what do you mean close the bank for a week?". Now whatever code runs there has been kept running (bodged?) for decades, but pretty it probably isn't.
It did occur to me that the code running an AT&T 5ESS switch or its current equivalent "should" have those attributes we would hope for, but it might also have become massively over-grown with cruft, not to mention being too large to be grasped by a mere mortal.
or is the OP requesting us to hunt down a piece of code that fulfills his project specs (and does it elegantly, gosh darnit!)?
Is the OP's real name Tom Sawyer?
OP Here: I am a retired Assembler 360 programmer. I have no project needs or other reason for my specific example, which was merely an example of what I suspect/hope is an elegant program. I could be wrong about that. Feel free to discard your understandable cynicism.
Fear is the greatest salesman. -- Robert Klein