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

Subversion Repositories thor

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

Go to most recent revision | 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
     tk_fill,
177
     tk_fix2flt,//220
178
     tk_flt2fix,
179
     tk_fmov,
180
     tk_fmul,
181
     tk_fnabs,
182
     tk_fneg,
183
     tk_frm,
184
     tk_fs,
185
     tk_fstat,
186
     tk_fsub,
187
         tk_ftoi,
188
     tk_ftst, // 230
189
     tk_ftx,
190
     tk_ge,
191
     tk_gran,
192
     tk_gs,
193
     tk_gt,
194
         tk_hint,
195
     tk_hs,
196
         tk_ibne,
197
     tk_icon,
198
     tk_id,
199
     tk_inc,
200
         tk_if,
201
         tk_ifdef,
202
         tk_ifndef,
203
     tk_int, // 240
204
     tk_ios,
205
         tk_ipush,
206
         tk_ipop,
207
         tk_iret,
208
         tk_isnull,
209
         tk_isptr,
210
         tk_itof,
211
     tk_jal,
212
     tk_jci,
213
     tk_jhi,
214
     tk_jgr,
215
     tk_jmp,
216
     tk_jsf,
217
     tk_jsp,
218
     tk_jsr,
219
     tk_land, // 250
220
     tk_lb,
221
     tk_lbu,
222
     tk_lc,
223
     tk_lcu,
224
         tk_ld,
225
         tk_ldb,
226
         tk_ldbu,
227
         tk_ldd,
228
     tk_ldi,
229
     tk_ldis,
230
         tk_ldp,
231
         tk_ldpu,
232
         tk_ldt,
233
         tk_ldtu,
234
         tk_ldvdar,
235
         tk_ldw,
236
         tk_ldwu,
237
     tk_le,
238
     tk_lea,
239
         tk_leax,
240
         tk_lf,
241
     tk_lfd,
242
         tk_lfq,
243
     tk_lh,
244
     tk_lhu, // 260
245
         tk_link,
246
     tk_lla,
247
     tk_llax,
248
     tk_lmr,
249
     tk_loop,
250
     tk_lor,
251
     tk_lshift,
252
     tk_lsr,
253
     tk_lsri,
254
     tk_lt,  // 270
255
         tk_ltcb,
256
     tk_lui,
257
         tk_lv,
258
     tk_lvb,
259
     tk_lvc,
260
     tk_lvh,
261
     tk_lvw,
262
     tk_lvwar,
263
     tk_lw,
264
         tk_lwr,
265
     tk_lwar,
266
     tk_lws,
267
         tk_macro,
268
     tk_max,
269
         tk_mark1,
270
         tk_mark2,
271
         tk_mark3,
272
         tk_mark4,
273
     tk_memdb,
274
     tk_memsb,
275
     tk_message,
276
     tk_mffp, //280
277
     tk_mfspr,
278
     tk_mod,
279
     tk_modi,
280
     tk_modu,
281
     tk_modui,
282
     tk_mov,
283
     tk_mtfp,
284
     tk_mtspr,
285
     tk_mul,
286
     tk_muli, //290
287
     tk_mulu,
288
     tk_mului,
289
     tk_mv2fix,
290
     tk_mv2flt,
291
     tk_nand,
292
     tk_ne,
293
     tk_neg,
294
     tk_nop,
295
     tk_nor,
296
     tk_not, //300
297
     tk_or,
298
     tk_ori,
299
     tk_org,
300
     tk_pand,
301
     tk_pandc,
302
     tk_pea,
303
     tk_penor,
304
     tk_peor,
305
     tk_php, //310
306
     tk_plp,
307
     tk_pnand,
308
     tk_pnor,
309
     tk_pop,
310
     tk_por,
311
     tk_porc,
312
     tk_pred,
313
     tk_public,
314
     tk_push,
315
     tk_rconst,//320
316
         tk_redor,
317
         tk_ret,
318
         tk_rex,
319
     tk_rodata,
