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 |
/**********************************************************************
|
|
|
32 |
$Author: release $
|
|
|
33 |
$Date: 1998/01/17 15:56:05 $
|
|
|
34 |
$Revision: 1.1.1.1 $
|
|
|
35 |
$Log: addrtypes.h,v $
|
|
|
36 |
* Revision 1.1.1.1 1998/01/17 15:56:05 release
|
|
|
37 |
* First version to be checked into rolling release.
|
|
|
38 |
*
|
|
|
39 |
* Revision 1.1 1995/08/16 15:38:39 currie
|
|
|
40 |
* Initial revision
|
|
|
41 |
*
|
|
|
42 |
* Revision 1.1 1995/04/13 09:08:06 currie
|
|
|
43 |
* Initial revision
|
|
|
44 |
*
|
|
|
45 |
* Revision 1.1 1995/04/13 09:08:06 currie
|
|
|
46 |
* Initial revision
|
|
|
47 |
*
|
|
|
48 |
***********************************************************************/
|
|
|
49 |
/*****************************************************************
|
|
|
50 |
|
|
|
51 |
addressingtypes.h
|
|
|
52 |
|
|
|
53 |
Types for usable addressing modes are defined here :-
|
|
|
54 |
baseoff, instore, freg, ans, where
|
|
|
55 |
|
|
|
56 |
*****************************************************************/
|
|
|
57 |
|
|
|
58 |
|
|
|
59 |
|
|
|
60 |
#ifndef addressingtkey
|
|
|
61 |
#define addressingtkey 1
|
|
|
62 |
|
|
|
63 |
#include "common_types.h"
|
|
|
64 |
|
|
|
65 |
|
|
|
66 |
struct makeansst {
|
|
|
67 |
int lab;
|
|
|
68 |
int regmove;
|
|
|
69 |
};
|
|
|
70 |
typedef struct makeansst makeans;
|
|
|
71 |
|
|
|
72 |
#define NOREG 100
|
|
|
73 |
|
|
|
74 |
struct baseofft {
|
|
|
75 |
int base; /* base register for addressing */
|
|
|
76 |
long offset; /* offset in words */
|
|
|
77 |
};
|
|
|
78 |
typedef struct baseofft baseoff;
|
|
|
79 |
|
|
|
80 |
struct instoret {
|
|
|
81 |
baseoff b;
|
|
|
82 |
bool adval; /* if true then b is itself an address
|
|
|
83 |
value i.e not a pointer to a value */
|
|
|
84 |
};
|
|
|
85 |
typedef struct instoret instore;
|
|
|
86 |
|
|
|
87 |
struct fregt {
|
|
|
88 |
int fr; /* floating point reg (actually fr*2) */
|
|
|
89 |
bool dble; /* double precision */
|
|
|
90 |
};
|
|
|
91 |
typedef struct fregt freg;
|
|
|
92 |
|
|
|
93 |
struct somefregt {
|
|
|
94 |
int *fr;
|
|
|
95 |
bool dble;
|
|
|
96 |
};
|
|
|
97 |
typedef struct somefregt somefreg;
|
|
|
98 |
|
|
|
99 |
struct someregt {
|
|
|
100 |
int *r;
|
|
|
101 |
}; /* extra struct is to get over bug in MIPS
|
|
|
102 |
cc */
|
|
|
103 |
typedef struct someregt somereg;
|
|
|
104 |
|
|
|
105 |
|
|
|
106 |
union anstu {
|
|
|
107 |
int regans; /* register number */
|
|
|
108 |
freg fregans;
|
|
|
109 |
instore instoreans;
|
|
|
110 |
somefreg somefregans;
|
|
|
111 |
somereg someregans;
|
|
|
112 |
};
|
|
|
113 |
|
|
|
114 |
enum ansdiscrim {
|
|
|
115 |
inreg, infreg, notinreg, insomereg, insomefreg
|
|
|
116 |
};
|
|
|
117 |
/* use to discriminate the above union type */
|
|
|
118 |
|
|
|
119 |
struct anst {
|
|
|
120 |
enum ansdiscrim discrim;
|
|
|
121 |
union anstu val;
|
|
|
122 |
};
|
|
|
123 |
typedef struct anst ans; /* this type used as union of a fixpnt
|
|
|
124 |
reg,
|
|
|
125 |
a float reg and an instore value */
|
|
|
126 |
|
|
|
127 |
struct wheret {
|
|
|
128 |
ans answhere; /* reg or store position */
|
|
|
129 |
ash ashwhere; /* size and alignment, see ashtypes.h */
|
|
|
130 |
};
|
|
|
131 |
|
|
|
132 |
typedef struct wheret where;
|
|
|
133 |
|
|
|
134 |
struct mmt {
|
|
|
135 |
long maxi;
|
|
|
136 |
long mini;
|
|
|
137 |
char *fmt;
|
|
|
138 |
};
|
|
|
139 |
typedef struct mmt mm;
|
|
|
140 |
|
|
|
141 |
/******************************************************************
|
|
|
142 |
macros for ease of use of unions, allow 'hiding' of discriminator.
|
|
|
143 |
******************************************************************/
|
|
|
144 |
|
|
|
145 |
#define regalt(x) (x).val.regans
|
|
|
146 |
#define fregalt(x) (x).val.fregans
|
|
|
147 |
#define insalt(x) (x).val.instoreans
|
|
|
148 |
#define someregalt(x) (x).val.someregans.r;
|
|
|
149 |
#define somefregalt(x) (x).val.somefregans;
|
|
|
150 |
|
|
|
151 |
/* assign to field of union, discriminator set as appropriate */
|
|
|
152 |
#define setregalt(x,y) (x).discrim = inreg; (x).val.regans = y
|
|
|
153 |
#define setfregalt(x,y) (x).discrim = infreg; (x).val.fregans = y
|
|
|
154 |
#define setinsalt(x,y) (x).discrim = notinreg; (x).val.instoreans =y
|
|
|
155 |
#define setsomeregalt(x,y) (x).discrim = insomereg; (x).val.someregans.r =y
|
|
|
156 |
#define setsomefregalt(x,y) (x).discrim = insomefreg; (x).val.somefregans=y
|
|
|
157 |
|
|
|
158 |
#endif
|