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.
I am a beginner so please expalin easyly!! hehe
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.
as the frame pointer, r11 is rather used than r12.
The another name of r12 is IP (i.e. Intra Procedure call scratch Register).
As daith says, it is a scratch pad register.
Maybe understanding Veneer is good for you. For this i will remain some links.
3.http://infocenter.arm.com/help/topic/com.arm.doc.ihi0042e/IHI0042E_aapcs.pdf -- please see 22.214.171.124
I don't think any of those veneers use r12 but yes they're the same sort of thing as what I was talking about. They are a bit simpler as the addresses are all fixed up before the program starts.