|
|
1.1 root 1: /*static char sccsid[] = "@(#)c2.h 4.4 3/2/81";*/
2: /* @(#)c2.h 1.19 80/08/26 13:39:07 */
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 BYTE 1
88: #define WORD 2
89: #define LONG 3
90: #define FLOAT 4
91: #define DOUBLE 5
92: #define QUAD 6
93: #define OP2 7
94: #define OP3 8
95: #define OPB 9
96: #define OPX 10
97:
98: #define T(a,b) (a|((b)<<8))
99: #define U(a,b) (a|((b)<<4))
100:
101: #define C2_ASIZE 128
102:
103: struct optab {
104: char opstring[7];
105: short opcode;
106: } optab[];
107:
108: struct node {
109: char op;
110: char subop;
111: short refc;
112: struct node *forw;
113: struct node *back;
114: struct node *ref;
115: char *code;
116: struct optab *pop;
117: long labno;
118: short seq;
119: };
120:
121: struct {
122: short combop;
123: };
124:
125: char line[512];
126: struct node first;
127: char *curlp;
128: int nbrbr;
129: int nsaddr;
130: int redunm;
131: int iaftbr;
132: int njp1;
133: int nrlab;
134: int nxjump;
135: int ncmot;
136: int nrevbr;
137: int loopiv;
138: int nredunj;
139: int nskip;
140: int ncomj;
141: int nsob;
142: int nrtst;
143: int nbj;
144: int nfield;
145:
146: int nchange;
147: int isn;
148: int debug;
149: char *lasta;
150: char *lastr;
151: char *firstr;
152: char revbr[];
153: #define NREG 12
154: char *regs[NREG+5]; /* 0-11, 4 for operands, 1 for running off end */
155: char conloc[C2_ASIZE];
156: char conval[C2_ASIZE];
157: char ccloc[C2_ASIZE];
158:
159: #define RT1 12
160: #define RT2 13
161: #define RT3 14
162: #define RT4 15
163: #define LABHS 127
164:
165: struct { char lbyte; };
166:
167: char *copy();
168: long getnum();
169: struct node *codemove();
170: struct node *insertl();
171: struct node *nonlab();
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.