New way to stop program execution
Page 1 of 1

Author:  profkelly [ Mon Mar 05, 2012 2:16 pm ]
Post subject:  New way to stop program execution

The current method of stopping the simulator is:
    MOVE.B  #9,D0
    TRAP    #15     ; halt simulator

This causes some confusion when programs expect D0 to contain a result.

The other alternative would be:
    STOP    #$2700

The STOP instruction requires supervisor mode. A supervisor privilege violation occurs when running in user mode.

We need a new way to stop the simulator.

Author:  profkelly [ Fri Apr 13, 2012 4:37 pm ]
Post subject: 

I'm leaning toward adding an instruction to the assembler and simulator that would halt the simulator. My current preference is SIMHALT which would produce machine code $FFFF FFFF. Normally $FFFF would result in a LINE_1111 exception. It could still be used for that purpose as long as it was not followed by $FFFF. $FFFF FFFF also happens to be what the memory in the simulator is filled with prior to loading a program.

I have the code added to the simulator (currently commented). I just need to add it to the assembler.


Author:  clive [ Fri Apr 13, 2012 10:00 pm ]
Post subject: 

Wouldn't an infinite loop be an appropriate reason to stop, simulator's going nowhere.

60FE BRA *
6000 FFFE BRA.L *

If you think someone could use it as a foreground idle loop, say with interrupts doing magic in the background, then perhaps the long version is more improbable in real functional code.

Or even the 60FF 32-bit variant, which technically illegal on the 68K, might suffice for a magic simulator code, and easy to catch.

Author:  profkelly [ Tue Dec 25, 2012 10:56 pm ]
Post subject:  Re: New way to stop program execution

SIMHALT added to EASy68K v5.12.25

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group