Calling convention for gcc (m68k-amigaos)
When I call an assembler function, d0/d1 and a0/a1 don't need to be saved?
The first four params are passed in d0/d1 and a0/a1, or does this depend on wether it's a pointer or value? Is there some compiler hint to tell the compiler which registers a param might be expected in? |
Quote:
Whether it's a pointer or not matters. Yes, GCC has register directives for passing parameters in to subroutines and especially inline Assembly. |
With gcc, the params are passed on stack if you don't specify anything (that's empiric, it worked for a quick test I did).
Bebbo gcc 6 supports SDI_compiler include. You can specify "passing by register" and which register. Return value is always taken from D0 (here the return type is void so it doesn't matter) Code:
#ifndef SDI_COMPILER_H |
Thanks! When I use that REG() notation, do I still need to preserve the register, or does the compiler know in this case that it can get scratched?
It's still faster if I don't have to translate the registers, so it still makes sense to use this anyway. Which include is this defined in? I'm using the 1.3 includes, is this also supported there because I can't find any traces of this (also not in the OS 2.x+ includes). |
All times are GMT +2. The time now is 00:39. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.