Circa 1980, I had a Northstar Horizon S-100 bus computer in my room, I had to hand-assemble the I/O routines for my keyboard and video card (80 columns and 24 rows was a luxury, it was a Matrox card b/w composite video output). After that, I wrote (in Z80 assembler) my VT-52 emulator. My friend had showed me how to use process states to handle the characters coming in to the serial port (“A” means one thing, “Esc” sets a different state, and so on).