AnsweredAssumed Answered

Segments in HCS12 controller.

Question asked by Vignesh Alagappan on Jul 25, 2006
Latest reply on Jul 26, 2006 by CompilerGuru
Its a very basic question but it would be great if anybody can enlighten me, how it works..

In a function, we have declared couple of variables which are local to function. One of the local variable is initialized to some label. See below function for more clarity:
void MyFunc()
int test1;
int test2 = 2;
char testchar = "HELLO"

/* These variables used here..*/

My question is:
1) How HCS12 knows test char is equal to "HELLO", when ever it control comes to this function.
2) As far my understanding is concerned, linker doesnt allocate memory for local variables. Then how controller knows, these variables declared inside the function?

Pl. clarify my question.