06 June 2022, 18:52 | #21 |
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,764
|
I always save all modified registers in the subroutines, unless something needs serious optimizing (most code doesn't).
|
10 June 2022, 23:33 | #22 |
Registered User
Join Date: Jun 2014
Location: milan / italy
Posts: 174
|
A bit off topic Is it possible to instruct a C/C++ compiler to never use a set of registers? For example because I want to use them in an interrupt handler without saving registers.
|
10 June 2022, 23:39 | #23 |
Registered User
Join Date: Jan 2022
Location: Kharkiv
Posts: 48
|
|
05 August 2022, 10:02 | #24 |
OCS forever!
Join Date: Mar 2019
Location: Birmingham, UK
Posts: 418
|
I use the OS convention for "slow" code like prototyping functions, and non time critical, where d0-d1/a0-a1 are assumed to be trashed on any call and everything else is saved/restored:
http://amigadev.elowar.com/read/ADCD.../node000F.html Then for all other code that needs to be fast (demo stuff) I 99% of the time leave $dff000 in a6 and just document everything on subroutine definition and subroutine call. Yes, a bit of a pain when you change a function but there you go. If not documented assumption is that everything is trashed. Within a subroutine I use scratch registers in order from d0 first up to d7 so that when you start nesting function calls in loops the outer loop counters end up being higher up. Code:
;Load current palette into CL if needed bsr Copper_Write_Palette ;I:a5, T:d0/a0-a2 .. .. .. .. ***************************************************************************** * Loads the current colors into the current copperlist if changed. * IN: a5, Controller_Info * OUT: * TRASHED: d0/a0-a2 ***************************************************************************** Copper_Write_Palette: |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Memory Management | Havie | Coders. Blitz Basic | 6 | 10 April 2022 21:38 |
File management | marm | New to Emulation or Amiga scene | 21 | 04 November 2018 13:41 |
Assign Management Utility | Daedalus | Amiga scene | 22 | 28 March 2017 12:54 |
Better (perhaps) config files management | NewDeli | request.UAE Wishlist | 7 | 24 June 2008 15:43 |
Icon Management | Makkinen | support.WinUAE | 3 | 16 October 2004 00:30 |
|
|