3 ms·
Have you done http://nand2tetris.org http://nand2tetris.org ? It involves (virtually) building up a CPU that has two registers, which I'm guessing the minimum p
by SilasX 9y ago
Have you done http://nand2tetris.org http://nand2tetris.org ? It involves (virtually) building up a CPU that has two registers, which I'm guessing the minimum possible.
- rbanffy 9y agoYou'll need some internal state (one register?) and a program counter. If instructions are long enough, you can encode the address of the next instruction in the instruction itself (sort of a perverse VLIW where everything ends with a jump to a given address) and ditch the program counter. You can make tests destructive, so your status bits end up overwriting the register - it would force some "interesting" programming techniques, but it seems doable. But remember: there is always a lot of state flying around that's not exposed to the programmer through architectural registers.
- a1369209993 9y agoYou could make every operation of the form (op src dst nxt). Something like https://codegolf.stackexchange.com/questions/11880/build-a-working-game-of-tetris-in-conways-game-of-life https://codegolf.stackexchange.com/questions/11880/build-a-w..., where results are always written to ram and 'register' indexes are just addresses. You'd still need some transient/architectural registers to hold the current instruction/memory address/alu input-output on its way though the cpu though.