English Amiga Board


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

 
 
Thread Tools
Old 29 October 2017, 08:53   #1
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 21,368
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, 09:52   #2
ross
Omnia fert aetas

ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 48
Posts: 876
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 22:37.
ross is offline  
Old 29 October 2017, 10:08   #3
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 21,368
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, 10:34   #4
ross
Omnia fert aetas

ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 48
Posts: 876
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, 11:25   #5
StingRay
move.l #$c0ff33,throat

StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 5,894
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, 21:43   #6
Photon
Moderator
Photon's Avatar
 
Join Date: Nov 2004
Location: Hult / Sweden
Posts: 4,516
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, 22:14   #7
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 21,368
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
ICD AdIDE "undocumented information" Toni Wilen support.Hardware 16 18 June 2018 09:18
Undocumented Amiga hardware stuff Toni Wilen Coders. Asm / Hardware 232 03 February 2018 11:27
Swiv undocumented score feature yaqube Coders. General 9 07 March 2017 20:35
Whdload quit key feature with a plain 68000 Yulquen74 Hardware mods 3 25 February 2016 23:08
Action Replay Undocumented Features deicidal support.Hardware 0 01 March 2010 17:15

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 19:00.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.
Page generated in 0.06579 seconds with 15 queries