Designing a trivial CPU, part 2: machine code
Go to the first post in this series.
Introduction
I’m designing a small CPU. In the last post, I picked (fairly
arbitrarily) bit-size, registers, addressing modes, and an instruction
set. To recap, that’s: 8 bits; four registers (x
, y
, i
and j
);
four additional indirect modes ((i)
, (j)
, k
and (k)
), where
k
is an 8-bit constant.