Posted By
JamesD on 2013-08-02 15:13:57
| Re: Z80 GUI: SymbOS
"I'm not optimizing compiler! I've just made proof that z80 is 3 times slower with string (up to 65534 chars) compare."
In your string compare... where do you test the 2nd string for a zero terminator? Won't that string compare fail if the 2nd string is shorter than the first? Wouldn't that add 6 clock cycles? *edit* The first compare will deal with it because they are different. Answered my own question.
"The page boundary crossings will add about 1 cycles" Perhaps you were thinking of the code crossing a 256 byte boundary and not the strings crossing a 256 byte boundary?
BTW, I said before I only found something like a 10% difference in code size but now that I think about it, it was closer to 15%. But then that was based on two simple music player interrupt routines minus the extra overhead the 6502 code needed to handle the VIA interface to the AY chip. I was able to optimize the 6502 code a little when I moved it to the Apple II and when you use songs that don't cross 256 byte boundaries I guessed it would be about 10% but I never counted bytes. I suppose if I spend more time on the Z80 code I could optimize it as well but it was based on someone else's code to begin with so I think some optimization may have already taken place before I changed the code to an interrupt driven player.
|