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

Subversion Repositories thor

[/] [thor/] [trunk/] [FT64v5/] [software/] [AS64/] [source/] [token.h] - Blame information for rev 54

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 48 robfinch
// ============================================================================
2
//        __
3
//   \\__/ o\    (C) 2018  Robert Finch, Stratford
4
//    \  __ /    All rights reserved.
5
//     \/_//     robfinch<remove>@finitron.ca
6
//       ||
7
//
8
// AS64 - Assembler
9
//  - 64 bit CPU
10
//
11
// This source file is free software: you can redistribute it and/or modify 
12
// it under the terms of the GNU Lesser General Public License as published 
13
// by the Free Software Foundation, either version 3 of the License, or     
14
// (at your option) any later version.                                      
15
//                                                                          
16
// This source file is distributed in the hope that it will be useful,      
17
// but WITHOUT ANY WARRANTY; without even the implied warranty of           
18
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            
19
// GNU General Public License for more details.                             
20
//                                                                          
21
// You should have received a copy of the GNU General Public License        
22
// along with this program.  If not, see <http://www.gnu.org/licenses/>.    
23
//                                                                          
24
// ============================================================================
25
//
26
#ifndef TOKEN_H
27
#define TOKEN_H
28
 
29
enum {
30
     tk_eof = -1,
31
     tk_none = 0,
32
     tk_comma = ',',
33
     tk_hash = '#',
34
     tk_plus = '+',
35
     tk_eol = '\n',
36
     tk_add = 128,
37
     tk_addi,
38
     tk_addu, // 130
39
     tk_2addu,
40
     tk_4addu,
41
     tk_8addu,
42
         tk_10addu,
43
     tk_16addu,
44
     tk_2addui,
45
     tk_4addui,
46
     tk_8addui,
47
     tk_16addui,
48
         tk_abs,
49
     tk_addui,
50
     tk_align, //140
51
     tk_and,
52
     tk_andi,
53
     tk_asl,
54
     tk_asli,
55
     tk_asr,
56
     tk_asri,
57
     tk_begin_expand,
58
         tk_bbc,
59
         tk_bbs,
60
     tk_beq,
61
         tk_beqi,
62
     tk_bge,
63
         tk_bgei,
64
     tk_bgeu,
65
         tk_bgeui,
66
     tk_bfchg, // 150
67
     tk_bfclr,
68
     tk_bfext,
69
     tk_bfextu,
70
     tk_bfins,
71
     tk_bfinsi,
72
     tk_bfset,
73
     tk_bgt,
74
         tk_bgti,
75
     tk_bgtu,
76
         tk_bgtui,
77
     tk_bit,
78
     tk_biti, // 160
79
     tk_bits,
80
     tk_ble,
81
         tk_blei,
82
     tk_bleu,
83
         tk_bleui,
84
     tk_blt,
85
         tk_blti,
86
     tk_bltu,
87
         tk_bltui,
88
     tk_bmi,
89
     tk_bne,
90
         tk_bnei,
91
     tk_bpl,
92
     tk_br,
93
     tk_bra, // 170
94
     tk_brk,
95
     tk_brnz,
96
     tk_brz,
97
     tk_bsr,
98
     tk_bss,
99
     tk_bvc,
100
     tk_bvs,
101
     tk_byte,
102
         tk_cache,
103
         tk_call,
104
         tk_calltgt,
105
     tk_cas,
106
     tk_chk, // 180
107
     tk_chki,
108
     tk_cli,
109
         tk_cmovenz,
110
         tk_cmovez,
111
     tk_cmp,
112
     tk_cmpi,
113
     tk_cmpu,
114
         tk_cmpui,
115
     tk_code,
116
     tk_com,
117
     tk_cpuid,
118
     tk_cs,
119
         tk_csev,
120
         tk_csp,
121
         tk_csod,
122
         tk_csn,
123
         tk_csnp,
124
         tk_csnn,
125
         tk_csnz,
126
         tk_csz,
127
         tk_csrrc,
128
         tk_csrrd,
129
         tk_csrrs,
130
     tk_csrrw, // 190
131
     tk_data,
132
     tk_db,
133
     tk_dbnz,
134
     tk_dc,
135
     tk_dec,
136
     tk_dh,
137
     tk_dh_htbl,
138
     tk_div,
139
     tk_divi,
140
     tk_divu,
141
     tk_divui, // 200
142
         tk_dd,
143
         tk_do,
144
     tk_ds,
145
         tk_dt,
146
     tk_dw,
147
         tk_else,
148
     tk_end,
149
     tk_end_expand,
150
         tk_endif,
151
         tk_endm,
152
     tk_endpublic,
153
     tk_enor,
154
     tk_eor,
155
     tk_eori,
156
     tk_eq,
157
     tk_equ,
158
         tk_eret,
159
     tk_es, // 210
160
     tk_extern,
161
     tk_fabs,
162
     tk_fadd,
163
         tk_fbeq,
164
         tk_fbge,
165
         tk_fbgt,
166
         tk_fble,
167
         tk_fblt,
168
         tk_fbne,
169
         tk_fbor,
170
         tk_fbun,
171
     tk_fcmp,
172
     tk_fcx,
173
     tk_fdiv,
174
     tk_fdx,
175
     tk_fex,
176 54 robfinch
                 tk_file,
177 48 robfinch
     tk_fill,
178
     tk_fix2flt,//220
179
     tk_flt2fix,
180
     tk_fmov,
181
     tk_fmul,
182
     tk_fnabs,
183
     tk_fneg,
184
     tk_frm,
185
     tk_fs,
186
     tk_fstat,
187
     tk_fsub,
188
         tk_ftoi,
189
     tk_ftst, // 230
190
     tk_ftx,
191
     tk_ge,
192
     tk_gran,
193
     tk_gs,
194
     tk_gt,
195
         tk_hint,
196
     tk_hs,
197
         tk_ibne,
198
     tk_icon,
199
     tk_id,
200
     tk_inc,
201
         tk_if,
202
         tk_ifdef,
203
         tk_ifndef,
204
     tk_int, // 240
205
     tk_ios,
206
         tk_ipush,
207
         tk_ipop,
208
         tk_iret,
209
         tk_isnull,
210
         tk_isptr,
211
         tk_itof,
212
     tk_jal,
213
     tk_jci,
214
     tk_jhi,
215
     tk_jgr,
216
     tk_jmp,
217
     tk_jsf,
218
     tk_jsp,
219
     tk_jsr,
220
     tk_land, // 250
221
     tk_lb,
222
     tk_lbu,
223
     tk_lc,
224
     tk_lcu,
225
         tk_ld,
226
         tk_ldb,
227
         tk_ldbu,
228
         tk_ldd,
229
     tk_ldi,
230
     tk_ldis,
231
         tk_ldp,
232
         tk_ldpu,
233
         tk_ldt,
234
         tk_ldtu,
235
         tk_ldvdar,
236
         tk_ldw,
237
         tk_ldwu,
238
     tk_le,
239
     tk_lea,
240
         tk_leax,
241
         tk_lf,
242
     tk_lfd,
243
         tk_lfq,
244
     tk_lh,
245
     tk_lhu, // 260
246
         tk_link,
247
     tk_lla,
248
     tk_llax,
249
     tk_lmr,
250
     tk_loop,
251
     tk_lor,
252
     tk_lshift,
253
     tk_lsr,
254
     tk_lsri,
255
     tk_lt,  // 270
256
         tk_ltcb,
257
     tk_lui,
258
         tk_lv,
259
     tk_lvb,
260 50 robfinch
        tk_lvbu,
261 48 robfinch
     tk_lvc,
262 50 robfinch
        tk_lvcu,
263 48 robfinch
     tk_lvh,
264 50 robfinch
        tk_lvhu,
265 48 robfinch
     tk_lvw,
266
     tk_lvwar,
267
     tk_lw,
268
         tk_lwr,
269
     tk_lwar,
270
     tk_lws,
271
         tk_macro,
272
     tk_max,
273
         tk_mark1,
274
         tk_mark2,
275
         tk_mark3,
276
         tk_mark4,
277
     tk_memdb,
278
     tk_memsb,
279
     tk_message,
280
     tk_mffp, //280
281
     tk_mfspr,
282
     tk_mod,
283
     tk_modi,
284 50 robfinch
        tk_modsu,
285 48 robfinch
     tk_modu,
286
     tk_modui,
287
     tk_mov,
288
     tk_mtfp,
289
     tk_mtspr,
290
     tk_mul,
291 50 robfinch
        tk_mulh,
292 48 robfinch
     tk_muli, //290
293 50 robfinch
        tk_mulsu,
294
        tk_mulsuh,
295 48 robfinch
     tk_mulu,
296 50 robfinch
        tk_muluh,
297 48 robfinch
     tk_mului,
298
     tk_mv2fix,
299
     tk_mv2flt,
300
     tk_nand,
301
     tk_ne,
302
     tk_neg,
303
     tk_nop,
304
     tk_nor,
305
     tk_not, //300
306
     tk_or,
307
     tk_ori,
308
     tk_org,
309
     tk_pand,
310
     tk_pandc,
311
     tk_pea,
312
     tk_penor,
313
     tk_peor,
314
     tk_php, //310
315
     tk_plp,
316
     tk_pnand,
317
     tk_pnor,
318
     tk_pop,
319
     tk_por,
320
     tk_porc,
321
     tk_pred,
322
     tk_public,
323
     tk_push,
324
     tk_rconst,//320
325
         tk_redor,
326
         tk_ret,
327
         tk_rex,
328
     tk_rodata,
329
     tk_rol,
330
     tk_roli,
331
     tk_ror,
332
     tk_rori,
333
     tk_rshift,
334
     tk_rtd,
335
     tk_rte,
336
     tk_rtf,
337
     tk_rti,
338
     tk_rtl,
339
     tk_rts,
340
     tk_sb,
341
     tk_sc,
342
     tk_sei,
343
     tk_seq,
344
     tk_seqi,
345
         tk_sf,
346
     tk_sfd,
347
         tk_sfq,
348
     tk_sgt,
349
     tk_sgti,
350
     tk_sgtu,
351
     tk_sgtui,
352
     tk_sge,
353
     tk_sgei,
354
     tk_sgeu,
355
     tk_sgeui,
356
     tk_sh,
357
     tk_shl,
358
     tk_shli,
359
     tk_shr,
360
     tk_shri,
361
     tk_shru,
362
     tk_shrui,
363
     tk_slli,
364
     tk_slt,
365
     tk_slti,
366
     tk_sltu,
367
     tk_sltui,
368
     tk_sle,
369
     tk_slei,
370
     tk_sleu,
371
     tk_sleui,
372
     tk_smr,
373
     tk_sne,
374
     tk_snei,
375
     tk_sptr,
376
     tk_srai,
377
     tk_srli,
378
     tk_ss,
379
         tk_stb,
380
         tk_std,
381
         tk_stdcr,
382
         tk_stp,
383
         tk_stt,
384
         tk_stw,
385
         tk_stcb,
386
     tk_stcmp,
387
     tk_stmov,
388
     tk_stop,
389 54 robfinch
                         tk_strconst,
390 48 robfinch
     tk_stset,
391
     tk_stsb,
392
     tk_stsc,
393
     tk_stsh,
394
     tk_stsw,
395
     tk_sub,
396
     tk_subi,
397
     tk_subu,
398
     tk_subui,
399
         tk_sv,
400
     tk_sw,
401
     tk_swc,
402
     tk_swcr,
403
     tk_swap,
404
         tk_swp,
405
     tk_sws,
406
     tk_sxb,
407
     tk_sxc,
408
     tk_sxh,
409
     tk_sync,
410
     tk_sys,
411
         tk_tgt,
412
     tk_tlbdis,
413
     tk_tlben,
414
     tk_tlbpb,
415
     tk_tlbrd,
416
     tk_tlbrdreg,
417
     tk_tlbwi,
418
     tk_tlbwr,
419
     tk_tlbwrreg,
420
     tk_tls,
421
     tk_to,
422
     tk_tst,
423
         tk_unlink,
424
         tk_vadd,
425
         tk_vadds,
426
         tk_vand,
427
         tk_vands,
428
         tk_vdiv,
429
         tk_vdivs,
430
         tk_vmov,
431
         tk_vmul,
432
         tk_vmuls,
433
         tk_vor,
434
         tk_vors,
435
         tk_vseq,
436
         tk_vsge,
437
         tk_vslt,
438
         tk_vsne,
439
         tk_vsub,
440
         tk_vsubs,
441
         tk_vxor,
442
         tk_vxors,
443
     tk_wai,
444
     tk_xnor,
445
     tk_xor,
446
     tk_xori,
447
     tk_zs,
448
         tk_zsev,
449
         tk_zsp,
450
         tk_zsod,
451
         tk_zsn,
452
         tk_zsnp,
453
         tk_zsnn,
454
         tk_zsnz,
455
         tk_zsz,
456
     tk_zxb,
457
     tk_zxc,
458
     tk_zxh
459
};
460
 
461
extern int token;
462
extern int isIdentChar(char ch);
463
extern void ScanToEOL();
464
extern int NextToken();
465
extern void SkipSpaces();
466
extern void prevToken();
467
extern int need(int);
468
extern int expect(int);
469
extern int getRegister();
470
extern int getSprRegister();
471
extern int getFPRegister();
472
extern int getFPRoundMode();
473
 
474
#endif

powered by: WebSVN 2.1.0

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