OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [rc203soc/] [sw/] [uClinux/] [arch/] [i386/] [kernel/] [hexify.c] - Blame information for rev 1782

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1623 jcastillo
#include <stdio.h>
2
 
3
 
4
int main()
5
{
6
        int c;
7
        int comma=0;
8
        int count=0;
9
        while((c=getchar())!=EOF)
10
        {
11
                unsigned char x=c;
12
                if(comma)
13
                        printf(",");
14
                else
15
                        comma=1;
16
                if(count==8)
17
                {
18
                        count=0;
19
                        printf("\n");
20
                }
21
                if(count==0)
22
                        printf("\t");
23
                printf("0x%02X",c);
24
                count++;
25
        }
26
        if(count)
27
                printf("\n");
28
        return 0;
29
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.