??? 02/03/09 13:26 Read: times |
#161996 - Just use plain C. Responding to: ???'s previous message |
/* Set bit designated by index. */ var1 = var1 | ((unsigned char) 1 << index); /* Clear bit designated by index */ var1 = var1 & ~((unsigned char) 1 << index); /* Copy bit designated by index to result. */ if(var1 & ((unsigned char) 1 << index)) { result = 1; } else { result = 0; } |
Topic | Author | Date |
C51 compiler - Writing to a bit, using an index | 01/01/70 00:00 | |
Note that ^ also represents xor | 01/01/70 00:00 | |
Ouch!!! | 01/01/70 00:00 | |
Is there a way to use a pointer to access a bit | 01/01/70 00:00 | |
Just use plain C. | 01/01/70 00:00 | |
Just use plain C![]() | 01/01/70 00:00 |