On 4 Feb 2007 at 1:00, Tony Duell wrote:
What happenms with the 'repeat'
instructions, LDIR, etc? I seem to
remember they keep on re-fetching the opcode, do they assert M1 each time?
Yes indeed it does. The repeated operations run the CPU through RNI
and decode each time. Which is why the Z80 gained most of its speed
In which case simply counting M1s won't tell you how many instructions
have bene exectued (assuming yopu could an LDIR as 1 instruciton, no
matter how many times it repeats).
Of coruse there's another trivial correction. You want to combine M1 with
MREQ (feed M1/ and MREQ. into an OR gate). Otherwise you'll count
interrupt acknowledges too (M1 and IORQ asserted at the same time).
-tony