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

Subversion Repositories c16

[/] [c16/] [trunk/] [bin2array.cc] - Diff between revs 2 and 26

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 2 Rev 26
Line 1... Line 1...
 
#include <stdio.h>
 
#include <assert.h>
 
 
 
int main(int argc, char * argv[])
 
{
 
   assert(argc == 2);
 
 
 
FILE * in = fopen(argv[1], "rb");
 
   assert(in);
 
 
 
unsigned char buffer[8];
 
 
 
   for (;;)
 
      {
 
        int len = fread(buffer, 1, 8, in);
 
        if (len <= 0)   break;
 
        printf("    ");
 
        for (int i = 0; i < len; i++)   printf("0x%2.2X, ", buffer[i]);
 
        printf("\n");
 
      }
 
}
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

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