English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 29 October 2017, 09:53   #1
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 42
Posts: 19,945
68000 undocumented STOP feature

(Not in normal undocumented thread because this is not really Amiga specific)

68000 (possibly 010 too) STOP #x has strange undocumented side-effect:

STOP #<S-bit not set>: modifies SR, increases PC (next instruction), then generates privilege violation exception! Execution time: 8 extra idle cycles.
Same as above but T (Trace) active before executing STOP: works as documented, no privilege violation. Only 4 extra idle cycles. (before trace exception starts)

68020/030: No side-effects. STOP parameter S-bit set or not set makes no difference, no weird privilege violation exceptions.

68040/060: STOP parameter S-bit not set: immediate privilege violation (same behavior as STOP being executed from user mode). SR is not changed. PC is not increased. (68060 LPSTOP documents this behavior, STOP documentation does not)

(I didn't find this 68000 behavior, I got message from Hatari developers because someone found some Atari ST utility that has very rare protection that requires privilege violation exception behavior of STOP which needed emulation update.)
Toni Wilen is online now  
AdSense AdSense  
Old 29 October 2017, 10:52   #2
ross
Omnia fert aetas

ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 47
Posts: 551
Hi Toni,
Quote:
Originally Posted by Toni Wilen View Post
STOP #<S-bit not set>: modifies SR, increases PC (next instruction), then generates privilege violation exception! Execution time: 8 extra idle cycles.
and this regardless of the state of S before STOP?

Last edited by ross; 14 November 2017 at 23:37.
ross is offline  
Old 29 October 2017, 11:08   #3
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 42
Posts: 19,945
Must be in supervisor mode or you would get instant privilege violation exception. (which is not same as "STOP #S-bit-not-set" privilege violation on 68000, stacked SR and PC would be different)

It isn't _that_ undocumented
Toni Wilen is online now  
Old 29 October 2017, 11:34   #4
ross
Omnia fert aetas

ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 47
Posts: 551
At least it makes more sense, anyhow it's a weird behavior (and even on 040/060!).


Thanks!
ross is offline  
Old 30 October 2017, 12:25   #5
StingRay
move.l #$c0ff33,throat

StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 5,591
Quote:
Originally Posted by Toni Wilen View Post
(I didn't find this 68000 behavior, I got message from Hatari developers because someone found some Atari ST utility that has very rare protection that requires privilege violation exception behavior of STOP which needed emulation update.)
I saw the discussions about this protection (and the weird STOP behavior) on IRC, for reference, the protection is the one of Audio Sculpture.
StingRay is offline  
Old 01 November 2017, 22:43   #6
Photon
Moderator
Photon's Avatar
 
Join Date: Nov 2004
Location: Hult / Sweden
Posts: 4,452
I also used it on the bootblock of Stunner, IIRC the PC moving to next address was relied upon by me.
Photon is offline  
Old 01 November 2017, 23:14   #7
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 42
Posts: 19,945
You most likely used documented behavior of STOP, instead of trying to cause privilege violation exceptions.
Toni Wilen is online now  
AdSense AdSense  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Undocumented Amiga hardware stuff Toni Wilen Coders. Asm / Hardware 225 24 April 2017 21:06
Swiv undocumented score feature yaqube Coders. General 9 07 March 2017 21:35
Whdload quit key feature with a plain 68000 Yulquen74 Hardware mods 3 26 February 2016 00:08
Action Replay Undocumented Features deicidal support.Hardware 0 01 March 2010 18:15
ICD AdIDE "undocumented information" Toni Wilen support.Hardware 14 25 April 2009 05:36

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 11:57.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Page generated in 0.21460 seconds with 14 queries