Re: [hatari-devel] Code execution discontinuities and detecting them?

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


On 25/02/2013 23:03, Eero Tamminen wrote:
Hi,

On maanantai 25 helmikuu 2013, Nicolas Pomarède wrote:
Le 25/02/2013 18:16, Eero Tamminen a écrit :
Do they cause PC for the next instruction to be something else than
the next address in memory?

Yes, it's like a trap or an exception, the PC will be set to the vector
defined in the lower ram for each exception.
...
No, you can't detect when the code is inside an exception handler. The
exception handler is free to change SR, stack pointer, ... in any way it
likes (for example, change A7 and SR in a way where RTS will be used
instead of RTE).

Ok, thanks!

Commit adding this info to profile callers is here:
http://hg.tuxfamily.org/mercurialroot/hatari/hatari/rev/49416318c2ac


Regarding your function cpu_opcode_type(), I think that instead of masking opcodes yourself you should use OpcodeFamily (which is updated for each instruction, see cpuemu.c) with the constants instrmnem defined in readcpu.h

You should get the same results, and this will leave the family's classification to the cpu emulation part instead of duplicating it partly in your code.

Nicolas





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