|ARM Technical Support Knowledge Articles|
Applies to: C166 C Compiler
Information in this article applies to:
What is register 0 (R0) used for in the code generated by the C166 compiler? There seems to be a lot of weird stuff going on with it.
The Keil C166 compiler uses R0 to maintain a user stack for local variables and function arguments. The startup code in START166.A166 and START167.A66 includes a section which sets up the user stack.
The user stack grows from the top down. So, as arguments are pushed on the stack, R0 decreases. This is probably the "weird stuff" that you see happening.
Article last edited on: 2006-01-25 20:06:53
Did you find this article helpful? Yes No
How can we improve this article?