1: /*
   2:  * Copyright (c) 1980 Regents of the University of California.
   3:  * All rights reserved.  The Berkeley software License Agreement
   4:  * specifies the terms and conditions for redistribution.
   5:  */
   6: 
   7: #ifndef lint
   8: static char sccsid[] = "@(#)printdata.c	5.1 (Berkeley) 6/6/85";
   9: #endif not lint
  10: /*
  11:  * print contents of data addresses in octal
  12:  *
  13:  * There are two entries:  one is given a range of addresses,
  14:  * the other is given a count and a starting address.
  15:  */
  16: 
  17: #include "defs.h"
  18: #include "machine.h"
  19: #include "process.h"
  20: #include "object.h"
  21: 
  22: #define WORDSPERLINE 4
  23: 
  24: /*
  25:  * print words from lowaddr to highaddr
  26:  */
  27: 
  28: printdata(lowaddr, highaddr)
  29: ADDRESS lowaddr;
  30: ADDRESS highaddr;
  31: {
  32:     register int count;
  33:     register ADDRESS addr;
  34:     int val;
  35: 
  36:     if (lowaddr > highaddr) {
  37:         error("first address larger than second");
  38:     }
  39:     count = 0;
  40:     for (addr = lowaddr; addr <= highaddr; addr += sizeof(int)) {
  41:         if (count == 0) {
  42:             printf("%8x: ", addr);
  43:         }
  44:         dread(&val, addr, sizeof(val));
  45:         printf("  %8x", val);
  46:         if (++count >= WORDSPERLINE) {
  47:             putchar('\n');
  48:             count = 0;
  49:         }
  50:     }
  51:     if (count != 0) {
  52:         putchar('\n');
  53:     }
  54: }
  55: 
  56: /*
  57:  * print count words starting at address
  58:  */
  59: 
  60: printndata(count, addr)
  61: int count;
  62: ADDRESS addr;
  63: {
  64:     printdata(addr, addr + (count - 1)*sizeof(int));
  65: }

Defined functions

printdata defined in line 28; used 1 times
  • in line 64
printndata defined in line 60; never used

Defined variables

sccsid defined in line 8; never used

Defined macros

WORDSPERLINE defined in line 22; used 1 times
  • in line 46
Last modified: 1985-06-06
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 2024
Valid CSS Valid XHTML 1.0 Strict