Did you look at that github? The S80 class? If that doesnt qualify as a simulation of a custom designed cpu then I dont know what does. But yes, you’re still right. I don’t know all of what I need to know. I’ve only started to scratch the surface as far as learning how cpu’s actually function… but still…
I think you confused compiler functionality and the execution phase. The compiler creates the symbol table, and uses it to calculate the absolute or relative jumps, storing the results directly as operands.
So an unconditional jump wouldn’t be:
program_counter = symbol_table[decoded_label_index]
as that level of indirection is already resolved by the compiler, so we’d simply do:
program_counter = decoded_target_address
I’m not clear on the goal, but along the same lines as sproingie suggestion, instead of a CPU…implement forth-a-like instead is an interesting exercise.
1: for this I would say dont go complicated do something like the redpower2 computers, they are very effective and do pretty much what you are asking for.
2: probably dont need to worry about bits.
3: To make your life a heck of a lot easier write an interpreter for the incoming code.
4: if you want make an xml that holds your commands.
5: yes as some people have said do something similar to a fouth language, people know it it’s a lot easier to code and its commands are simple.
Anyway hope this goes well. Just dont try to simulate full computer functions that will not only destroy your tick and frame rate but also turn into inception and when you dont have a crazy guy who jumps into dreams then gets everyone killed with his dead wife and a train well, its not gonna work.