/ externals / xbyak / gen / b2hex.cpp
b2hex.cpp
 1  #include <stdio.h>
 2  
 3  int main()
 4  {
 5  	puts("enum {");
 6  	for (int i = 0; i < 256; i++) {
 7  		printf("	B");
 8  		for (int j = 0; j < 8; j++) {
 9  			putchar(i & (1 << (7 - j)) ? '1' : '0');
10  		}
11  		printf("= %d", i);
12  		if (i < 255) putchar(',');
13  		putchar('\n');
14  	}
15  	puts("};");
16  	return 0;
17  }