| ||||||||
Technical Support Support Resources Product Information | C166: WHAT IS R0 USED FOR?Information in this article applies to:
QUESTIONWhat 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. ANSWERThe 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. Last Reviewed: Wednesday, January 25, 2006 | |||||||
| ||||||||