[hatari-devel] Getting cycles used by previous or next instruction without modifying CPU state?

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Hi,

How do I get how many cycles previous instruction used, for
profiling purposes?

src/debug/profile.c has this code:
        Uint32 opcode, cycles;                                                                                                                                       
        opcode = get_iword_prefetch (0);                                                                                                                             
        cycles = (*cpufunctbl[opcode])(opcode) + nWaitStateCycles;  

But that's bad, calling the opcode table function modifies
the CPU state.


	- Eero



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/