Hi,
I want to insert some assembly code insided mP soubroutines for P24, to fasten up some processing.
My questions are now:
- Which registers of the group W0..W15 can I use freely in the assembly code I insert?
- Are there restrictions for the actual processor registers (which should I leave alone?)
- How are parameters passed to a subroutine by mP (in which registers or Wx ... or on the stack?)
- How are subroutine results passed back to the calling routine (in which registers or Wx or ...)
I do not want to interfere with the mP generated code when I start to use assembly...
Thanks in advance!
Which registers can I use freely in subroutine asm parts?
Which registers can I use freely in subroutine asm parts?
Last edited by Dany on 16 Jan 2014 22:43, edited 1 time in total.
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)
- dejan.odabasic
- mikroElektronika team
- Posts: 2649
- Joined: 30 Apr 2012 14:20
Re: Which registers can I use freely in subroutine asm parts
Hello,
The answer is similar to this one: http://www.mikroe.com/forum/viewtopic.p ... 26#p220526
The only difference is that subroutine parameter as passed in W10, W11, W12, W13 registers and if required other parameters are passed on function frame.
Result value is places in W0 and W1 (depending on size of result value).
Best regards.
The answer is similar to this one: http://www.mikroe.com/forum/viewtopic.p ... 26#p220526
The only difference is that subroutine parameter as passed in W10, W11, W12, W13 registers and if required other parameters are passed on function frame.
Result value is places in W0 and W1 (depending on size of result value).
Best regards.
Re: Which registers can I use freely in subroutine asm parts
Thanks for both P18 and P24 replies!dejan.odabasic wrote:Hello,
The answer is similar to this one: http://www.mikroe.com/forum/viewtopic.p ... 26#p220526
The only difference is that subroutine parameter as passed in W10, W11, W12, W13 registers and if required other parameters are passed on function frame.
Result value is places in W0 and W1 (depending on size of result value).
Best regards.
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)