Subversion Repositories tendra.SVN

Rev

Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 7u83 1
/*
2
    		 Crown Copyright (c) 1997
3
 
4
    This TenDRA(r) Computer Program is subject to Copyright
5
    owned by the United Kingdom Secretary of State for Defence
6
    acting through the Defence Evaluation and Research Agency
7
    (DERA).  It is made available to Recipients with a
8
    royalty-free licence for its use, reproduction, transfer
9
    to other parties and amendment for any purpose not excluding
10
    product development provided that any such use et cetera
11
    shall be deemed to be acceptance of the following conditions:-
12
 
13
        (1) Its Recipients shall ensure that this Notice is
14
        reproduced upon any copies or amended versions of it;
15
 
16
        (2) Any amended version of it shall be clearly marked to
17
        show both the nature of and the organisation responsible
18
        for the relevant amendment or amendments;
19
 
20
        (3) Its onward transfer from a recipient to another
21
        party shall be deemed to be that party's acceptance of
22
        these conditions;
23
 
24
        (4) DERA gives no warranty or assurance as to its
25
        quality or suitability for any purpose and DERA accepts
26
        no liability whatsoever in relation to any use to which
27
        it may be put.
28
*/
29
 
30
 
31
#ifndef IBINASM
32
#define IBINASM
33
 
34
 
35
typedef enum {
36
	ilabel,     isym,       iglobal,    icpload,    ialign,
37
	iascii,     iasciiz,    ibyte,      icomm,      ilcomm,
38
	idata,      idouble,    ifile,      ifloat,     ihalf,
39
	icprestore, igpword,    icpadd,     iweakext,   iloopno,
40
	ispace,     itext,      iword,      iocode,     iend,
41
	isdata,     irdata,     ient,       iloc,       ibgnb,
42
	iendb,      iasm0,      iset,       icpalias,   irep,
43
	iendrep,    ilab,       ivreg,      imask,      ifmask,
44
	ierr,       iglobabs,   iverstamp,  iframe,     iextended,
45
	iextern,    iaent,      ioption,    inoalias,   ialias,
46
	imtag,      imalias,    istruct,    ilivereg, 	igjaldef,
47
	igjallive,  igjrlive, 	ishift_addr, irestext,  idword,
48
	iprologue,  iedata
49
    } itype;
50
 
51
#define n_itype 	62
52
 
53
#define formrob	 0
54
#define formra	 1
55
#define formri	 2
56
#define formrrr	 3
57
#define formrri	 4
58
#define formrr	 5
59
#define forma	 6
60
#define formr	 7
61
#define formrrl	 8
62
#define formrl	 9
63
#define forml	10
64
#define forrr	11
65
#define formril	12
66
#define formi	13
67
 
68
#define set_undefined	 0
69
#define set_reorder	 1
70
#define set_noreorder	 2
71
#define set_macro	 3
72
#define set_nomacro	 4
73
#define set_at		 5
74
#define set_noat	 6
75
#define set_move	 7
76
#define set_nomove	 8
77
#define set_bopt	 9
78
#define set_nobopt	10
79
#define set_volatile	11
80
#define set_novolatile	12
81
 
82
#define zero 0
83
#define float_register 32
84
#define xnoreg 72
85
 
86
 
87
 
88
#define n_format 16
89
 
90
 
91
typedef enum {
92
	franone 			/* default value 		*/
93
	,frahi				/* reg, [reg], sym[+/-offset]	*/
94
	,fralo				/* reg, [reg], sym[+/-offset]	*/
95
	,frrel1				/* reg, .[+offset]		*/
96
	,frrel2				/* reg, .[-offset]		*/
97
	,frgprel			/* reg, sym[+/-offset] + reg    */
98
        ,frcprel                        /* reg, sym[reg]                */
99
    } format_extn;
100
 
101
#define  n_format_extn  7
102
 
103
 
104
typedef enum {
105
	o_undefined,
106
	o_optimize,
107
	o_pic
108
    } opt_type;
109
 
110
#define n_opt_type	 3
111
 
112
 
113
typedef enum {
114
	opt_none,
115
	opt_int,
116
	opt_float,
117
	opt_string
118
    } opt_arg_type;
119
 
120
 
121
typedef unsigned asmopcode;
122
typedef unsigned asmformat;
123
typedef unsigned asmreg;
124
typedef int asmint;
125
typedef unsigned asmuint;
126
typedef int asmlabel;
127
typedef int asmsym;
128
typedef unsigned asmformatextn;
129
 
130
#define zero 0
131
#define float_register 32
132
 
133
 
134
#define binasm_record_length 16
135
 
136
#ifndef _REG_SET_C
137
#define _REG_SET_C 1
138
typedef unsigned aligned_regset[2];
139
#endif /* _REG_SET_C */
140
 
