Re:Z80 arithmetic: also surprisingly terrible (2018)
by Arnt on Monday January 14, 2019 @10:05AM
(#18903454)
Maybe it actually was. Code like (java) for(A a : b) a.c = false; certainly could be written very nicely on the Z80. By keeping a in IX and laying out the data structure as a struct where all of the bools are packed into one byte, the body of that loop could be just one (slow) instruction like RES 3, IX+4. But to get that speed you had to be aware of those possibilities and design the data structure. On the 6502 you'd lay out the data structure differently, playing to that CPU's strengths.
[ Parent
| on HN ]
Re:Z80 arithmetic: also surprisingly terrible (2018)
by _Codemonkeyism on Tuesday January 15, 2019 @03:39AM
(#18909669)
Interesting, I have no idea as I was writing assembler only, no code generation (except some assembler macros ;-)