Yes, there is a way: recompile mspgcc with a different configuration. :)
No, seriously, what you can do is to execute the call to your function with inline-assembly code (write a macro if you want). This way, the compiler will not know that a call takes place and won't assume the registers clobbered. You should, however, declare any register you _do_ clobber as clobbered in the asm instruction. I _think_ the compiler-generated calls to the multiply/divide functions taken from gcclib are called without this clobbering. (There is a comment about the different call convention for these functions) But I doubt there is a way to declare this for self-defined functions. JMGross ----- Ursprüngliche Nachricht ----- Von: Rick Jenkins Gesendet am: 29 Dez 2010 21:06:10 In msp430-gcc-4.4.5, is there any way to override the default clobbered registers for a function? I have a small assembly routine which uses only R15 and R14, and I would like to be able to free up R12 and R13 for the calling function to use. -- Rick Jenkins <[email protected]> Hartman Technica http://www.hartmantech.com Phone +1 (403) 230-1987 221 35 Avenue. N.E., Calgary, Alberta, Canada T2E 2K5 ------------------------------------------------------------------------------ Learn how Oracle Real Application Clusters (RAC) One Node allows customers to consolidate database storage, standardize their database environment, and, should the need arise, upgrade to a full multi-node Oracle RAC database without downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl _______________________________________________ Mspgcc-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mspgcc-users
