1: /*
   2:  * Header for object code improver
   3:  *
   4:  *	Several character buffers (used to store contents of registers,
   5:  *	constants, etc) needed to be increased in size to handle the
   6:  *	larger symbols passed thru from the compiler.
   7:  */
   8: 
   9: #include <stdio.h>
  10: 
  11: #define MAXCPS  32
  12: 
  13: #ifndef CHECK
  14: #define CHECK(x)
  15: #endif
  16: 
  17: #define JBR 1
  18: #define CBR 2
  19: #define JMP 3
  20: #define LABEL   4
  21: #define DLABEL  5
  22: #define EROU    7
  23: #define JSW 9
  24: #define MOV 10
  25: #define CLR 11
  26: #define COM 12
  27: #define INC 13
  28: #define DEC 14
  29: #define NEG 15
  30: #define TST 16
  31: #define ASR 17
  32: #define ASL 18
  33: #define SXT 19
  34: #define CMP 20
  35: #define ADD 21
  36: #define SUB 22
  37: #define BIT 23
  38: #define BIC 24
  39: #define BIS 25
  40: #define MUL 26
  41: #define DIV 27
  42: #define ASH 28
  43: #define XOR 29
  44: #define TEXT    30
  45: #define DATA    31
  46: #define BSS 32
  47: #define EVEN    33
  48: #define MOVF    34
  49: #define MOVOF   35
  50: #define MOVFO   36
  51: #define ADDF    37
  52: #define SUBF    38
  53: #define DIVF    39
  54: #define MULF    40
  55: #define CLRF    41
  56: #define CMPF    42
  57: #define NEGF    43
  58: #define TSTF    44
  59: #define CFCC    45
  60: #define SOB 46
  61: #define JSR 47
  62: #define SWAB    48
  63: #define END 49
  64: 
  65: #define JEQ 0
  66: #define JNE 1
  67: #define JLE 2
  68: #define JGE 3
  69: #define JLT 4
  70: #define JGT 5
  71: #define JLO 6
  72: #define JHI 7
  73: #define JLOS    8
  74: #define JHIS    9
  75: #define JPL 10
  76: #define JMI 11
  77: 
  78: #define BYTE    100
  79: #define LSIZE   512
  80: 
  81: struct node {
  82:     char    op;
  83:     char    subop;
  84:     struct  node    *forw;
  85:     struct  node    *back;
  86:     struct  node    *ref;
  87:     int labno;
  88:     char    *code;
  89:     int refc;
  90: };
  91: 
  92: struct optab {
  93:     char    *opstring;
  94:     int opcode;
  95: } optab[];
  96: 
  97: char    line[LSIZE];
  98: struct  node    first;
  99: char    *curlp;
 100: int nbrbr;
 101: int nsaddr;
 102: int redunm;
 103: int iaftbr;
 104: int njp1;
 105: int nrlab;
 106: int nxjump;
 107: int ncmot;
 108: int nrevbr;
 109: int loopiv;
 110: int nredunj;
 111: int nskip;
 112: int ncomj;
 113: int nsob;
 114: int nrtst;
 115: int nlit;
 116: 
 117: int nchange;
 118: int isn;
 119: int debug;
 120: int lastseg;
 121: char    *lasta;
 122: char    *lastr;
 123: char    *alasta;
 124: char    *alastr;
 125: char    *firstr;
 126: char    revbr[];
 127: char    regs[12][MAXCPS + 1];
 128: char    conloc[MAXCPS + 1];
 129: char    conval[MAXCPS + 1];
 130: char    ccloc[MAXCPS + 1];
 131: 
 132: #define RT1 10
 133: #define RT2 11
 134: #define FREG    5
 135: #define NREG    5
 136: #define LABHS   127
 137: #define OPHS    57
 138: 
 139: struct optab *ophash[OPHS];
 140: struct  node *nonlab();
 141: char    *copy();
 142: char    *sbrk();
 143: char    *findcon();
 144: struct  node *insertl();
 145: struct  node *codemove();
 146: char    *sbrk();
 147: char    *alloc();

Defined variables

