News

MAKING IT EASIER TO DEBUG Debugging on an 8-bit microcontroller without ICE (in-circuit emulation) hardware can be an exercise in patience. Developers using 32-bit processors are used to much more.
Bit Twiddling Hacks is exactly as described; a page full of snippets and suggestions for how to perform all manner of bit math in convenient or efficient ways.
If you need to toggle a bit, logical exclusive or (XOR, or the ^ operator) is the tool of choice. I’m just showing one of the most basic ways to perform shift and mask. There are plenty of ways ...