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

Subversion Repositories zipcpu

[/] [zipcpu/] [trunk/] [sw/] [zasm/] [zdump.cpp] - Diff between revs 2 and 12

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

Rev 2 Rev 12
Line 42... Line 42...
        const   int     NZIP = 4096;
        const   int     NZIP = 4096;
        char    ln[NZIP];
        char    ln[NZIP];
        ZIPI    ibuf[NZIP];
        ZIPI    ibuf[NZIP];
        FILE    *fp;
        FILE    *fp;
        int     nr;
        int     nr;
        int     lineno=0;
        int     addr=0x08000;
 
 
        fp = fopen(fn, "r");
        fp = fopen(fn, "r");
        if (!fp)
        if (!fp)
                return;
                return;
        printf("%s:\n", fn);
        printf("%s:\n", fn);
        while((nr=fread(ibuf, sizeof(ZIPI), NZIP, fp))>0) {
        while((nr=fread(ibuf, sizeof(ZIPI), NZIP, fp))>0) {
                for(int i=0; i<nr; i++) {
                for(int i=0; i<nr; i++) {
                        zipi_to_string(ibuf[i], ln);
                        zipi_to_string(ibuf[i], ln);
                        // printf("%s\n", ln);
                        // printf("%s\n", ln);
                        printf("%08x: (0x%08x) %s\n", lineno, ibuf[i], ln);
                        printf("%08x: (0x%08x) %s\n", addr++, ibuf[i], ln);
                }
                }
        } fclose(fp);
        } fclose(fp);
}
}
 
 
int main(int argc, char **argv) {
int main(int argc, char **argv) {

powered by: WebSVN 2.1.0

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