nspon wrote:
- the Build Tools Reference Manual doesn't actually describe the register calling convention, just the standard one.
- nor does it describe what (if any) conditional flags are available; by searching the MSL I have discovered that there is a C symbol __REGABI_, but that doesn't seem to work for assembler source (i.e a .s file)
I never found a predefined conditional, so I defined __REGABI__ myself in each of 4 assembly source files. There are also declspecs you can use on the function declaration to force a particular function to always use a specified calling convention.
The register calling convention puts the first 3 integer arguments in D0, D1, and D2, and the first 2 pointer arguments in A0 and A1. I've never done floating point in coldfire, but I would guess the first 3 double arguments would go to FP0, FP1, and FP2.
Note that GCC uses something like the standard ABI, but with register D2 preserved by functions and pointers returned in D0. If you use .S as the assembly suffix, GCC invokes the preprocessor so you can easily create assembly source compatible with either compiler.