[hatari-devel] Changes to STOP/LPSTOP instruction

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



while looking at some recent changes in this commit i've got some questions ;)


If i understand that right, for the 68000/68010, and in the case the immediate value does not have the supervisor bit set, the sequence is:


- update sr from the immediate anyway

- set SP to USP by the following MakeFromSR call

- set the SPCFLAG_STOP flag

- in newcpu.c, recognize that SPCFLAG_STOP is set, but S bit is not, and cause Priviledge violation


Wouldn't that stack the new SR without the S bit set in the exception frame, although the instruction itself was executed in supervisor mode, and thus return to user mode, if the handler executes an RTE? That would really be strange.


What's i also found (from the 68060 manual):


>When the STOP or LPSTOP instruction is traced, the processor never enters the stopped

> condition. A STOP or LPSTOP instruction that begins execution with the T-bit set forces a

>trace exception after it loads the SR. Upon return from the trace exception handler, execution continues with the instruction following the STOP or LPSTOP instruction, and the processor never enters the stopped condition.


Seems like the code tries to execute the STOP instruction anyway.


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