Skip to content

Instantly share code, notes, and snippets.

@Polda18
Last active January 29, 2018 12:05
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 Polda18/ec8a0752cd52033ba2a96ecff538ce1c to your computer and use it in GitHub Desktop.
Save Polda18/ec8a0752cd52033ba2a96ecff538ce1c to your computer and use it in GitHub Desktop.
Bytes text representation with 0x00-0xff hexadecimal ASCII table
#include <stdio.h>
#include <stdlib.h>
int main(void) {
fprintf(stdout, ">> X0 X1 X2 X3 X4 X5 X6 X7 X8 X9 XA XB XC XD XE XF\n");
for(int i = 0; i < 16; ++i) {
fprintf(stdout, "%XX", i);
for(int j = 0; j < 16; ++j) {
unsigned char num = i * 16 + j;
if(num < 0x20)
fprintf(stdout, " ..");
else
fprintf(stdout, " %c", num);
}
fprintf(stdout, "\n");
}
fprintf(stdout, "--------------------------------------------------\n");
fprintf(stdout, "OEM DISPLAY 256 CHARS ::: BYTES TEXT REPRESENTATES\n");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment