English Amiga Board


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

 
 
Thread Tools
Old 23 November 2012, 17:54   #1
Thorham
Computer Nerd
 
Thorham's Avatar
 
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,796
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, 19:13   #2
Thorham
Computer Nerd
 
Thorham's Avatar
 
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,796
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, 20:17   #3
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 3,344
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, 08:10   #4
dalton
tulou
 
dalton's Avatar
 
Join Date: Jun 2006
Location: Gothenburg / Sweden
Posts: 88
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, 15:51   #5
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,510
Except on Atari, where most TOS functions will also trash d2 and a2.
phx is offline  
Old 19 December 2012, 19:34   #6
Mrs Beanbag
Glastonbridge Software
 
Mrs Beanbag's Avatar
 
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
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, 20:46   #7
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,534
Every Amiga programming manual mentions it, it should have been impossible to miss it
Toni Wilen is offline  
Old 19 December 2012, 22:09   #8
Mrs Beanbag
Glastonbridge Software
 
Mrs Beanbag's Avatar
 
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
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 02:54
ExtractModule (AOS 3.9) NubeCheCorre request.Apps 2 05 May 2012 13:31
FS: PegasosII G4 1GHz + AOS 4.1 parski MarketPlace 1 22 June 2011 23:57
ADKCON/ADKCONR register Question dlfrsilver Coders. General 4 26 September 2008 23:05
anarchy scratch pack 29 snyp request.Demos 6 31 July 2006 20: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 05:21.

Top

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