Research V7 development
[unix-history] / usr / src / cmd / c / c2.h
CommitLineData
1a3b21a9
DR
1/*
2 * Header for object code improver
3 */
4
5#include <stdio.h>
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 COM 12
17#define INC 13
18#define DEC 14
19#define NEG 15
20#define TST 16
21#define ASR 17
22#define ASL 18
23#define SXT 19
24#define CMP 20
25#define ADD 21
26#define SUB 22
27#define BIT 23
28#define BIC 24
29#define BIS 25
30#define MUL 26
31#define DIV 27
32#define ASH 28
33#define XOR 29
34#define TEXT 30
35#define DATA 31
36#define BSS 32
37#define EVEN 33
38#define MOVF 34
39#define MOVOF 35
40#define MOVFO 36
41#define ADDF 37
42#define SUBF 38
43#define DIVF 39
44#define MULF 40
45#define CLRF 41
46#define CMPF 42
47#define NEGF 43
48#define TSTF 44
49#define CFCC 45
50#define SOB 46
51#define JSR 47
52#define END 48
53
54#define JEQ 0
55#define JNE 1
56#define JLE 2
57#define JGE 3
58#define JLT 4
59#define JGT 5
60#define JLO 6
61#define JHI 7
62#define JLOS 8
63#define JHIS 9
64
65#define BYTE 100
66#define LSIZE 512
67
68struct node {
69 char op;
70 char subop;
71 struct node *forw;
72 struct node *back;
73 struct node *ref;
74 int labno;
75 char *code;
76 int refc;
77};
78
79struct optab {
80 char *opstring;
81 int opcode;
82} optab[];
83
84char line[LSIZE];
85struct node first;
86char *curlp;
87int nbrbr;
88int nsaddr;
89int redunm;
90int iaftbr;
91int njp1;
92int nrlab;
93int nxjump;
94int ncmot;
95int nrevbr;
96int loopiv;
97int nredunj;
98int nskip;
99int ncomj;
100int nsob;
101int nrtst;
102int nlit;
103
104int nchange;
105int isn;
106int debug;
107int lastseg;
108char *lasta;
109char *lastr;
110char *firstr;
111char revbr[];
112char regs[12][20];
113char conloc[20];
114char conval[20];
115char ccloc[20];
116
117#define RT1 10
118#define RT2 11
119#define FREG 5
120#define NREG 5
121#define LABHS 127
122#define OPHS 57
123
124struct optab *ophash[OPHS];
125struct node *nonlab();
126char *copy();
127char *sbrk();
128char *findcon();
129struct node *insertl();
130struct node *codemove();
131char *sbrk();
132char *alloc();