KRkragen·Oct 14, 2015
I think this is more like an ALU simulator (plus registers) than a CPU simulator. There are no jumps, either conditional or unconditional, because it's reading the instruction stream from standard input.
https://github.com/kragen/calculusvaporis/blob/master/cavosi... is a CPU simulator in 70 lines of code, but it's perhaps a bit impractical; you have to synthesize addition from subtraction, for example, and AND and OR from NAND. The design objective of Calculus Vaporis, however, is to use as few logic gates as possible, rather than to be as simple as possible in C.
http://canonical.org/~kragen/sw/aspmisc/brainfuck.c is a 66-line BF interpreter, but BF is not a very good CPU design, in that it doesn't support subroutines.
In Show HN: CPU simulator in 60 lines of code