This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

I want to know meaning of r12 register.

Hi expert.

I want to know meaning of r12 regiseter.

this register some time using frame pointer (compiler option)

I think caller save register is r0-r3, and callee save register is r4~r15. but my code not guarantee r12 register value.

so plese explain r12 register.

Thanks.

I am a beginner so please expalin easyly!! hehe

Parents
  • You can use r12 as a temporary within routines. It won't be saved by called routines. It is special because there is no guarantee that it will remain unchanged between a call and entering the target routine. For instance a call to a library routine where the library is only loaded or the call is only fixed up if used is handled by entering a little routine which then goes to the target. The routine will use r12 since it doesn't matter if that is corrupted. Having the register free makes this much more efficient. There are also cases in some systems where the return is sometimes monitored as well- the exit doesn't return to the calling routine but to a little routine which then returns to the caller.

Reply
  • You can use r12 as a temporary within routines. It won't be saved by called routines. It is special because there is no guarantee that it will remain unchanged between a call and entering the target routine. For instance a call to a library routine where the library is only loaded or the call is only fixed up if used is handled by entering a little routine which then goes to the target. The routine will use r12 since it doesn't matter if that is corrupted. Having the register free makes this much more efficient. There are also cases in some systems where the return is sometimes monitored as well- the exit doesn't return to the calling routine but to a little routine which then returns to the caller.

Children
No data