Skip to content

Instantly share code, notes, and snippets.

@RenatoUtsch
Last active August 29, 2015 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RenatoUtsch/0d521959f25c6f09f6d1 to your computer and use it in GitHub Desktop.
Save RenatoUtsch/0d521959f25c6f09f6d1 to your computer and use it in GitHub Desktop.
// Print an unsigned byte (8 bits) in binary digits.
void print_accu(unsigned char accu) {
int i, j;
for(i = 0x80, j = 0; j < 8; i /= 2)
putchar('0' + ((accu & i) >> (7 - j++)));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment