summaryrefslogtreecommitdiffstats
path: root/arch/i386/kernel/hexify.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/i386/kernel/hexify.c')
-rw-r--r--arch/i386/kernel/hexify.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/arch/i386/kernel/hexify.c b/arch/i386/kernel/hexify.c
new file mode 100644
index 000000000..daa331fec
--- /dev/null
+++ b/arch/i386/kernel/hexify.c
@@ -0,0 +1,31 @@
+#include <stdio.h>
+
+
+void main()
+{
+ int c;
+ int comma=0;
+ int count=0;
+ while((c=getchar())!=EOF)
+ {
+ unsigned char x=c;
+ if(comma)
+ printf(",");
+ else
+ comma=1;
+ if(count==8)
+ {
+ count=0;
+ printf("\n");
+ }
+ if(count==0)
+ printf("\t");
+ printf("0x%02X",c);
+ count++;
+ }
+ if(count)
+ printf("\n");
+ exit(0);
+}
+
+