Skip to content

Instantly share code, notes, and snippets.

@BonfaceKilz
Created December 29, 2016 15:14
Show Gist options
  • Save BonfaceKilz/b3e32c83517ca35bbf707fd0aea37f70 to your computer and use it in GitHub Desktop.
Save BonfaceKilz/b3e32c83517ca35bbf707fd0aea37f70 to your computer and use it in GitHub Desktop.
Masking- All you need to know in order to understand what masking is in a nutshell

A mask defines what mask you want to keep, and which bits you want to clear. Masking is the act of applying a mask to a value. This is accomplished by:

  1. Bitwise ANDing in order to extract a subset of the bits in the value
  2. Bitwise ORing in order to set a subset of the bits in the value
  3. Bitwise XORing in order to toggle a subset of the bits in the value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment