1: /*	c2.h	4.10	85/08/22	*/
   2: 
   3: /*
   4:  * Header for object code improver
   5:  */
   6: 
   7: #define JBR 1
   8: #define CBR 2
   9: #define JMP 3
  10: #define LABEL   4
  11: #define DLABEL  5
  12: #define EROU    7
  13: #define JSW 9
  14: #define MOV 10
  15: #define CLR 11
  16: #define INC 12
  17: #define DEC 13
  18: #define TST 14
  19: #define PUSH    15
  20: #define CVT 16
  21: #define CMP 17
  22: #define ADD 18
  23: #define SUB 19
  24: #define BIT 20
  25: #define BIC 21
  26: #define BIS 22
  27: #define XOR 23
  28: #define COM 24
  29: #define NEG 25
  30: #define MUL 26
  31: #define DIV 27
  32: #define ASH 28
  33: #define EXTV    29
  34: #define EXTZV   30
  35: #define INSV    31
  36: #define CALLS   32
  37: #define RET 33
  38: #define CASE    34
  39: #define SOB 35
  40: #define TEXT    36
  41: #define DATA    37
  42: #define BSS 38
  43: #define ALIGN   39
  44: #define END 40
  45: #define MOVZ 41
  46: #define WGEN 42
  47: #define SOBGEQ 43
  48: #define SOBGTR 44
  49: #define AOBLEQ 45
  50: #define AOBLSS 46
  51: #define ACB 47
  52: #define MOVA 48
  53: #define PUSHA 49
  54: #define LGEN 50
  55: #define SET 51
  56: #define MOVC3 52
  57: #define RSB 53
  58: #define JSB 54
  59: #define MFPR 55
  60: #define MTPR 56
  61: #define PROBER 57
  62: #define PROBEW 58
  63: #define LCOMM 59
  64: #define COMM 60
  65: 
  66: #define JEQ 0
  67: #define JNE 1
  68: #define JLE 2
  69: #define JGE 3
  70: #define JLT 4
  71: #define JGT 5
  72: /* rearranged for unsigned branches so that jxxu = jxx + 6 */
  73: #define JLOS    8
  74: #define JHIS    9
  75: #define JLO 10
  76: #define JHI 11
  77: 
  78: #define JBC 12
  79: #define JBS 13
  80: #define JLBC 14
  81: #define JLBS 15
  82: #define JBCC 16
  83: #define JBSC 17
  84: #define JBCS 18
  85: #define JBSS 19
  86: 
  87: #define JCC 20
  88: #define JCS 21
  89: #define JVC 22
  90: #define JVS 23
  91: 
  92: /*
  93:  *	When the new opcodes were added, the relative
  94:  *	ordering of the first 3 (those that are not float)
  95:  *	had to be retained, so that other parts of the program
  96:  *	were not broken.
  97:  *
  98:  *	In addition, the distance between OP3 and OP2 must be preserved.
  99:  *	The order of definitions above OP2 must not be changed.
 100:  *
 101:  *	Note that these definitions DO NOT correspond to
 102:  *	those definitions used in as, adb and sdb.
 103:  */
 104: #define BYTE    1
 105: #define WORD    2
 106: #define LONG    3
 107: #define FFLOAT  4
 108: #define DFLOAT  5
 109: #define QUAD    6
 110: #define OP2 7
 111: #define OP3 8
 112: #define OPB 9
 113: #define OPX 10
 114: #define GFLOAT  11
 115: #define HFLOAT  12
 116: #define OCTA    13
 117: 
 118: #define T(a,b) (a|((b)<<8))
 119: #define U(a,b) (a|((b)<<4))
 120: 
 121: #define C2_ASIZE 128
 122: 
 123: struct optab {
 124:     char    opstring[7];
 125:     short   opcode;
 126: } optab[];
 127: 
 128: struct node {
 129:     union {
 130:         struct {
 131:             char op_op;
 132:             char op_subop;
 133:         } un_op;
 134:         short   un_combop;
 135:     } op_un;
 136:     short   refc;
 137:     struct  node    *forw;
 138:     struct  node    *back;
 139:     struct  node    *ref;
 140:     char    *code;
 141:     struct  optab   *pop;
 142:     long    labno;
 143:     short   seq;
 144: };
 145: 
 146: #define op op_un.un_op.op_op
 147: #define subop op_un.un_op.op_subop
 148: #define combop op_un.un_combop
 149: 
 150: char    line[512];
 151: struct  node    first;
 152: char    *curlp;
 153: int nbrbr;
 154: int nsaddr;
 155: int redunm;
 156: int iaftbr;
 157: int njp1;
 158: int nrlab;
 159: int nxjump;
 160: int ncmot;
 161: int nrevbr;
 162: int loopiv;
 163: int nredunj;
 164: int nskip;
 165: int ncomj;
 166: int nsob;
 167: int nrtst;
 168: int nbj;
 169: int nfield;
 170: 
 171: int nchange;
 172: long    isn;
 173: int debug;
 174: char    revbr[];
 175: #define NREG    12
 176: char    *regs[NREG+5]; /* 0-11, 4 for operands, 1 for running off end */
 177: char    conloc[C2_ASIZE];
 178: char    conval[C2_ASIZE];
 179: char    ccloc[C2_ASIZE];
 180: 
 181: #define RT1 12
 182: #define RT2 13
 183: #define RT3 14
 184: #define RT4 15
 185: #define LABHS   127
 186: 
 187: char *copy();
 188: long getnum();
 189: struct node *codemove();
 190: struct node *insertl();
 191: struct node *nonlab();
 192: 
 193: #ifdef notdef
 194: #define decref(p) \
 195:     ((p) && --(p)->refc <= 0 ? nrlab++, delnode(p) : 0)
 196: #define delnode(p) \
 197:     ((p)->back->forw = (p)->forw, (p)->forw->back = (p)->back)
 198: #endif notdef
 199: 
 200: char *xalloc();
 201: extern char *newa;
 202: extern char *lasta;
 203: extern char *lastr;
 204: #define XALIGN(n) \
 205:         (((n)+(sizeof (char *) - 1)) & ~(sizeof (char *) - 1))
 206: #define alloc(n) \
 207:         ((struct node *) \
 208:          ((newa = lasta) + (n) > lastr ? \
 209:             xalloc(n) : \
 210:             (lasta += XALIGN(n), newa)))

