URL
https://opencores.org/ocsvn/zipcpu/zipcpu/trunk
Subversion Repositories zipcpu
Compare Revisions
- This comparison shows the changes necessary to convert path
/zipcpu/trunk/sw
- from Rev 99 to Rev 98
- ↔ Reverse comparison
Rev 99 → Rev 98
/zasm/zdump.cpp
39,7 → 39,7
|
#include "zopcodes.h" |
|
void dump_file(const bool bigend, const char *fn) { |
void dump_file(const char *fn) { |
const int NZIP = 4096; |
char ln[NZIP], lb[NZIP]; |
ZIPI ibuf[NZIP]; |
53,14 → 53,6
printf("%s:\n", fn); |
while((nr=fread(ibuf, sizeof(ZIPI), NZIP, fp))>0) { |
for(int i=0; i<nr; i++) { |
if (bigend) { |
ZIPI bei, lei = ibuf[i]; |
bei = lei&0x0ff; bei<<=8; lei>>= 8; |
bei |= lei&0x0ff; bei<<=8; lei>>= 8; |
bei |= lei&0x0ff; bei<<=8; lei>>= 8; |
bei |= lei&0x0ff; |
ibuf[i] = bei; |
} |
zipi_to_string(ibuf[i], ln, lb); |
// printf("%s\n", ln); |
printf("%08x: (0x%08x %c%c%c%c) %s\n", addr++, |
77,15 → 69,9
} |
|
int main(int argc, char **argv) { |
bool bigend = false; |
for(int argn=1; argn<argc; argn++) { |
if (argv[argn][0] == '-') { |
if (argv[argn][1] == 'B') |
bigend = true; |
else if (argv[argn][1] == 'L') |
bigend = false; |
} else if(access(argv[argn], R_OK)==0) |
dump_file(bigend, argv[argn]); |
if(access(argv[argn], R_OK)==0) |
dump_file(argv[argn]); |
} |
|
return 0; |