alasta defined in line 123; used 4 times
alastr defined in line 124; used 2 times
ccloc defined in line 130; used 8 times
conloc defined in line 128; used 6 times
conval defined in line 129; used 2 times
curlp defined in line 99; used 8 times
debug defined in line 119; used 1 times
first defined in line 98; used 30 times
firstr defined in line 125; used 2 times
iaftbr defined in line 103; used 2 times
isn defined in line 118; used 1 times
lasta defined in line 121; used 5 times
lastr defined in line 122; used 4 times
lastseg defined in line 120; used 5 times
line defined in line 97; used 12 times
loopiv defined in line 109; used 2 times
nbrbr defined in line 100; used 2 times
nchange defined in line 117; used 31 times
ncmot defined in line 107; used 2 times
ncomj defined in line 112; used 2 times
njp1 defined in line 104; used 2 times
nlit defined in line 115; used 2 times
nredunj defined in line 110; used 3 times
nrevbr defined in line 108; used 2 times
nrlab defined in line 105; used 3 times
nrtst defined in line 114; used 3 times
nsaddr defined in line 101; used 7 times
nskip defined in line 111; used 2 times
nsob defined in line 113; used 2 times
nxjump defined in line 106; used 2 times
ophash defined in line 139; used 6 times
optab defined in line 95; used 2 times
redunm defined in line 102; used 2 times
regs defined in line 127; used 114 times
revbr defined in line 126; used 3 times

Defined struct's

node defined in line 81; used 114 times
optab defined in line 92; used 12 times

Defined macros

ADD defined in line 35; used 1 times
ADDF defined in line 51; used 1 times
ASH defined in line 42; used 2 times
ASL defined in line 32; used 1 times
ASR defined in line 31; used 1 times
BIC defined in line 38; used 4 times
BIS defined in line 39; used 3 times
BIT defined in line 37; used 2 times
BSS defined in line 46; used 4 times
BYTE defined in line 78; used 8 times
CBR defined in line 18; used 26 times
CFCC defined in line 59; used 3 times
CHECK defined in line 14; used 13 times
CLR defined in line 25; used 7 times
CLRF defined in line 55; used 1 times
CMP defined in line 34; used 3 times
CMPF defined in line 56; used 1 times
COM defined in line 26; used 1 times
DATA defined in line 45; used 5 times
DEC defined in line 28; used 2 times
DIV defined in line 41; used 2 times
DIVF defined in line 53; used 1 times
DLABEL defined in line 21; used 2 times
END defined in line 63; used 4 times
EROU defined in line 22; used 3 times
EVEN defined in line 47; used 1 times
FREG defined in line 134; never used
INC defined in line 27; used 1 times
JBR defined in line 17; used 72 times
JEQ defined in line 65; used 8 times
JGE defined in line 68; used 25 times
JGT defined in line 70; used 6 times
JHI defined in line 72; used 3 times
JHIS defined in line 74; used 3 times
JLE defined in line 67; used 22 times
JLO defined in line 71; used 3 times
JLOS defined in line 73; used 3 times
JLT defined in line 69; used 10 times
JMI defined in line 76; used 3 times
JMP defined in line 19; used 5 times
JNE defined in line 66; used 24 times
JPL defined in line 75; used 3 times
JSR defined in line 61; used 1 times
JSW defined in line 23; used 4 times
LABEL defined in line 20; used 17 times
LABHS defined in line 136; used 4 times
LSIZE defined in line 79; used 2 times
MAXCPS defined in line 11; used 5 times
MOV defined in line 24; used 5 times
MOVF defined in line 48; used 1 times
MOVFO defined in line 50; used 1 times
MOVOF defined in line 49; used 1 times
MUL defined in line 40; used 1 times
MULF defined in line 54; used 1 times
NEG defined in line 29; used 1 times
NEGF defined in line 57; used 1 times
NREG defined in line 135; used 13 times
OPHS defined in line 137; used 5 times
RT1 defined in line 132; used 57 times
RT2 defined in line 133; used 48 times
SOB defined in line 60; used 2 times
SUB defined in line 36; used 1 times
SUBF defined in line 52; used 1 times
SWAB defined in line 62; used 2 times
SXT defined in line 33; used 3 times
TEXT defined in line 44; used 5 times
TST defined in line 30; used 12 times
TSTF defined in line 58; used 1 times
XOR defined in line 43; used 1 times

Usage of this include

c2.h used 2 times
Last modified: 1994-01-03
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 2019
Valid CSS Valid XHTML 1.0 Strict