English Amiga Board


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

 
 
Thread Tools
Old 23 November 2012, 18:54   #1
Thorham
Computer Nerd

Thorham's Avatar
 
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 42
Posts: 3,085
AOS scratch register question.

Hi,

I've read that when calling AOS functions, regs d0, d1, a0 and a1 are used as scratch registers by the AOS functions, and can therefore not be relied on. Is this correct?
Thorham is offline  
Old 23 November 2012, 20:13   #2
Thorham
Computer Nerd

Thorham's Avatar
 
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 42
Posts: 3,085
Damn! I remeber now where I read it: IN THE FUCKING OS CODING MANUAL

How the hell did I forget this
Thorham is offline  
Old 25 November 2012, 21:17   #3
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 2,966
Also note that there are some exceptions to the scratch registers, which are usually mentioned in the individual function autodocs. For example WaitBlit() in graphics.library is guaranteed not to modify any registers.
mark_k is offline  
Old 19 December 2012, 09:10   #4
dalton
tulou
dalton's Avatar
 
Join Date: Jun 2006
Location: Gothenburg / Sweden
Posts: 71
The scratch registers are a Motorola standard, so it applies not only to amiga, but to almost any code compiled for 68k. Fp0 and fp1 are also scratch.
dalton is offline  
Old 19 December 2012, 16:51   #5
phx
Natteravn

phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,225
Except on Atari, where most TOS functions will also trash d2 and a2.
phx is offline  
Old 19 December 2012, 20:34   #6
Mrs Beanbag
Glastonbridge Software
Mrs Beanbag's Avatar
 
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,202
so let me get this straight... all other registers are guaranteed to be preserved?
I did not know this.
Mrs Beanbag is offline  
Old 19 December 2012, 21:46   #7
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 22,116
Every Amiga programming manual mentions it, it should have been impossible to miss it
Toni Wilen is offline  
Old 19 December 2012, 23:09   #8
Mrs Beanbag
Glastonbridge Software
Mrs Beanbag's Avatar
 
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,202
Amiga Machine Language by Stefan Dittrich (Abacus 1988) doesn't seem to... in fact in the examples everything seems wrapped in movem.l D0-D7/A0-A6,-(SP), oh well

Can't find it in Amiga System Programmer's Guide, either.
Mrs Beanbag is offline  
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding a VB Interrupt to AOS server chain bodhi Coders. Asm / Hardware 2 11 July 2013 03:54
ExtractModule (AOS 3.9) NubeCheCorre request.Apps 2 05 May 2012 14:31
FS: PegasosII G4 1GHz + AOS 4.1 parski MarketPlace 1 23 June 2011 00:57
ADKCON/ADKCONR register Question dlfrsilver Coders. General 4 27 September 2008 00:05
anarchy scratch pack 29 snyp request.Demos 6 31 July 2006 21:40

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 06:48.


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