This is the mail archive of the crossgcc@cygnus.com mailing list for the crossgcc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Changing register for passing return value from function call


Hi,

I am writing library functions for m68k cpu32 (with xgcc from
objsw.com) that can get called from the system software of an embedded
system.

GNU GCC passes all return values in %d0 (and %d1 for double). The
system software returns pointers in %a0. Is there a way to let GCC use
%a0 instead of %d0 when returning pointers?

There's just one function (normally main) that gets called by the
system.
My functions can call three system functions that return pointers
(_malloc, _calloc, _realloc). 
Some compiler directive to use %a0 that can be placed at the function
delaration and at the function calls would be nice.


Thanks,

Arjan Koers.
_______________________________________________
New CrossGCC FAQ: http://www.objsw.com/CrossGCC
_______________________________________________
To remove yourself from the crossgcc list, send
mail to crossgcc-request@cygnus.com with the
text 'unsubscribe' (without the quotes) in the
body of the message.