home *** CD-ROM | disk | FTP | other *** search
- main() /* peek.c -- illustrates use of peek (a la a dump */
- {
- int i, j, v;
- long a, a2;
-
- cls();
- puts("Hex/ASCII dump of 256 bytes of memory");
- printf("Absolute decimal address? ");
- scanf("%ld",&a);
- for (i = 0; i < 256; i += 16, a += 16) {
- printf("%05lx: ",a);
- a2 = a;
- for (j = 0; j < 16; j++, a2++)
- printf("%02x ",peek(a2));
- a2 = a;
- for (j = 0; j < 16; j++, a2++) {
- v = peek(a2);
- if (v < 32)
- printf(".");
- else
- printf("%c",v);
- }
- printf("\n");
- }
- }