|
|
|
|
|
by jacobush
2788 days ago
|
|
I'm not saying the Z80 is a wonder for compiler construction. But it's decent enough for a C compiler. It has a stack spanning the full address range (up to 64k), so all auto variables can be easily allocated on the stack. Arguments are typically also pushed on the stack in C. So the number of registers is not as important to a naive C compiler as is a decent stack. Oh, and the last, you on the Z80 also have easy absolute and relative addressing to all addresses, so you can easily implement global and static variables. It feels very much like coding for a modern machine, just instead of having a memory limit of 2 gigabytes of RAM or whatever (for a 32 bit CPU) you have a limit of 64 kilobytes. And the integers are 16 bit instead of 32 bit, but again, this was normal in DOS too. So that is why I made the comparison, C in CP/M or whatever on the Z80 didn't feel that much different from Turbo C on DOS. |
|