Am 29.06.21 um 00:38 schrieb Basil Hussain:
> 
> If you are adding these attribute keywords, would it then be possible to
> have one to dictate, per function, the use of the old purely-stack-based
> calling convention? I think this would be a good idea for the sake of
> backwards compatibility, so that existing inline assembly code does not
> have to be rewritten just to compile under the new version.

When in the future the new calling convention is made the default in
trunk, a way to indicate the use of the old calling convention (maybe
__sdccoldcall or so) will be introduced to use the old calling
convention for individual functions. Maybe __sdccoldcall, __stackcall or
something like that.

>> callee. In the current convention, the cleanup is always done by the
>> caller. The caller vs callee-cleanup is the aspect that I am still a bit
>> unsure of. While this makes a differnce, the pciture was not that clear
>> initally.
> 
> Can I clarify my understanding here? Callee-cleanup will have the called
> function rewind the stack pointer for any arguments that were passed on
> the stack. So, the caller will still push args onto the stack as before,
> but the callee will be responsible for clearing them off the stack? And
> the caller will not need to do anything after the called function
> returns. Am I correct?


Yes.

> 
> I have a tangential question: does any of this work make it easier to
> implement the callee-saves option/pragma for STM8?

These are unrelated.

Philipp


_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to