Re:Implement an emulator for a fantasy CPU in JavaScript
by tn1 on Monday August 24, 2020 @03:30AM
(#24258244)
You'd be surprised, it may not take quite that long. With something like Chisel you can create that idea with little friction. Plus, it's "just" Scala so if you already know that it's a lot easier than, say, learning Verilog which has a very different syntax.
18 bit address bus
12 bit stack pointer
6 flags zero, negative, carry, overflow, float and user
7 addressing modes accumulator, immediate, absolute, relative, stack, stack without pop, stack special
64 opcodes like NOP, OR, JMP, ROL, STO, ...
I discovered that it is well possible to have a 6 bit CPU but of course this is just a game and probably not useful at all. I wonder whether I would be able to create the circuit for the CPU in a simulator. Probably not even if I omit the floating point handling or only if I dedicated about 10 years of free time. I would need to design a microcode or PLA (like MOS 6502, see https://news.ycombinator.com/item?id=5353198) system.
I find it amusing that this is the one CPU where octal base is really the primary way to display numbers.