EASy68K  
It is currently Mon Sep 25, 2017 11:56 pm

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Mon Mar 05, 2012 2:16 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1046
The current method of stopping the simulator is:
Code:
    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:
Code:
    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.

_________________
Prof. Kelly


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 13, 2012 4:37 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1046
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.

Comments?

_________________
Prof. Kelly


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 13, 2012 10:00 pm 
Offline

Joined: Mon Jul 26, 2010 11:43 pm
Posts: 198
Location: Aurora, IL
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.


Top
 Profile  
 
PostPosted: Tue Dec 25, 2012 10:56 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1046
SIMHALT added to EASy68K v5.12.25

_________________
Prof. Kelly


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group