/* Project 16 Source Code~\r
- * Copyright (C) 2012-2017 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover\r
+ * Copyright (C) 2012-2022 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover\r
*\r
* This file is part of Project 16.\r
*\r
}\r
}\r
#endif\r
-\r
-const char *word_to_binary(word x)\r
-{\r
- static char b[17];\r
- int z;\r
-\r
- b[0] = '\0';\r
- for (z = 16; z > 0; z >>= 1)\r
- {\r
- strcat(b, ((x & z) == z) ? "1" : "0");\r
- }\r
- return b;\r
-}\r
-\r
-const char *nibble_to_binary(nibble x)\r
-{\r
- static char b[9];\r
- int z;\r
-\r
- b[0] = '\0';\r
- for (z = 8; z > 0; z >>= 1)\r
- {\r
- strcat(b, ((x & z) == z) ? "1" : "0");\r
- }\r
- return b;\r
-}\r
-\r
-const char *boolean_to_binary(boolean x)\r
-{\r
- static char b[9];\r
- int z;\r
-\r
- b[0] = '\0';\r
- for (z = 1; z > 0; z >>= 1)\r
- {\r
- strcat(b, ((x & z) == z) ? "1" : "0");\r
- }\r
- return b;\r
-}\r
-\r
-void nibbletest()\r
-{\r
- nibble pee;\r
- printf("nibbletest\n");\r
- /* nibble to binary string */\r
- for(pee=0;pee<18;pee++)\r
- printf(" %u %s\n", pee, nibble_to_binary(pee));\r
- printf(" sizeof(nibble)=%s\n", nibble_to_binary(sizeof(nibble)));\r
- printf("end of nibble test\n");\r
-}\r
-\r
-void booleantest()\r
-{\r
- boolean pee;\r
- printf("booleantest\n");\r
- /* boolean to binary string */\r
- for(pee=0;pee<4;pee++)\r
- printf(" %u %s\n", pee, boolean_to_binary(pee));\r
- printf(" sizeof(boolean)=%s\n", boolean_to_binary(sizeof(boolean)));\r
- printf("end of boolean test\n");\r
-}\r