Lets say i have a Byte variable called flags. As you know an integer has 8 bits. Code: 7-6-5-4-3-2-1-0 How would I set bit X where x is 0 to 7? For example: Code: flags equ (audio_clock+SizeByte) FLAG_FRET_GREEN equ 0x1 FLAG_FRET_RED equ 0x2 FLAG_FRET_YELLOW equ 0x4 // now set it ????? I want to set a bit without effecting the other ones. Any assistance in this matter would be greatly appreciated. Sincerely, Scorpion Illuminati
Simply OR the current value with the bitmask. And re-/unset by ANDing it with the inverse of the mask.