Hacker News new | ask | show | jobs
by simonblack 2182 days ago
Is this a simulation of some theoretical 8-bit CPU, or is it a simulation of a real, existing 8-bit CPU?

For what it's worth, there are many existing C-code emulations of actual 1970s 8-bit CPUs on the Net. (6800, 8080, Z80, 6502, etc, etc, etc.) Studying those may assist you in managing to get past the tricky bits.

In my own Z80 emulation work, I have leaned heavily on 'Yaze' and 'Dasm', with a few extra features and debugging of my own.

2 comments

He mentions it's based on the NandGame, so it's theoretical, but somewhat well defined. Some background here: https://www.hackster.io/news/learn-how-to-build-a-simple-cpu...
Thanks for the recommendations. I've briefly looked at the 6502 instruction set. Part of the problem is that most of those real-world CPUs use multibyte instructions, which I'm not opposed to, but I'm not sure how to actually incorporate them into my current design (It would be a lot easier if I just did a 6502 emulator without any of the logic gate stuff). Thus I'm trying to come up with an instruction set that utilizes only 8 bits per instruction.
I'm fairly rusty on 1970s CPUs, but digging back into the recesses of my memory I have a feeling that the PDP-8 used single-byte instructions. (or maybe I am remembering the EDUC-8 project that was based on the PDP-8.)