Hi, I want to know the address of a bit variable. For example:
bit gBit; func() { printf("%d", &gBit); }
So it also records all the addresses of bit variables that need to initialized before the main function is called. By using this address of the bit variable, it can give the bit variable initial value. The initialization code converts the bit address into a byte.bit address and then uses and and or to mask and set the bit accordingly. There is no instruction on the 8051 that supports indirect access to bits. It has to be done manually. Jon
The initialization code converts the bit address into a byte.bit address and then uses and and or to mask and set the bit accordingly Jon, you scared me there. I had a look and GBvfdBusy = TRUE; does, indeed, compile to SETB GBvfdBusy wiping sweat off forhead Erik
I'm talking about global bit variable initialization. We would never do something like this for local bit initialization (which use the SETB and CLR instructions). Jon
my example above IS a global bit.
Just got it two statements in one heap the bit address is converted into a byte.bit address before it is used The initialization code ... uses and and or to mask and set the bit accordingly