OpenCores
URL https://opencores.org/ocsvn/open8_urisc/open8_urisc/trunk

Subversion Repositories open8_urisc

[/] [open8_urisc/] [trunk/] [Open8 Tools/] [open8_src/] [open8_as/] [defines.h] - Blame information for rev 189

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 178 jshamlet
#ifndef _DEFINES_H
2
#define _DEFINES_H
3
 
4
/* want to use longer strings and labels? change this */
5
 
6
#define MAX_NAME_LENGTH 64
7
 
8
#ifndef M_PI
9
#define M_PI 3.14159265358979323846
10
#endif
11
 
12
#define FAILED    0
13
#define SUCCEEDED 1
14
 
15
#define OFF 0
16
#define ON  1
17
 
18
#define NO  0
19
#define YES 1
20
 
21
#define HINT_NONE  0
22
#define HINT_8BIT  1
23
#define HINT_16BIT 2
24
#define HINT_24BIT 3
25
 
26
#define STACK_CALCULATE_DELAY 2
27
#define STACK_RETURN_LABEL 1024
28
 
29
#define STACK_NONE    0
30
#define STACK_INSIDE  1
31
#define STACK_OUTSIDE 2
32
 
33
#define SECTION_STATUS_FREE      0
34
#define SECTION_STATUS_FORCE     1
35
#define SECTION_STATUS_OVERWRITE 2
36
#define SECTION_STATUS_HEADER    3
37
#define SECTION_STATUS_SEMIFREE  4
38
#define SECTION_STATUS_ABSOLUTE  5
39
#define SECTION_STATUS_RAM       6
40
#define SECTION_STATUS_SUPERFREE 7
41
 
42
#define INPUT_NUMBER_EOL           2
43
#define INPUT_NUMBER_ADDRESS_LABEL 3
44
#define INPUT_NUMBER_STRING        4
45
#define INPUT_NUMBER_STACK         5
46
#define INPUT_NUMBER_FLOAT         6
47
 
48
#define GET_NEXT_TOKEN_STRING         2
49
#define EVALUATE_TOKEN_NOT_IDENTIFIED 2
50
#define EVALUATE_TOKEN_EOP            6
51
 
52
#define OUTPUT_OBJECT  0
53
#define OUTPUT_LIBRARY 1
54
#define OUTPUT_NONE    2
55
 
56
#define REFERENCE_TYPE_DIRECT_16BIT   0
57
#define REFERENCE_TYPE_RELATIVE_8BIT  1
58
#define REFERENCE_TYPE_DIRECT_8BIT    2
59
#define REFERENCE_TYPE_DIRECT_24BIT   3
60
#define REFERENCE_TYPE_RELATIVE_16BIT 4
61
 
62
#define ERROR_NONE 0
63
#define ERROR_LOG  1
64
#define ERROR_DIR  2
65
#define ERROR_NUM  3
66
#define ERROR_INC  4
67
#define ERROR_INB  5
68
#define ERROR_UNF  6
69
#define ERROR_INP  7
70
#define ERROR_STC  8
71
#define ERROR_WRN  9
72
#define ERROR_ERR 10
73
 
74
/**************************************************************/
75
/* wla internal datatypes                                     */
76
/**************************************************************/
77
 
78
/* A - absolute section    */
79
/* c - stack (1 byte)      */
80
/* C - stack (2 bytes)     */
81
/* T - stack (3 bytes)     */
82
/* d - data (1 byte)       */
83
/* y - data (2 bytes)      */
84
/* z - data (3 bytes)      */
85
/* D - data block          */
86
/* O - origin              */
87
/* o - absolute origin     */
88
/* B - ROM bank            */
89
/* b - BASE (65816)        */
90
/* L - label               */
91
/* r - 16bit reference     */
92
/* R - 8bit pc ref         */
93
/* M - 16bit pc ref        */
94
/* Q - 8bit reference      */
95
/* q - 24bit reference     */
96
/* S - section             */
97
/* s - end of section      */
98
/* x - dsb                 */
99
/* X - dsw                 */
100
/* E - end of file         */
101
/* f - file name id        */
102
/* k - line number         */
103
/* P - add_old = add       */
104
/* p - add = add_old       */
105
/* g - block (start)       */
106
/* G - block (end)         */
107
/* Y - symbol              */
108
/* Z - breakpoint          */
109
 
110
/**************************************************************/
111
/* v8urisc                                                    */
112
/**************************************************************/
113
 
114
 
115
/* opcode types */
116
 
117
/* 0 - plain text  8b */
118
/* 1 - x              */
119
/* 2 - ?              */
120
/* 3 - plain text 16b */
121
/* 4 - x (absolute)   */
122
 
123
#define OP_SIZE_MAX 14
124
 
125
struct optcode {
126
  char *op;
127
  int  hex;
128
  int  type;
129
  int  skip_8bit;
130
};
131
 
132
#define DEFINITION_TYPE_VALUE  0
133
#define DEFINITION_TYPE_STRING 1
134
#define DEFINITION_TYPE_STACK  2
135
 
136
struct definition {
137
  char   alias[MAX_NAME_LENGTH];
138
  char   string[MAX_NAME_LENGTH];
139
  double value;
140
  int    type;
141
  int    size;
142
  struct definition *next;
143
};
144
 
