|
|
1.1 root 1: /*
2: * Header for object code improver
3: */
4:
5: /* tokens */
6: #define JBR 1
7: #define CBR 2
8: #define JMP 3
9: #define LABEL 4
10: #define DLABEL 5
11: #define EROU 6
12: #define JSW 7
13: #define MOV 8
14: #define CLR 9
15: #define INC 10
16: #define DEC 11
17: #define TST 12
18: #define PUSH 13
19: #define CVT 14
20: #define MOVZ 15
21: #define CMP 16
22: #define ADD 17
23: #define SUB 18
24: #define BIT 19
25: #define AND 20
26: #define OR 21
27: #define XOR 22
28: #define COM 23
29: #define NEG 24
30: #define EMUL 25
31: #define MUL 26
32: #define DIV 27
33: #define EDIV 28
34: #define SHAL 29
35: #define SHAR 30
36: #define SHL 31
37: #define SHR 32
38: #define CALLF 33
39: #define CALLS 34
40: #define CASE 35
41: #define ADDA 36
42: #define SUBA 37
43: #define AOBLEQ 38
44: #define AOBLSS 39
45: #define MOVA 40
46: #define PUSHA 41
47: #define LDF 42
48: #define LNF 43
49: #define STF 44
50: #define CMPF 45
51: #define CMPF2 46
52: #define TSTF 47
53: #define PUSHD 48
54: #define CVLF 49
55: #define CVFL 50
56: #define LDFD 51
57: #define CVDF 52
58: #define NEGF 53
59: #define ADDF 54
60: #define SUBF 55
61: #define MULF 56
62: #define DIVF 57
63: #define SINF 58
64: #define COSF 59
65: #define ATANF 60
66: #define LOGF 61
67: #define SQRTF 62
68: #define EXPF 63
69: #define MOVBLK 64
70: #define MFPR 65
71: #define MTPR 66
72: #define PROBE 67
73: #define MOVO 68
74: #define TEXT 69
75: #define DATA 70
76: #define BSS 71
77: #define ALIGN 72
78: #define END 73
79: #define LGEN 74
80: #define WGEN 75
81: #define SET 76
82: #define LCOMM 77
83: #define COMM 78
84:
85: #define JEQ 0
86: #define JNE 1
87: #define JLE 2
88: #define JGE 3
89: #define JLT 4
90: #define JGT 5
91: /* rearranged for unsigned branches so that jxxu = jxx + 6 */
92: #define JLOS 8
93: #define JHIS 9
94: #define JLO 10
95: #define JHI 11
96:
97: #define JBC 12
98: #define JBS 13
99: #define RET 14
100:
101: #define BYTE 1
102: #define WORD 2
103: #define LONG 3
104: #define QUAD 4
105: #define FLOAT 5
106: #define DOUBLE 6
107: #define OP2 7
108: #define OP3 8
109: #define OPB 9
110: #define OPX 10
111:
112: /* #define T(a,b) (a|((b)<<8)) NUXI problems */
113: #define U(a,b) (a|((b)<<4))
114:
115: #define C2_ASIZE 128
116:
117: struct optab {
118: char opstring[7];
119: char opcod;
120: unsigned char subopcod;
121: } optab[];
122:
123: struct node {
124: char op;
125: unsigned char subop;
126: short refc;
127: struct node *forw;
128: struct node *back;
129: struct node *ref;
130: char *code;
131: struct optab *pop;
132: long labno;
133: short seq;
134: };
135:
1.1.1.2 ! root 136: struct intleavetab {
! 137: char op;
! 138: unsigned char subop;
! 139: int intleavect;
! 140: } intltab[];
! 141:
1.1 root 142: /* struct { NUXI problems
143: short combop;
144: }; */
145:
146: char line[512];
147: struct node first;
148: char *curlp;
149: int nbrbr;
150: int nsaddr;
151: int redunm;
152: int iaftbr;
153: int njp1;
154: int nrlab;
155: int nxjump;
156: int ncmot;
157: int nrevbr;
158: int loopiv;
159: int nredunj;
160: int nskip;
161: int ncomj;
162: int naob;
163: int nrtst;
164: int nbj;
165: int nst;
166: int nld;
167:
168: int nchange;
169: int isn;
170: int debug;
171: int fortflg;
1.1.1.2 ! root 172: int aobflag;
1.1 root 173: char *lasta;
174: char *lastr;
175: char *firstr;
176: char revbr[];
177: #define NREG 13
178: /* 0-12, f.p. accumulator, 4 for operands, 1 for running off end */
179: char *regs[NREG+6];
180: char conloc[C2_ASIZE];
181: char conval[C2_ASIZE];
182: char ccloc[C2_ASIZE];
183:
184: #define ACC NREG
185: #define RT1 NREG+1
186: #define RT2 NREG+2
187: #define RT3 NREG+3
188: #define RT4 NREG+4
189: #define LABHS 127
190:
1.1.1.2 ! root 191: #define MAXAOBDISP 5000
! 192:
1.1 root 193: #define NUSE 6
1.1.1.2 ! root 194: struct node *uses[NUSE + 7]; /* for backwards flow analysis */
1.1 root 195: struct node *useacc; /* same for acc */
196: char *lastrand; /* last operand of instruction */
197: struct node *bflow();
198: char *copy();
199: long getnum();
200: struct node *codemove();
201: struct node *insertl();
202: struct node *nonlab();
203: struct node *alloc();
204: char *findcon();
205: char *byondrd();
206: #define equstr !strcmp
207: #define COPYCODE
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.