Defined variables

ccloc defined in line 179; used 12 times
conloc defined in line 177; used 9 times
conval defined in line 178; used 4 times
curlp defined in line 152; used 16 times
debug defined in line 173; used 4 times
first defined in line 151; used 24 times
iaftbr defined in line 156; used 2 times
isn defined in line 172; used 8 times
line defined in line 150; used 17 times
loopiv defined in line 162; used 2 times
nbj defined in line 168; used 4 times
nbrbr defined in line 153; used 2 times
nchange defined in line 171; used 22 times
ncmot defined in line 160; used 2 times
ncomj defined in line 165; used 2 times
nfield defined in line 169; used 2 times
njp1 defined in line 157; used 2 times
nredunj defined in line 163; used 2 times
nrevbr defined in line 161; used 2 times
nrlab defined in line 158; used 4 times
nrtst defined in line 167; used 3 times
nsaddr defined in line 154; used 3 times
nskip defined in line 164; used 2 times
nsob defined in line 166; used 4 times
nxjump defined in line 159; used 2 times
optab defined in line 126; used 2 times
redunm defined in line 155; used 8 times
regs defined in line 176; used 215 times
revbr defined in line 174; used 3 times

Defined struct's

node defined in line 128; used 126 times
optab defined in line 123; used 30 times

Defined macros

