How to update only a single bit from a byte.
Anubisbot
Posts: 112
Hi, how di i update only a single bit from a byte.
I have a byte caled state0 and it beginning value is %0000_0001
then i want to update it to %00010_0001
then to %0101_0001 to change a bit without changing the other bits.
is there a way to say bit 5 from stat0 = 0
Thanx Anubisbot
I have a byte caled state0 and it beginning value is %0000_0001
then i want to update it to %00010_0001
then to %0101_0001 to change a bit without changing the other bits.
is there a way to say bit 5 from stat0 = 0
Thanx Anubisbot
Comments
Like: state0 |= %0010_0000
Then: state0 ^= %0111_0000 or some equivalent
Thank you Mike...
Anubisbot