Changeset 682


Ignore:
Timestamp:
Sep 10, 2003, 4:39:18 PM (22 years ago)
Author:
bird
Message:

Offsets.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/emx/src/emxomf/listomf.c

    • Property cvs2svn:cvs-rev changed from 1.8 to 1.9
    r681 r682  
    153153  if (show_addr)
    154154    printf ("%ld: %s", rec_pos, name);
     155  else if (hex_dump)
     156    printf ("%08lx: %s", rec_pos, name);
    155157  else
    156158    printf ("%s", name);
     
    379381
    380382
    381 static void dump_block (int count, int indent)
     383static void dump_block (int count, int indent, int foff)
    382384{
    383385  int x;
     
    389391      unsigned int ui = rec_buf[rec_idx++];
    390392      --count;
     393
    391394      if (x >= 16)
    392395        {
     
    399402      ascii[x] = ui;
    400403      if (x == 0)
    401         printf ("%*s", indent, "");
     404        {
     405          if (foff)
     406            printf ("%*s%08lx %03lx:", indent, "",
     407                    rec_pos + rec_idx - 1 + sizeof (struct omf_rec),
     408                    rec_idx - 1 + sizeof (struct omf_rec));
     409          else
     410            printf ("%*s", indent, "");
     411        }
    402412      if (x != 8)
    403413        printf (" %.2x", ui);
     
    421431static void dump_rest (void)
    422432{
    423   dump_block (rec_len - rec_idx, 2);
     433  dump_block (rec_len - rec_idx, 2, 0);
    424434}
    425435
     
    12771287          printf ("  hexdump:\n");
    12781288          rec_idx = start;
    1279           dump_block (len, 3);
     1289          dump_block (len, 3, 1);
    12801290        }
    12811291    }
     
    18351845          printf ("  hexdump:\n");
    18361846          rec_idx = start;
    1837           dump_block (len, 3);
     1847          dump_block (len, 3, 1);
    18381848        }
    18391849    }
     
    18811891      printf ("%*sRepeat count: %lu, data length: %d\n",
    18821892              indent, "", rep_count, len);
    1883       dump_block (len, indent + 2);
     1893      dump_block (len, indent + 2, 0);
    18841894    }
    18851895  else
     
    23052315    {
    23062316      int skip_hexdump = 0;
    2307       if (show_addr)
     2317      if (show_addr || hex_dump)
    23082318        rec_pos = ftell (f);
    23092319      if (fread (&rec, sizeof (rec), 1, f) != 1)
     
    24172427          rec_len = rec.rec_len - 1; /* skip crc */
    24182428          rec_idx = 0;
    2419           dump_block (rec_len, 2);
     2429          dump_block (rec_len, 2, 1);
    24202430        }
    24212431    } while (!done);
Note: See TracChangeset for help on using the changeset viewer.