This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Variable initializing problems

Hi,
help me to understand, what is wrong here:

When I wrote:

 void main()
{
    unsigned char t;
    t = 0x20;
    t |= 0x30;
    t = 0x21;    // <- in debuger t=0xF5 !!!
    initProc();
    IOSET = 0x0C;
}

then I wrote:
 void main()
{
    unsigned char t;
	t |= 0x20;
	t = 0x30;
	t = 0x21; // <- now t=0x21 !!!
	initProc();
	IOSET = 0x0C;
}


 void main()
{
    unsigned char t=0x20;
	t |= 0x30;
	t = 0x21;  // <- now t=0xF5 again! :( WHY???
	initProc();
	IOSET = 0x0C;
}

0