09 March 2016, 21:53 | #1 |
Registered User
Join Date: May 2013
Location: Kleppe / Norway
Posts: 253
|
proper reset code
What would be the proper reset code in assembler?
Would you need different code for different ROM flavours (3.1, 1.3..)? Does interrupts need to be enabled when running reset code? |
09 March 2016, 22:12 | #2 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,160
|
run in supervisor mode:
move.w #$2700,SR lea 2.W,A0 RESET jmp (a0) |
09 March 2016, 22:31 | #3 |
Registered User
Join Date: Oct 2014
Location: Europe
Posts: 470
|
For Kickstart 2.x and higher you can use ColdReboot_().
|
10 March 2016, 11:46 | #4 |
Registered User
Join Date: May 2013
Location: Grimstad / Norway
Posts: 839
|
There is an official C= sanctioned routine for doing reset.
It looks pretty much what you saw above, but it has alignments to make sure the reset and jump share the same longword instruction prefetch. |
10 March 2016, 12:58 | #5 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,502
|
Prefetch requiring long word alignment is not true. No 680x0 CPU needs it.
|
10 March 2016, 14:08 | #6 |
Registered User
Join Date: May 2013
Location: Grimstad / Norway
Posts: 839
|
Maybe, but that is what C= put in the comments.
I'm pretty sure you can find it printed in an old issue of Amiga Transactor in addition to probably manymany places on the net. |
10 March 2016, 14:20 | #7 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,502
|
I know, everyone thought it was required.
It is not, I don't support incorrect technical information or myths. Even if it was documented |
10 March 2016, 18:17 | #8 |
Registered User
Join Date: May 2013
Location: Kleppe / Norway
Posts: 253
|
thanks!
does the first line in the example code above enter supervisor mode? |
10 March 2016, 21:12 | #9 |
Registered User
Join Date: May 2013
Location: Kleppe / Norway
Posts: 253
|
Ok, the program above gives a guru 80000008 after the first line, and I've read its because I'm in user mode and trying to set the S bit gives an exeption that gurus.
I've read that the only way to go from user mode to supervisor mode is by the means of an exeption. So how can I get a working software reset? |
10 March 2016, 22:02 | #10 |
Registered User
Join Date: Aug 2004
Location:
Posts: 3,333
|
To enter supervisor mode you can call Supervisor() or SuperState().
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Proper startupcode in asm? | oRBIT | Coders. General | 9 | 19 May 2010 20:16 |
Proper HD and WinUAE | Macca | support.WinUAE | 54 | 14 August 2007 07:43 |
cdtv proper configuration | truestep | New to Emulation or Amiga scene | 5 | 19 July 2007 15:54 |
CardReset reset error code 10 | Smiley | support.Hardware | 2 | 13 August 2006 01:28 |
KICK OFF 2 v1.4e - A proper crack | manicx | Games images which need to be WHDified | 0 | 07 December 2002 15:52 |
|
|