On 22 Jun 2008, at 15:37, Thomas Harte wrote:

ex de, hl
add hl, hl
add hl, hl
ex de, hl

Takes 48 cycles (on the 6 Mhz bus) if executed in its entirety while pixels are being drawn, 32 cycles if executed in its entirety while pixels are not being drawn. The functionally equivalent:

sla e
rl d
sla e
rl d

Takes 64 cycles if executed in its entirety while pixels are being drawn, 32 cycles if executed in its entirety while pixels are not being drawn?

Yes. I believe these and all your other statements are correct.

Has anyone drawn up a neat table of all the opcodes with cycle counts computed as weighted probabilities of their timings if executed entirely in pixels and if executed entirely outside?


David Zambonini wrote up a description of Sam timings for an article in "Based on an idea" issue 2 (and I may be able to find a text file he sent me with an earlier version of that article). He expresses the timings differently, but the data is basically the same; there are a few instructions which take less time to execute than they "should" when the screen is on (working out the statistical benefit of that is just a little bit of maths). It's a good idea to put these into every algorithm you can get them...

Andrew

--
 ---       Andrew Collier         ----
  ---- http://www.intensity.org.uk/ ---
                                      --


  • Sam timings Thomas Harte
    • Re: Sam timings Andrew Collier

Reply via email to