320
     tk_rol,
321
     tk_roli,
322
     tk_ror,
323
     tk_rori,
324
     tk_rshift,
325
     tk_rtd,
326
     tk_rte,
327
     tk_rtf,
328
     tk_rti,
329
     tk_rtl,
330
     tk_rts,
331
     tk_sb,
332
     tk_sc,
333
     tk_sei,
334
     tk_seq,
335
     tk_seqi,
336
         tk_sf,
337
     tk_sfd,
338
         tk_sfq,
339
     tk_sgt,
340
     tk_sgti,
341
     tk_sgtu,
342
     tk_sgtui,
343
     tk_sge,
344
     tk_sgei,
345
     tk_sgeu,
346
     tk_sgeui,
347
     tk_sh,
348
     tk_shl,
349
     tk_shli,
350
     tk_shr,
351
     tk_shri,
352
     tk_shru,
353
     tk_shrui,
354
     tk_slli,
355
     tk_slt,
356
     tk_slti,
357
     tk_sltu,
358
     tk_sltui,
359
     tk_sle,
360
     tk_slei,
361
     tk_sleu,
362
     tk_sleui,
363
     tk_smr,
364
     tk_sne,
365
     tk_snei,
366
     tk_sptr,
367
     tk_srai,
368
     tk_srli,
369
     tk_ss,
370
         tk_stb,
371
         tk_std,
372
         tk_stdcr,
373
         tk_stp,
374
         tk_stt,
375
         tk_stw,
376
         tk_stcb,
377
     tk_stcmp,
378
     tk_stmov,
379
     tk_stop,
380
     tk_stset,
381
     tk_stsb,
382
     tk_stsc,
383
     tk_stsh,
384
     tk_stsw,
385
     tk_sub,
386
     tk_subi,
387
     tk_subu,
388
     tk_subui,
389
         tk_sv,
390
     tk_sw,
391
     tk_swc,
392
     tk_swcr,
393
     tk_swap,
394
         tk_swp,
395
     tk_sws,
396
     tk_sxb,
397
     tk_sxc,
398
     tk_sxh,
399
     tk_sync,
400
     tk_sys,
401
         tk_tgt,
402
     tk_tlbdis,
403
     tk_tlben,
404
     tk_tlbpb,
405
     tk_tlbrd,
406
     tk_tlbrdreg,
407
     tk_tlbwi,
408
     tk_tlbwr,
409
     tk_tlbwrreg,
410
     tk_tls,
411
     tk_to,
412
     tk_tst,
413
         tk_unlink,
414
         tk_vadd,
415
         tk_vadds,
416
         tk_vand,
417
         tk_vands,
418
         tk_vdiv,
419
         tk_vdivs,
420
         tk_vmov,
421
         tk_vmul,
422
         tk_vmuls,
423
         tk_vor,
424
         tk_vors,
425
         tk_vseq,
426
         tk_vsge,
427
         tk_vslt,
428
         tk_vsne,
429
         tk_vsub,
430
         tk_vsubs,
431
         tk_vxor,
432
         tk_vxors,
433
     tk_wai,
434
     tk_xnor,
435
     tk_xor,
436
     tk_xori,
437
     tk_zs,
438
         tk_zsev,
439
         tk_zsp,
440
         tk_zsod,
441
         tk_zsn,
442
         tk_zsnp,
443
         tk_zsnn,
444
         tk_zsnz,
445
         tk_zsz,
446
     tk_zxb,
447
     tk_zxc,
448
     tk_zxh
449
};
450
 
451
extern int token;
452
extern int isIdentChar(char ch);
453
extern void ScanToEOL();
454
extern int NextToken();
455
extern void SkipSpaces();
456
extern void prevToken();
457
extern int need(int);
458
extern int expect(int);
459
extern int getRegister();
460
extern int getSprRegister();
461
extern int getFPRegister();
462
extern int getFPRoundMode();
463
 
464
#endif

powered by: WebSVN 2.1.0

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