141
typedef union {
142
  char data[binasm_record_length];
143
  struct {
144
    asmsym symno;
145
    unsigned fill07 : 7;
146
    asmformatextn formextn : 3;
147
    unsigned asmtype : 6;
148
  } common;
149
  struct {
150
    asmsym symno;
151
    unsigned fill07 : 7;
152
    asmformatextn formextn : 3;
153
    unsigned asmtype : 6;
154
    unsigned lexlev;
155
  } ent;
156
  struct {
157
    asmsym symno;
158
    unsigned fill07 : 7;
159
    asmformatextn formextn : 3;
160
    unsigned asmtype : 6;
161
    asmint frameoffset;
162
    asmreg framereg : 7;
163
    asmreg pcreg : 7;
164
  } frame;
165
  struct {
166
    asmsym symno;
167
    unsigned fill07 : 7;
168
    asmformatextn formextn : 3;
169
    unsigned asmtype : 6;
170
    unsigned regmask;
171
    asmint regoffset;
172
  } mask;
173
  struct {
174
    asmsym symno;
175
    unsigned fill07 : 7;
176
    asmformatextn formextn : 3;
177
    unsigned asmtype : 6;
178
    aligned_regset gjmask;
179
  } gmask;
180
  struct {
181
    asmsym symno;		/* handler */
182
    unsigned fill07 : 7;
183
    asmformatextn formextn : 3;
184
    unsigned asmtype : 6;
185
    int      flag;
186
    int      data;
187
  } edata;
188
  struct {
189
    asmsym symno;
190
    unsigned fill07 : 7;
191
    asmformatextn formextn : 3;
192
    unsigned asmtype : 6;
193
    int loopnum;
194
    unsigned lflag;
195
  } loopno;
196
  struct {
197
    asmsym symno;
198
    unsigned fill07 : 7;
199
    asmformatextn formextn : 3;
200
    unsigned asmtype : 6;
201
    int majornumber;
202
    int minornumber;
203
  } verstamp;
204
  struct {
205
    asmsym symno;
206
    unsigned fill07 : 7;
207
    asmformatextn formextn : 3;
208
    unsigned asmtype : 6;
209
    unsigned filenumber;
210
    unsigned linenumber;
211
  } loc;
212
  struct {
213
    asmsym symno;
214
    unsigned fill07 : 7;
215
    asmformatextn formextn : 3;
216
    unsigned asmtype : 6;
217
    unsigned gpmask;
218
    unsigned fpmask;
219
  } livereg;
220
  struct {
221
    asmsym symno;
222
    unsigned fill07 : 7;
223
    asmformatextn formextn : 3;
224
    unsigned asmtype : 6;
225
    unsigned length;
226
    unsigned repeat;
227
  } chars;
228
  struct {
229
    asmsym symno;
230
    unsigned fill07 : 7;
231
    asmformatextn formextn : 3;
232
    unsigned asmtype : 6;
233
    asmint expression;
234
    unsigned repeat;
235
  } value;
236
  struct {
237
    asmsym symno;
238
    unsigned fill07 : 7;
239
    asmformatextn formextn : 3;
240
    unsigned asmtype : 6;
241
    unsigned option : 2;
242
    unsigned fill04 : 30;
243
    asmint opt_int_value;
244
  } voption;
245
  struct {
246
    asmsym symno;
247
    unsigned fill07 : 7;
248
    asmformatextn formextn : 3;
249
    unsigned asmtype : 6;
250
    unsigned option : 2;
251
    unsigned fill04 : 30;
252
    asmint opt_len;
253
  } loption;
254
  struct {
255
    asmsym symno;
256
    unsigned fill07 : 7;
257
    asmformatextn formextn : 3;
258
    unsigned asmtype : 6;
259
    asmreg basereg1 : 7;
260
    asmreg basereg2 : 7;
261
  } alias;
262
  struct {
263
    asmsym symno;
264
    unsigned fill07 : 7;
265
    asmformatextn formextn : 3;
266
    unsigned asmtype : 6;
267
    int tagnumber;
268
    int tagtype;
269
  } mtag;
270
  struct {
271
    asmsym symno;
272
    unsigned fill07 : 7;
273
    asmformatextn formextn : 3;
274
    unsigned asmtype : 6;
275
    int memtag1;
276
    int memtag2;
277
  } malias;
278
 
279
  struct {
280
    asmsym symno;
281
    unsigned fill07 : 7;
282
    asmformatextn formextn : 3;
283
    unsigned asmtype : 6;
284
    unsigned fill03 : 6;
285
    asmopcode op : 9;		/* 9 bits plus alignment in pascal */
286
    asmreg reg1 : 7;
287
    asmreg reg2 : 7;
288
    asmformat form : 4;
289
    asmreg reg3 : 7;
290
  } rinst;
291
  struct {
292
    asmsym symno;
293
    unsigned fill07 : 7;
294
    asmformatextn formextn : 3;
295
    unsigned asmtype : 6;
296
    unsigned fill03 : 6;
297
    asmopcode op : 9;		/* 9 bits plus alignment in pascal */
298
    asmreg reg1 : 7;
299
    asmreg reg2 : 7;
300
    asmformat form : 4;
301
    unsigned mem_tag : 14;
302
    asmint immediate;
303
  } iinst;
304
  struct {
305
    asmsym symno;
306
    unsigned fill07 : 7;
307
    asmformatextn formextn : 3;
308
    unsigned asmtype : 6;
309
    unsigned fill03 : 6;
310
    asmopcode op : 9;		/* 9 bits plus alignment in pascal */
311
    asmreg reg1 : 7;
312
    asmreg reg2 : 7;
313
    asmformat form : 4;
314
    unsigned symoffset : 4;
315
    unsigned fill05 : 10;
316
    asmint immediate;
317
  } dinst;
318
  struct {
319
    asmsym symno;
320
    unsigned fill07 : 7;
321
    asmformatextn formextn : 3;
322
    unsigned asmtype : 6;
323
    unsigned fill03 : 6;
324
    asmopcode op : 9;		/* 9 bits plus alignment in pascal */
325
    asmreg reg1 : 7;
326
    asmreg reg2 : 7;
327
    asmformat form : 4;
328
    asmint imm;
329
  } linst;
330
  struct {
331
    asmsym symno;
332
    unsigned fill07 : 7;
333
    asmformatextn formextn : 3;
334
    unsigned asmtype : 6;
335
    unsigned fill03 : 6;
336
    asmopcode op : 9; 
337
    asmreg reg1 : 7;
338
    asmreg reg2 : 7;
339
    asmformat form : 4;
340
    asmreg reg3 : 7;
341
    asmreg reg4 : 7;
342
  } rrinst;
343
} binasm;
344
 
345
 
346
#endif