ACB defined in line 51; used 2 times
ADD defined in line 22; used 7 times
ALIGN defined in line 43; used 1 times
AOBLEQ defined in line 49; used 2 times
AOBLSS defined in line 50; used 2 times
ASH defined in line 32; used 3 times
BIC defined in line 25; used 1 times
BIS defined in line 26; used 2 times
BIT defined in line 24; used 1 times
BSS defined in line 42; never used
BYTE defined in line 104; used 11 times
C2_ASIZE defined in line 121; used 8 times
CALLS defined in line 36; used 1 times
CASE defined in line 38; used 2 times
CBR defined in line 8; used 17 times
CLR defined in line 15; used 1 times
CMP defined in line 21; used 3 times
COM defined in line 28; used 1 times
COMM defined in line 64; never used
CVT defined in line 20; used 7 times
DATA defined in line 41; used 1 times
DEC defined in line 17; used 5 times
DFLOAT defined in line 108; used 3 times
DIV defined in line 31; used 1 times
DLABEL defined in line 11; used 3 times
END defined in line 44; used 4 times
EROU defined in line 12; used 2 times
EXTV defined in line 33; used 2 times
EXTZV defined in line 34; used 2 times
FFLOAT defined in line 107; used 5 times
GFLOAT defined in line 114; used 3 times
HFLOAT defined in line 115; used 3 times
INC defined in line 16; used 4 times
INSV defined in line 35; used 1 times
JBC defined in line 78; used 5 times
JBCC defined in line 82; used 3 times
JBCS defined in line 84; used 1 times
JBR defined in line 7; used 19 times
JBS defined in line 79; used 2 times
JBSC defined in line 83; used 1 times
JBSS defined in line 85; used 2 times
JCC defined in line 87; never used
JCS defined in line 88; never used
JEQ defined in line 66; used 7 times
JGE defined in line 69; used 3 times
JGT defined in line 71; used 2 times
JHI defined in line 76; used 1 times
JHIS defined in line 74; used 1 times
JLBC defined in line 80; used 2 times
JLBS defined in line 81; used 1 times
JLE defined in line 68; used 5 times
JLO defined in line 75; used 1 times
JLOS defined in line 73; used 1 times
JLT defined in line 70; used 2 times
JMP defined in line 9; used 4 times
JNE defined in line 67; used 4 times
JSB defined in line 58; never used
JSW defined in line 13; used 5 times
JVC defined in line 89; never used
JVS defined in line 90; never used
LABEL defined in line 10; used 22 times
LABHS defined in line 185; used 4 times
LCOMM defined in line 63; never used
LGEN defined in line 54; never used
LONG defined in line 106; used 33 times
MFPR defined in line 59; never used
MOV defined in line 14; used 12 times
MOVA defined in line 52; used 9 times
MOVC3 defined in line 56; used 2 times
MOVZ defined in line 45; used 6 times
MTPR defined in line 60; never used
MUL defined in line 30; used 2 times
NEG defined in line 29; used 1 times
NREG defined in line 175; used 7 times
OCTA defined in line 116; used 1 times
OP2 defined in line 110; used 17 times
OP3 defined in line 111; used 7 times
OPB defined in line 112; used 1 times
OPX defined in line 113; used 3 times
PROBER defined in line 61; used 1 times
PROBEW defined in line 62; used 1 times
PUSH defined in line 19; used 7 times
PUSHA defined in line 53; used 4 times
QUAD defined in line 109; used 2 times
RET defined in line 37; used 3 times
RSB defined in line 57; used 3 times
RT1 defined in line 181; used 67 times
RT2 defined in line 182; used 60 times
RT3 defined in line 183; used 28 times
RT4 defined in line 184; used 5 times
SET defined in line 55; never used
SOB defined in line 39; never used
SOBGEQ defined in line 47; used 2 times
SOBGTR defined in line 48; used 2 times
SUB defined in line 23; used 2 times
T defined in line 118; used 21 times
TEXT defined in line 40; used 1 times
TST defined in line 18; used 5 times
U defined in line 119; used 11 times
WGEN defined in line 46; used 1 times
WORD defined in line 105; used 4 times
XALIGN defined in line 204; used 2 times
XOR defined in line 27; used 1 times
alloc defined in line 206; used 8 times
combop defined in line 148; used 44 times
decref defined in line 194; used 12 times
delnode defined in line 196; used 25 times
op defined in line 146; used 147 times
subop defined in line 147; used 105 times

Usage of this include

Last modified: 1985-08-25
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 2308
Valid CSS Valid XHTML 1.0 Strict