Mark Butcher

Conditional assembler on register passing setting (CW6.3 on M5223X)

Discussion created by Mark Butcher on Sep 19, 2007
Latest reply on Sep 27, 2007 by Bryan Kattwinkel
Hi All

I have the following desire...

I have a small amount of assembler code which needs to know whether C calls are passing a parameter in D0 or on the stack. D0 is used when the project is configured to use register parameter passing rather than compact or standard.

I have found that C-code can make use of the pre-processor define

#if __REGABI__ == 1  // 0 = not register passing, 1 = register passing
...
#endif

but this is not valid for assembler files and I don't want to inline the assembler code in a C-file (for unreleated reasons).

If it were, the problem could be simply solved by

_assembler_routine:
#if __REGABI__ == 0
    move.l  4(SP),D0
#endif


This would means that assember code were compatible for either project configuration.
But this technique doesn't work so I am on the look out for an alternative which will do the trick.

Any ideas???

Regards

Mark Butcher

www.uTasker.com



Message Edited by mjbcswitzerland on 2007-09-19 11:06 PM

Outcomes