21 April 2012

Writing code to fit into small places...

Somewhere around here I have the source to Jim Penny's "Freelancin' Roundtable" chat system, which I asked him for because it was supposed to be an amazing piece of tight coding... I thought I might learn something from it. This was in the early '80s, and an 8-user dialup chat system was an amazing thing. I learned a lot, actually, particularly about the kind of things that become reasonable when you're up against the wall and have absolutely no cycles left to spare.

One quirk of Roundtable was that your user ID was 4 hex digits, and your password was a fixed random string that you couldn't change... every now and then he'd mail all the users with a new user ID and password.

It ran on a TRS-80 and communicated with 8 modems through unbuffered UARTs, so it absolutely had to get back to all 8 serial ports 30 times a second, every second, to output or input the next character of text.

Reading data from files or writing it out again was obviously out of the question, and memory was really tight, so he didn't even implement any lookup tables. Instead, he would eyeball the binary code of the program for printable strings. Your user ID was the address of the string. Every time he recompiled the program he had to come up with a new set of user IDs and passwords and send them out to all the users before they could log in again.