Stefan Reinauer dcdbdfb46e first shot of legacybios emulation.
does not work yet.. sorry :-(


git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1119 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2003-09-18 14:16:08 +00:00

30 lines
379 B
C

/*
* bin2hex - binary to hexadecimal converter
*/
#include <stdio.h>
/* 8 values per line */
#define SPLIT 8
int main(int argc, char **argv)
{
int c, i;
i = 0;
while ((c = getchar()) != EOF) {
if ((i % SPLIT) != 0) {
putchar(' ');
}
printf("0x%02x,", c);
i++;
if ((i % SPLIT) == 0) {
putchar('\n');
}
}
putchar('\n');
return 0;
}
// tag: bin2hex