URL
https://opencores.org/ocsvn/eco32/eco32/trunk
[/] [eco32/] [trunk/] [tools/] [bin2mcs/] [bin2mcs.c] - Diff between revs 40 and 234
Go to most recent revision |
Show entire file |
Details |
Blame |
View Log
Rev 40 |
Rev 234 |
Line 46... |
Line 46... |
}
|
}
|
outfile = fopen(argv[3], "wt");
|
outfile = fopen(argv[3], "wt");
|
if (outfile == NULL) {
|
if (outfile == NULL) {
|
error("cannot open output file %s", argv[3]);
|
error("cannot open output file %s", argv[3]);
|
}
|
}
|
|
while (1) {
|
|
if ((loadAddr & 0xFFFF) == 0) {
|
fprintf(outfile, ":02000004");
|
fprintf(outfile, ":02000004");
|
fprintf(outfile, "%04X", loadAddr >> 16);
|
fprintf(outfile, "%04X", loadAddr >> 16);
|
chksum = 0x02 + 0x04 +
|
chksum = 0x02 + 0x04 +
|
((loadAddr >> 24) & 0xFF) +
|
((loadAddr >> 24) & 0xFF) +
|
((loadAddr >> 16) & 0xFF);
|
((loadAddr >> 16) & 0xFF);
|
fprintf(outfile, "%02X\n", (-chksum) & 0xFF);
|
fprintf(outfile, "%02X\n", (-chksum) & 0xFF);
|
while (1) {
|
}
|
chksum = 0;
|
chksum = 0;
|
for (numBytes = 0; numBytes < 16; numBytes++) {
|
for (numBytes = 0; numBytes < 16; numBytes++) {
|
c = fgetc(infile);
|
c = fgetc(infile);
|
if (c == EOF) {
|
if (c == EOF) {
|
break;
|
break;
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.