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
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.
Hello,
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.
Best regards,
Yasuhiko Koumoto.
Maybe understanding Veneer is good for you. For this i will remain some links.
1.http://m.egloos.zum.com/recipes/v/5032032
2.http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0285b/Cchhgfaj.html
3.http://infocenter.arm.com/help/topic/com.arm.doc.ihi0042e/IHI0042E_aapcs.pdf -- please see 5.3.1.1
Thanks
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.