23 November 2012, 17:54 | #1 |
Computer Nerd
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? |
23 November 2012, 19:13 | #2 |
Computer Nerd
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 |
25 November 2012, 20:17 | #3 |
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.
|
19 December 2012, 08:10 | #4 |
tulou
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.
|
19 December 2012, 15:51 | #5 |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,510
|
Except on Atari, where most TOS functions will also trash d2 and a2.
|
19 December 2012, 19:34 | #6 |
Glastonbridge Software
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. |
19 December 2012, 20:46 | #7 |
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
|
19 December 2012, 22:09 | #8 |
Glastonbridge Software
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. |
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 |
|
|