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] - Diff between revs 1765 and 1782

Only display areas with differences | Details | Blame | View Log

Rev 1765 Rev 1782
#include <stdio.h>
#include <stdio.h>
 
 
 
 
int main()
int main()
{
{
        int c;
        int c;
        int comma=0;
        int comma=0;
        int count=0;
        int count=0;
        while((c=getchar())!=EOF)
        while((c=getchar())!=EOF)
        {
        {
                unsigned char x=c;
                unsigned char x=c;
                if(comma)
                if(comma)
                        printf(",");
                        printf(",");
                else
                else
                        comma=1;
                        comma=1;
                if(count==8)
                if(count==8)
                {
                {
                        count=0;
                        count=0;
                        printf("\n");
                        printf("\n");
                }
                }
                if(count==0)
                if(count==0)
                        printf("\t");
                        printf("\t");
                printf("0x%02X",c);
                printf("0x%02X",c);
                count++;
                count++;
        }
        }
        if(count)
        if(count)
                printf("\n");
                printf("\n");
        return 0;
        return 0;
}
}
 
 

powered by: WebSVN 2.1.0

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