Wondering if it's crazy to define a language which is almost exactly Z80 assembler but a little more orthogonal, and then write a preprocessor which turns into actual Z80 assembler by inserting stack juggling nonsense to work around the limitations. Would not produce optimally fast or small code but would make writing much easier...
@solderpunk doesn't seem *that* crazy to me although I would expect the resulting code to perhaps be too slow/bulky for use on emulators of 1980s systems at "real speed" (although I'm perhaps thinking here of 8-bit home computers rather than business grade CP/M equipment, which by late 1980s had fast running CPU and often extra (paged) RAM..
@vfrmedia This is for my homebrew machine with 10MHz CPU and half a meg of RAM, I think the performance hit is probably negligible relative to the increased ease of development.
@solderpunk cool 😎 I'd be interested in seeing more of this (had been reading about folk making modern Z80 based computers in recent times, it seems to be still quite popular especially in parts of Europe..)
@vfrmedia Drop me a line (solderpunk@sdf.org) if you would like to know more about my machine.
@solderpunk @vfrmedia what kind of stack juggling do you plan to do? I wish I had a Rockwell R65F11
@solderpunk @vfrmedia Looks like a terrible overhead might occur.
EX DE, HL might be a better and faster solution for this particular one.
If you have a lots of pointers, maybe IX and IY should come to play?
Just found this: http://www.righto.com/2014/10/how-z80s-registers-are-implemented-down.html
@vfrmedia @solderpunk Register scheduling is a fascinating problem and I think it is the reason we have compilers :)
@saper @vfrmedia Oh, sure, this will definitely produce larger and slower code than carefully choosing the right registers so that you can do everything within the limitations of the instruction set.
In some cases, the overhead might be worth the increased ease of programming.
And, yes, you're right, I chose a sub-optimal substitution here. But for any illegal combo of registers, there is an optimal workaround, and the tool I envisaged would always insert the optimal code.
@solderpunk @vfrmedia Didn't know that one! Thanks!
1/10th ouch...
@saper from memory trying to code games/graphics on ZX spectrum, using IX and IY had a speed hit.
*But* @solderpunk is using a modern 10 MHz CPU and 512 MB of paged RAM, so performance hits may not then be such an issue.