Is CTR a volatile register?

Started by dcx2, July 24, 2010, 04:04:14 AM

Previous topic - Next topic

dcx2

Let's say I wanted to use the CTR register in a code.  Do I need to backup the value?

I'm assuming that if my hook is in the middle of a loop that I should preserve the value, but do I need to search beyond the current scope of the function I'm hooking?

In other words, is the CTR register volatile across function calls?

I'm inclined to think that it is volatile, because I never see the code backing up the CTR value to the stack.  So, assuming my hook isn't in the middle of a loop I should be able to use CTR without saving the contents.  But I'd be interested in hearing if anyone else happens to know.