- It was missing at least one instruction I wanted, and
- the source is Delphi, and I don't want to go down that road.
All this is in aid of getting closer to a machine, any machine. Sure, I could just learn/write x86 assembly, but that just doesn't seem like enough "fun" to me. Plus, this gives me a little more freedom to be imaginative.
I'm currently writing it for Win32, simply because it's easier to hook up a GUI. If it makes you feel any better, the core is pretty much standard C++98 (I don't use any exotic C++ features), and I'm building it with a cross-compiler on my Ubuntu VM. This is mainly because modern MS compilers seem to require a fairly advanced version of Windows, and I want some backwards compatibility (Luddites rejoice!). You don't need Windows 8, or any .NET bullshit, or much of anything except a bare-bones Win32 installation; in theory it could run on Win98, but Win2K and up for sure.
At some point I might explore some sort of Linux GUI, but regardless of that, I'm fully committed to making sure the core CPU classes are portable enough that one could easily connect it to a simple console program. Load machine code, step, examine registers/memory, step, etc. We'll see. FYI, bitching always sounds to me like volunteering...
Current Feature Set
It's an 8-bit microprocessor, with (predictably) 256 bytes of RAM. It has 4 general purpose registers - AL, BL, CL, DL - and 4 special purpose registers - IP, SP, BP, SR (aka FLAGS). I've implemented all the move, arithmetic, binary logic, and comparison instructions. The GUI can load a machine code file, and you can step through it; RAM and registers are on display full-time.
Coming soon...
Obviously need to expand the instruction set - branching, procedure calling, interrupts, and I/O. Definitely want to make some peripherals, and I'd dearly love to implement them via some sort of pluggable interface, though I don't know how portable that would be. Plus there's currently no assembler, so I'm hand-assembling the machine code for now, which is even less fun than it sounds if you have to test a feature that requires any real set up.
I'll post a build once it has coalesced into something useful, if you can call it that.