3 ms·
No it's not a great CPU design at all, it has some big limitations.
by dholowiski 15y ago
No it's not a great CPU design at all, it has some big limitations.
- sbarre 15y agoCan you expand on that? I'm genuinely curious (as an un-informed observer)
- unoti 15y agoThere is a good discussion of it here: http://fail0verflow.com/blog/2012/dcpu-16-review.html http://fail0verflow.com/blog/2012/dcpu-16-review.html The key criticisms center around it being not a instruction set for compiling C and other higher language code. The biggest reasons for that are: 1. No ability to store based on the stack pointer (this is great for handling local variables not in registers) 2. No ability to deal with negative numbers 3. No way to address single bytes, everything is full words only. This makes many basic manipulations take many instructions 4. Not very many registers, particularly in light of limitation 1 The 6809 and 6502 had far fewer registers, but didn't have any of the other limitations listed above.
- Someone 15y agoI don't think the 6502 had #1, or at least not in an easy way. Accessing, say, the second element from the top of the stack required you to copy the stack pointer to the ?X? register, then use that to index into the stack. That works, but is cumbersome.
- Tuna-Fish 15y agoAs an aside, I find it entirely plausible that these restrictions are, if not designed for, at least desired in the design. As they make the work of a compiler harder, they promote coding in assembly to get faster code. This, on the other hand, leads to lower code quality (as avoiding gotchas and dealing with corner cases correctly is a lot easier even in c than in assembly), which creates more "drama", which is good for gameplay.
- redthrowaway 15y ago>No ability to deal with negative numbers How is representing a number in 2's complement verboten?
- polyfractal 15y agoNot having interrupts makes it interesting to multitask as well, since every program has to be made to explicitly multitask cooperatively.
- sbarre 15y agoThat was a great link to read. Thanks!