How to Emulate a 6802
A CPU emulator I wrote as a student, reconstructed from memory.
As a student I wrote an emulator for the Motorola 6802 in C, with a built-in assembler and single-step tracing. The school adopted it to teach computer architecture to more than a thousand students. The source code did not survive, so this is how it worked, reconstructed.