145
struct macro_argument {
146
  int type;
147
  int value;
148
  int start;
149
  char string[MAX_NAME_LENGTH];
150
};
151
 
152
struct macro_static {
153
  char name[MAX_NAME_LENGTH];
154
  int  start;
155
  int  calls;
156
  int  filename_id;
157
  int  start_line;
158
  int  nargument_names;
159
  char **argument_names;
160
  struct macro_static *next;
161
};
162
 
163
struct macro_runtime {
164
  struct macro_static *macro;
165
  int macro_end;
166
  int macro_end_line;
167
  int macro_end_filename_id;
168
  int supplied_arguments;
169
  struct macro_argument **argument_data;
170
};
171
 
172
struct label_def {
173
  char label[MAX_NAME_LENGTH];
174
  unsigned char section_status;
175
  unsigned char alive;
176
  unsigned char type;
177
  unsigned char symbol;
178
  int  section_id;
179
  int  address; /* in bank */
180
  int  bank;
181
  int  slot;
182
  int  filename_id;
183
  int  linenumber;
184
  struct label_def *next;
185
};
186
 
187
struct section_def {
188
  char name[MAX_NAME_LENGTH];
189
  int  alignment;
190
  int  address; /* in bank */
191
  int  bank;
192
  int  slot;
193
  int  size;
194
  int  status; /* see SECTION_STATUS_* */
195
  int  alive;
196
  int  id;
197
  int  i;
198
  int  filename_id;
199
  int  advance_org;
200
  int  maxsize_status; /* ON/OFF */
201
  int  maxsize;
202
  int  listfile_items;
203
  int  *listfile_ints;
204
  char *listfile_cmds;
205
  unsigned char *data;
206
  struct section_def *next;
207
};
208
 
209
struct incbin_file_data {
210
  struct incbin_file_data *next;
211
  char *data;
212
  char *name;
213
  int  size;
214
};
215
 
216
struct export_def {
217
  char   name[MAX_NAME_LENGTH];
218
  struct export_def *next;
219
};
220
 
221
struct active_file_info {
222
  int    filename_id;
223
  int    line_current;
224
  struct active_file_info *next;
225
  struct active_file_info *prev;
226
};
227
 
228
struct file_name_info {
229
  char   *name;
230
  int    id;
231
  struct file_name_info *next;
232
};
233
 
234
struct slot {
235
  int address;
236
  int size;
237
  struct slot *next;
238
};
239
 
240
struct block {
241
  char name[MAX_NAME_LENGTH];
242
  int  address;
243
  struct block *next;
244
};
245
 
246
#define STACK_ITEM_TYPE_VALUE    0
247
#define STACK_ITEM_TYPE_OPERATOR 1
248
#define STACK_ITEM_TYPE_STRING   2
249
#define STACK_ITEM_TYPE_DELETED  3
250
#define STACK_ITEM_TYPE_STACK    4
251
 
252
#define SI_OP_PLUS         0
253
#define SI_OP_MINUS        1
254
#define SI_OP_MULTIPLY     2
255
#define SI_OP_LEFT         3
256
#define SI_OP_RIGHT        4
257
#define SI_OP_OR           5
258
#define SI_OP_AND          6
259
#define SI_OP_DIVIDE       7
260
#define SI_OP_POWER        8
261
#define SI_OP_SHIFT_LEFT   9
262
#define SI_OP_SHIFT_RIGHT 10
263
#define SI_OP_MODULO      11
264
#define SI_OP_XOR         12
265
#define SI_OP_LOW_BYTE    13
266
#define SI_OP_HIGH_BYTE   14
267
 
268
#define SI_SIGN_POSITIVE 0
269
#define SI_SIGN_NEGATIVE 1
270
 
271
#define STACKS_TYPE_8BIT    0
272
#define STACKS_TYPE_16BIT   1
273
#define STACKS_TYPE_24BIT   2
274
#define STACKS_TYPE_UNKNOWN 3
275
 
276
#define STACK_POSITION_DEFINITION 0
277
#define STACK_POSITION_CODE       1
278
 
279
struct stack_item {
280
  int type;
281
  int sign;
282
  double value;
283
  char string[MAX_NAME_LENGTH];
284
};
285
 
286
struct stack {
287
  struct stack_item *stack;
288
  struct stack *next;
289
  int id;
290
  int position;
291
  int filename_id;
292
  int stacksize;
293
  int linenumber;
294
  int type;
295
  int bank;
296
  int slot;
297
  int section_status;
298
  int section_id;
299
  int address;
300
};
301
 
302
struct structure_item {
303
  char name[MAX_NAME_LENGTH];
304
  int size;
305
  struct structure_item *next;
306
};
307
 
308
struct structure {
309
  char name[MAX_NAME_LENGTH];
310
  struct structure_item *items;
311
  int size;
312
  struct structure *next;
313
};
314
 
315
struct repeat_runtime {
316
  int start;
317
  int start_line;
318
  int counter;
319
};
320
 
321
struct filepointer {
322
  char name[MAX_NAME_LENGTH];
323
  char *filename;
324
  FILE *f;
325
  struct filepointer *next;
326
};
327
 
328
#define TYPE_STRING            0
329
#define TYPE_VALUE             1
330
#define TYPE_LABEL             2
331
#define TYPE_STACK_CALCULATION 3
332
 
333
#endif
334
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.