1: # include   <stdio.h>
   2: #ifdef vax
   3: #define WORD    unsigned short
   4: #endif vax
   5: #ifdef pdp11
   6: #define WORD    unsigned
   7: #endif pdp11
   8: 
   9: /********************* structure declarations *************************/
  10: 
  11: struct psect        /* program section structure
  12: 			** Since program sections have to be referenced in
  13: 			** different ways,  there are multiple link-lists
  14: 			** running through each structure.
  15: 			** Program sections are referenced 1) by ins-dat-bss
  16: 			** type to facilitate the computation of relocation
  17: 			** constants (*next), 2) by object file so that relocation
  18: 			** constants may be found when interpreting the code
  19: 			** section within a object file (*obsame).
  20: 			** In addition global program sections of the same
  21: 			** name and type must be grouped together (*pssame).
  22: 			** Also, a list of global relocatable symbols defined
  23: 			** in the psect in used to relocate these
  24: 			** symbols (*slist). */
  25: {
  26:     char        name[7];
  27:     char        type;       /* attribute byte from M11 */
  28:     int     nbytes;     /* number of bytes in psect */
  29:     WORD        rc;     /* relocation constant */
  30:     struct psect    *next;      /* next psect of same ins-dat-bss type */
  31:     struct psect    *pssame;    /* same psect from different object file */
  32:     struct psect    *obsame;    /* next psect in same object file */
  33:     struct symbol   *slist;     /* list of symbols defined in this psect */
  34: };
  35: 
  36: 
  37: struct symbol           /* global symbol structure, the symbol
  38: 				** table is a binary tree of these structures .
  39: 				** There are also link-lists from each psect
  40: 				** running through the symbol table to
  41: 				** facilitate  the relocation of symbols. */
  42: {
  43:     char        name[7];
  44:     char        type;       /* attribute byte from M11 */
  45:     int     value;
  46:     int     t_numb;     /* number of the symbol in the out
  47: 					** file symbol table */
  48:     struct symbol   *symlist;   /* continuation of list of symbols
  49: 					** defined in this symbol's psect */
  50:     struct psect    *prsect;    /* program section of the symbol */
  51:     struct symbol   *left;      /* left child */
  52:     struct symbol   *right;     /* right child */
  53: };
  54: 
  55: 
  56: struct objfile      /* object file structure */
  57: {
  58:     char        *fname;
  59:     struct objfile  *nextfile;  /* next file in link-list of files */
  60:     struct psect    *psect_list;    /* root to link-list of psects
  61: 					** in this object file */
  62:     char        pname[7];   /* program name */
  63:     char        *ver_id;    /* version identification */
  64: };
  65: 
  66: 
  67: struct outword      /* structure for linking a word to be written in
  68: 			** the out file with its relocation bits */
  69: {
  70:     WORD    val;
  71:     WORD    rbits;
  72: };
  73: 
  74: 
  75: struct g_sect       /* structure for global program section tree */
  76: {
  77:     char        name[7];    /* psect name */
  78:     char        type;       /* M11 coded type */
  79:     struct psect    *last_sect; /* pointer to the last psect in the
  80: 					** link-list of global same psects */
  81:     struct g_sect   *leftt;     /* left child */
  82:     struct g_sect   *rightt;    /* right child */
  83: };
  84: 
  85: 
  86: /***********************  macros  ****************************************/
  87: 
  88: 
  89:     /* macros for requesting input from the different parts of the
  90: 	** object files. */
  91: 
  92: # define    HEADER      001
  93: # define    CODE        017
  94: # define    SYMBOLS     022
  95: 
  96:     /* bit flags for attributes of psects and symbols */
  97: 
  98: # define    SHR     001
  99: # define    INS     002
 100: # define    BSS     004
 101: # define    DEF     010
 102: # define    OVR     020
 103: # define    REL     040
 104: # define    GBL     0100
 105: 
 106: # define    isabs(x)    (((x)->type & REL) == 0)
 107: # define    isrel(x)    (((x)->type & REL) != 0)
 108: # define    islcl(x)    (((x)->type & GBL) == 0)
 109: # define    isgbl(x)    (((x)->type & GBL) != 0)
 110: # define    isprv(x)    (((x)->type & SHR) == 0)
 111: # define    isshr(x)    (((x)->type & SHR) != 0)
 112: # define    isins(x)    (((x)->type & INS) != 0)
 113: # define    isbss(x)    (((x)->type & BSS) != 0)
 114: # define    isovr(x)    (((x)->type & OVR) != 0)
 115: # define    iscon(x)    (((x)->type & OVR) == 0)
 116: # define    isdef(x)    (((x)->type & DEF) != 0)
 117: # define    isudf(x)    (((x)->type & DEF) == 0)

Defined struct's

g_sect defined in line 75; used 20 times
objfile defined in line 56; used 36 times
outword defined in line 67; used 14 times
psect defined in line 11; used 56 times
symbol defined in line 37; used 41 times

Defined macros

BSS defined in line 100; used 6 times
CODE defined in line 93; used 2 times
DEF defined in line 101; used 7 times
GBL defined in line 104; used 3 times
HEADER defined in line 92; used 1 times
INS defined in line 99; used 7 times
OVR defined in line 102; used 4 times
REL defined in line 103; used 7 times
SHR defined in line 98; used 4 times
SYMBOLS defined in line 94; used 2 times
WORD defined in line 6; used 32 times
isabs defined in line 106; used 1 times
isbss defined in line 113; never used
iscon defined in line 115; never used
isdef defined in line 116; used 1 times
isgbl defined in line 109; never used
isins defined in line 112; never used
islcl defined in line 108; never used
isovr defined in line 114; never used
isprv defined in line 110; never used
isrel defined in line 107; never used
isshr defined in line 111; never used
isudf defined in line 117; never used

Usage of this include

Last modified: 1982-12-11
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 2861
Valid CSS Valid XHTML 1.0 Strict