diff options
Diffstat (limited to 'src/col80_modified/icet_to_col80.c')
-rw-r--r-- | src/col80_modified/icet_to_col80.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/col80_modified/icet_to_col80.c b/src/col80_modified/icet_to_col80.c new file mode 100644 index 0000000..aa07223 --- /dev/null +++ b/src/col80_modified/icet_to_col80.c @@ -0,0 +1,26 @@ +#include <stdio.h> + +int main(int argc, char **argv) { + int c, d, byte = 0; + char out[8]; + + do { + c = getchar(); + if(byte == 16) { + for(byte = 0; byte < 8; ++byte) + putchar(out[byte]); + + byte = 0; + } + + if(c != EOF) { + if(byte < 8) { + out[byte] = (c & 0xf0); + ++byte; + } else if(byte < 16) { + out[byte - 8] |= (c & 0x0f); + ++byte; + } + } + } while(c != EOF); +} |