Rev 66 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 66 | Rev 288 | ||
|---|---|---|---|
| Line 16... | Line 16... | ||
| 16 | BYTE s[256]; |
16 | BYTE s[256]; |
| 17 | BYTE buff[0x10000]; |
17 | BYTE buff[0x10000]; |
| 18 | FILE* f; |
18 | FILE* f; |
| 19 | 19 | ||
| 20 | printf("BinnaryFile_To_AVRAssmFile Converter\n"); |
20 | printf("BinnaryFile_To_AVRAssmFile Converter\n"); |
| 21 | if (argc==1) { printf("usage: BIN2AVR <FileName> [0]\n"); return 2; } |
21 | if (argc==1) { printf("usage: bin2avr <FileName> [0]\n"); return 2; } |
| 22 | az=0; |
22 | az=0; |
| 23 | if (argc==3) |
23 | if (argc==3) |
| 24 | { |
24 | { |
| 25 | strncpy(s,argv[2],1); |
25 | strncpy(s,argv[2],1); |
| 26 | if (s[0]=='0') az=1; |
26 | if (s[0]=='0') az=1; |
| Line 62... | Line 62... | ||
| 62 | fputc(h[b0&0x0f],f); |
62 | fputc(h[b0&0x0f],f); |
| 63 | if (l==7) |
63 | if (l==7) |
| 64 | fputc('\n',f); |
64 | fputc('\n',f); |
| 65 | else |
65 | else |
| 66 | if (i<z) fputc(',',f); |
66 | if (i<z) fputc(',',f); |
| 67 | l=(++l)&0x07; |
67 | l++; l&=0x07; |
| 68 | } |
68 | } |
| 69 | while (i<z); |
69 | while (i<z); |
| 70 | fputc('\n',f); |
70 | fputc('\n',f); |
| 71 | fclose(f); |
71 | fclose(f); |
| 72 | printf("Created file %s\n",s); |
72 | printf("Created file %s\n",s); |